From 46a73566f582fd8fda55c0ebbf492e8d2fd7d8a7 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Sun, 2 Oct 2011 18:05:32 -0400 Subject: [PATCH] Don't create a new revision when resolvign is finished if we've been deleted meanwhile --- src/libtomahawk/playlist.cpp | 4 +++- src/libtomahawk/playlist.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/playlist.cpp b/src/libtomahawk/playlist.cpp index 6a94ed2c1..f600af761 100644 --- a/src/libtomahawk/playlist.cpp +++ b/src/libtomahawk/playlist.cpp @@ -147,6 +147,7 @@ void Playlist::init() { m_busy = false; + m_deleted = false; m_locallyChanged = false; connect( Pipeline::instance(), SIGNAL( idle() ), SLOT( onResolvingFinished() ) ); } @@ -248,6 +249,7 @@ void Playlist::reportDeleted( const Tomahawk::playlist_ptr& self ) { Q_ASSERT( self.data() == this ); + m_deleted = true; m_source->collection()->deletePlaylist( self ); emit deleted( self ); @@ -480,7 +482,7 @@ Playlist::onResultsFound( const QList& results ) void Playlist::onResolvingFinished() { - if ( m_locallyChanged ) + if ( m_locallyChanged && !m_deleted ) { m_locallyChanged = false; createNewRevision( currentrevision(), currentrevision(), m_entries ); diff --git a/src/libtomahawk/playlist.h b/src/libtomahawk/playlist.h index 23831332b..bbb1390b5 100644 --- a/src/libtomahawk/playlist.h +++ b/src/libtomahawk/playlist.h @@ -295,6 +295,7 @@ private: QQueue m_revisionQueue; bool m_locallyChanged; + bool m_deleted; bool m_busy; };