diff --git a/src/accounts/spotify/SpotifyAccount.cpp b/src/accounts/spotify/SpotifyAccount.cpp index a05dc6e5c..16b9e22a0 100644 --- a/src/accounts/spotify/SpotifyAccount.cpp +++ b/src/accounts/spotify/SpotifyAccount.cpp @@ -342,13 +342,16 @@ SpotifyAccount::aboutToShow( QAction* action, const playlist_ptr& playlist ) // If it's not being synced, allow the option to sync bool found = false; + bool manuallyDisabled = false; QList updaters = playlist->updaters(); foreach ( PlaylistUpdaterInterface* updater, updaters ) { if ( SpotifyPlaylistUpdater* spotifyUpdater = qobject_cast< SpotifyPlaylistUpdater* >( updater ) ) { - if ( spotifyUpdater->sync() ) - found = true; + found = true; + if ( !spotifyUpdater->sync() ) + manuallyDisabled = true; + } } @@ -356,6 +359,10 @@ SpotifyAccount::aboutToShow( QAction* action, const playlist_ptr& playlist ) { action->setText( tr( "Sync with Spotify" ) ); } + else if ( manuallyDisabled ) + { + action->setText( tr( "Re-enable syncing with Spotify" ) ); + } else { action->setText( tr( "Stop syncing with Spotify" ) ); diff --git a/src/libtomahawk/playlist/PlaylistUpdaterInterface.h b/src/libtomahawk/playlist/PlaylistUpdaterInterface.h index b05621995..0776451bd 100644 --- a/src/libtomahawk/playlist/PlaylistUpdaterInterface.h +++ b/src/libtomahawk/playlist/PlaylistUpdaterInterface.h @@ -71,6 +71,8 @@ public: static void registerUpdaterFactory( PlaylistUpdaterFactory* f ); + virtual bool sync() const { return true; } + signals: void changed(); diff --git a/src/sourcetree/items/PlaylistItems.cpp b/src/sourcetree/items/PlaylistItems.cpp index f7b37ac5a..d0bebc7a4 100644 --- a/src/sourcetree/items/PlaylistItems.cpp +++ b/src/sourcetree/items/PlaylistItems.cpp @@ -251,13 +251,6 @@ PlaylistItem::parsedDroppedTracks( const QList< query_ptr >& tracks ) void PlaylistItem::onUpdated() { - // No work todo - if ( !m_overlaidIcon.isNull() && m_overlaidUpdaters.operator==( m_playlist->updaters() ) ) - { - emit updated(); - return; - } - const bool newOverlay = createOverlay(); if ( !newOverlay && !m_overlaidIcon.isNull() ) m_overlaidIcon = QIcon(); @@ -278,7 +271,7 @@ PlaylistItem::createOverlay() QList< QPixmap > icons; foreach ( PlaylistUpdaterInterface* updater, m_playlist->updaters() ) { - if ( !updater->typeIcon().isNull() ) + if ( updater->sync() && !updater->typeIcon().isNull() ) icons << updater->typeIcon(); }