1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 03:40:16 +02:00

Don't create a new revision when resolvign is finished if we've been deleted meanwhile

This commit is contained in:
Leo Franchi
2011-10-02 18:05:32 -04:00
parent 2de19a1c94
commit 46a73566f5
2 changed files with 4 additions and 1 deletions

View File

@@ -147,6 +147,7 @@ void
Playlist::init() Playlist::init()
{ {
m_busy = false; m_busy = false;
m_deleted = false;
m_locallyChanged = false; m_locallyChanged = false;
connect( Pipeline::instance(), SIGNAL( idle() ), SLOT( onResolvingFinished() ) ); connect( Pipeline::instance(), SIGNAL( idle() ), SLOT( onResolvingFinished() ) );
} }
@@ -248,6 +249,7 @@ void
Playlist::reportDeleted( const Tomahawk::playlist_ptr& self ) Playlist::reportDeleted( const Tomahawk::playlist_ptr& self )
{ {
Q_ASSERT( self.data() == this ); Q_ASSERT( self.data() == this );
m_deleted = true;
m_source->collection()->deletePlaylist( self ); m_source->collection()->deletePlaylist( self );
emit deleted( self ); emit deleted( self );
@@ -480,7 +482,7 @@ Playlist::onResultsFound( const QList<Tomahawk::result_ptr>& results )
void void
Playlist::onResolvingFinished() Playlist::onResolvingFinished()
{ {
if ( m_locallyChanged ) if ( m_locallyChanged && !m_deleted )
{ {
m_locallyChanged = false; m_locallyChanged = false;
createNewRevision( currentrevision(), currentrevision(), m_entries ); createNewRevision( currentrevision(), currentrevision(), m_entries );

View File

@@ -295,6 +295,7 @@ private:
QQueue<RevisionQueueItem> m_revisionQueue; QQueue<RevisionQueueItem> m_revisionQueue;
bool m_locallyChanged; bool m_locallyChanged;
bool m_deleted;
bool m_busy; bool m_busy;
}; };