1
0
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:
Leo Franchi
2012-09-19 15:44:07 -04:00
parent 1487f7a64a
commit 4a7c2fd2b4
4 changed files with 17 additions and 1 deletions

View File

@@ -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();

View File

@@ -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();

View File

@@ -89,6 +89,13 @@ XSPFLoader::entries() const
}
QString
XSPFLoader::title() const
{
return m_title;
}
void
XSPFLoader::load( const QUrl& url )
{

View File

@@ -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; }