1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 23:57:34 +02:00

Add id() to playlistinterface for comparison

This commit is contained in:
Jeff Mitchell
2012-02-02 16:05:51 -05:00
parent 95f3ead710
commit 72b6252ab5
3 changed files with 9 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ PlaylistInterface::PlaylistInterface ()
: QObject() : QObject()
, m_latchMode( StayOnSong ) , m_latchMode( StayOnSong )
{ {
m_id = uuid();
qRegisterMetaType<Tomahawk::PlaylistInterface::RepeatMode>( "Tomahawk::PlaylistInterface::RepeatMode" ); qRegisterMetaType<Tomahawk::PlaylistInterface::RepeatMode>( "Tomahawk::PlaylistInterface::RepeatMode" );
} }

View File

@@ -44,6 +44,8 @@ public:
explicit PlaylistInterface(); explicit PlaylistInterface();
virtual ~PlaylistInterface(); virtual ~PlaylistInterface();
const QString id() { return m_id; }
virtual QList< Tomahawk::query_ptr > tracks() = 0; virtual QList< Tomahawk::query_ptr > tracks() = 0;
virtual int unfilteredTrackCount() const = 0; virtual int unfilteredTrackCount() const = 0;
@@ -98,6 +100,7 @@ protected:
private: private:
Q_DISABLE_COPY( PlaylistInterface ) Q_DISABLE_COPY( PlaylistInterface )
QString m_id;
QString m_filter; QString m_filter;
}; };

View File

@@ -158,10 +158,13 @@ AlbumInfoWidget::onLoadingFinished()
bool bool
AlbumInfoWidget::isBeingPlayed() const AlbumInfoWidget::isBeingPlayed() const
{ {
if ( ui->albumsView->playlistInterface() == AudioEngine::instance()->currentTrackPlaylist() ) //tDebug() << Q_FUNC_INFO << "audioengine playlistInterface = " << AudioEngine::instance()->currentTrackPlaylist()->id();
//tDebug() << Q_FUNC_INFO << "albumsView playlistInterface = " << ui->albumsView->playlistInterface()->id();
//tDebug() << Q_FUNC_INFO << "tracksView playlistInterface = " << ui->tracksView->playlistInterface()->id();
if ( ui->albumsView->playlistInterface()->id() == AudioEngine::instance()->currentTrackPlaylist()->id() )
return true; return true;
if ( ui->tracksView->playlistInterface() == AudioEngine::instance()->currentTrackPlaylist() ) if ( ui->tracksView->playlistInterface()->id() == AudioEngine::instance()->currentTrackPlaylist()->id() )
return true; return true;
return false; return false;