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

* Don't update playlist revision with result hints if it's already out of date.

This commit is contained in:
Christian Muehlhaeuser
2011-09-12 13:52:54 +02:00
parent 0e069c6b88
commit 0dbe87e2f4

View File

@@ -372,6 +372,7 @@ Playlist::setRevision( const QString& rev,
{ {
// add initial tracks // add initial tracks
createNewRevision( uuid(), currentrevision(), m_initEntries ); createNewRevision( uuid(), currentrevision(), m_initEntries );
m_initEntries.clear();
} }
else else
emit revisionLoaded( pr ); emit revisionLoaded( pr );
@@ -491,7 +492,6 @@ Playlist::onResolvingFinished()
{ {
if ( m_locallyChanged ) if ( m_locallyChanged )
{ {
qDebug() << Q_FUNC_INFO;
m_locallyChanged = false; m_locallyChanged = false;
createNewRevision( currentrevision(), currentrevision(), m_entries ); createNewRevision( currentrevision(), currentrevision(), m_entries );
} }
@@ -578,14 +578,19 @@ Playlist::setBusy( bool b )
emit changed(); emit changed();
} }
void void
Playlist::checkRevisionQueue() Playlist::checkRevisionQueue()
{ {
if ( !m_revisionQueue.isEmpty() ) if ( !m_revisionQueue.isEmpty() )
{ {
RevisionQueueItem item = m_revisionQueue.dequeue(); RevisionQueueItem item = m_revisionQueue.dequeue();
if ( item.oldRev != currentrevision() && item.applyToTip ) // this was applied to the then-latest, but the already-running operation changed it so it's out of date now. fix it if ( item.oldRev != currentrevision() && item.applyToTip ) // this was applied to the then-latest, but the already-running operation changed it so it's out of date now. fix it
{ {
if ( item.oldRev == item.newRev )
return;
item.oldRev = currentrevision(); item.oldRev = currentrevision();
} }
createNewRevision( item.newRev, item.oldRev, item.entries ); createNewRevision( item.newRev, item.oldRev, item.entries );