mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-16 02:54:33 +02:00
Rename playlist if title changes when updating from XSPF
This commit is contained in:
@@ -112,6 +112,14 @@ XspfUpdater::updateNow()
|
||||
void
|
||||
XspfUpdater::playlistLoaded( const QList<Tomahawk::query_ptr>& newEntries )
|
||||
{
|
||||
XSPFLoader* loader = qobject_cast< XSPFLoader* >( sender() );
|
||||
if ( loader )
|
||||
{
|
||||
const QString newTitle = loader->title();
|
||||
if ( newTitle != playlist()->title() )
|
||||
playlist()->rename( newTitle );
|
||||
}
|
||||
|
||||
QList< query_ptr > tracks;
|
||||
foreach ( const plentry_ptr ple, playlist()->entries() )
|
||||
tracks << ple->query();
|
||||
|
@@ -33,7 +33,7 @@ class DLLEXPORT XspfUpdater : public PlaylistUpdaterInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
XspfUpdater( const playlist_ptr& pl, int interval, bool autoUpdate, const QString& xspfUrl );
|
||||
XspfUpdater( const playlist_ptr& pl, int interval /* ms */, bool autoUpdate, const QString& xspfUrl );
|
||||
|
||||
virtual ~XspfUpdater();
|
||||
|
||||
|
@@ -89,6 +89,13 @@ XSPFLoader::entries() const
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
XSPFLoader::title() const
|
||||
{
|
||||
return m_title;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
XSPFLoader::load( const QUrl& url )
|
||||
{
|
||||
|
@@ -45,6 +45,7 @@ public:
|
||||
|
||||
virtual ~XSPFLoader();
|
||||
QList< Tomahawk::query_ptr > entries() const;
|
||||
QString title() const;
|
||||
|
||||
void setOverrideTitle( const QString& newTitle );
|
||||
void setAutoResolveTracks( bool autoResolve ) { m_autoResolve = autoResolve; }
|
||||
|
Reference in New Issue
Block a user