From 3fbd58fcc9424ed18e9718b5a1ea1abb30d9b885 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Thu, 26 Jul 2012 22:41:50 -0400 Subject: [PATCH] Call playlist results if an updater has a custom deleter regardless --- src/libtomahawk/Playlist.cpp | 3 +-- src/libtomahawk/accounts/spotify/SpotifyPlaylistUpdater.h | 1 + src/libtomahawk/playlist/PlaylistUpdaterInterface.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libtomahawk/Playlist.cpp b/src/libtomahawk/Playlist.cpp index a90834132..3e21c36b5 100644 --- a/src/libtomahawk/Playlist.cpp +++ b/src/libtomahawk/Playlist.cpp @@ -318,7 +318,7 @@ Playlist::hasCustomDeleter() const { foreach ( PlaylistUpdaterInterface* updater, m_updaters ) { - if ( !updater->deleteQuestions().isEmpty() ) + if ( updater->hasCustomDeleter() ) return true; } @@ -341,7 +341,6 @@ Playlist::customDelete( const QPoint& leftCenter ) questions.append( updater->deleteQuestions() ); } - Q_ASSERT( !questions.isEmpty() ); SourceTreePopupDialog* dialog = new SourceTreePopupDialog; NewClosure( dialog, SIGNAL( result( bool ) ), this, SLOT( onDeleteResult( SourceTreePopupDialog* ) ), dialog ); diff --git a/src/libtomahawk/accounts/spotify/SpotifyPlaylistUpdater.h b/src/libtomahawk/accounts/spotify/SpotifyPlaylistUpdater.h index d72c17248..133ab1274 100644 --- a/src/libtomahawk/accounts/spotify/SpotifyPlaylistUpdater.h +++ b/src/libtomahawk/accounts/spotify/SpotifyPlaylistUpdater.h @@ -64,6 +64,7 @@ public: void setCanSubscribe( bool canSub ); QString spotifyId() const { return m_spotifyId; } + virtual bool hasCustomDeleter() const { return true; } virtual Tomahawk::PlaylistDeleteQuestions deleteQuestions() const; virtual void setQuestionResults( const QMap< int, bool > results ); diff --git a/src/libtomahawk/playlist/PlaylistUpdaterInterface.h b/src/libtomahawk/playlist/PlaylistUpdaterInterface.h index 61885dd6d..92e46e235 100644 --- a/src/libtomahawk/playlist/PlaylistUpdaterInterface.h +++ b/src/libtomahawk/playlist/PlaylistUpdaterInterface.h @@ -87,6 +87,7 @@ public: // The int data value associated with each question must be unique across *all* playlist updaters, // as setQuestionResults is called with all questions from all updaters. + virtual bool hasCustomDeleter() const { return false; } virtual PlaylistDeleteQuestions deleteQuestions() const { return PlaylistDeleteQuestions(); } virtual void setQuestionResults( const QMap< int, bool > results ) {}