1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-15 10:33:59 +02:00

* Fixed updating result-hints for out-dated dynamic playlists.

This commit is contained in:
Christian Muehlhaeuser
2011-11-21 21:52:58 +01:00
parent 4f55c6aa9a
commit 1c1b6ea940
5 changed files with 16 additions and 4 deletions

View File

@@ -60,7 +60,7 @@ public:
virtual void exec( DatabaseImpl* lib ); virtual void exec( DatabaseImpl* lib );
virtual void postCommitHook(); virtual void postCommitHook();
virtual bool doesMutates() const { return true; } virtual bool doesMutates() const { return true; }
virtual bool groupable() const { return true; } virtual bool groupable() const { return false; }
void setControlsV( const QVariantList& vlist ) void setControlsV( const QVariantList& vlist )
{ {

View File

@@ -104,6 +104,7 @@ DatabaseCommand_SetPlaylistRevision::exec( DatabaseImpl* lib )
} }
else else
{ {
tDebug() << "Playlist:" << m_playlistguid << m_currentRevision << source()->friendlyName() << source()->id();
throw "No such playlist, WTF?"; throw "No such playlist, WTF?";
return; return;
} }

View File

@@ -294,6 +294,7 @@ void
Playlist::createNewRevision( const QString& newrev, const QString& oldrev, const QList< plentry_ptr >& entries ) Playlist::createNewRevision( const QString& newrev, const QString& oldrev, const QList< plentry_ptr >& entries )
{ {
tDebug() << Q_FUNC_INFO << newrev << oldrev << entries.count(); tDebug() << Q_FUNC_INFO << newrev << oldrev << entries.count();
Q_ASSERT( m_source->isLocal() || newrev == oldrev );
if ( busy() ) if ( busy() )
{ {

View File

@@ -185,6 +185,8 @@ DynamicPlaylist::createNewRevision( const QString& newrev,
const QList< dyncontrol_ptr>& controls, const QList< dyncontrol_ptr>& controls,
const QList< plentry_ptr >& entries ) const QList< plentry_ptr >& entries )
{ {
Q_ASSERT( m_source->isLocal() || newrev == oldrev );
if ( busy() ) if ( busy() )
{ {
m_revisionQueue.enqueue( DynQueueItem( newrev, oldrev, type, controls, (int)Static, entries, oldrev == currentrevision() ) ); m_revisionQueue.enqueue( DynQueueItem( newrev, oldrev, type, controls, (int)Static, entries, oldrev == currentrevision() ) );
@@ -230,6 +232,8 @@ DynamicPlaylist::createNewRevision( const QString& newrev,
const QString& type, const QString& type,
const QList< dyncontrol_ptr>& controls ) const QList< dyncontrol_ptr>& controls )
{ {
Q_ASSERT( m_source->isLocal() || newrev == oldrev );
if ( busy() ) if ( busy() )
{ {
m_revisionQueue.enqueue( DynQueueItem( newrev, oldrev, type, controls, (int)OnDemand, QList< plentry_ptr >(), oldrev == currentrevision() ) ); m_revisionQueue.enqueue( DynQueueItem( newrev, oldrev, type, controls, (int)OnDemand, QList< plentry_ptr >(), oldrev == currentrevision() ) );
@@ -533,8 +537,15 @@ DynamicPlaylist::checkRevisionQueue()
if ( item.oldRev != currentrevision() && item.applyToTip ) 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 // 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 )
{
checkRevisionQueue();
return;
}
item.oldRev = currentrevision(); item.oldRev = currentrevision();
} }
if( item.mode == Static ) if( item.mode == Static )
createNewRevision( item.newRev, item.oldRev, item.type, item.controls, item.entries ); createNewRevision( item.newRev, item.oldRev, item.type, item.controls, item.entries );
else else

View File

@@ -20,11 +20,11 @@
#include "tomahawkapp.h" #include "tomahawkapp.h"
#include "thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.h" #include "thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.h"
#include "ubuntuunityhack.h"
#include <QTranslator> #include <QTranslator>
#include "ubuntuunityhack.h"
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
#include "tomahawkapp_mac.h" #include "tomahawkapp_mac.h"
#include </System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/Headers/AppleEvents.h> #include </System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/Headers/AppleEvents.h>
@@ -70,7 +70,6 @@ main( int argc, char *argv[] )
a.init(); a.init();
QString locale = QLocale::system().name(); QString locale = QLocale::system().name();
QTranslator translator; QTranslator translator;
translator.load( QString( ":/lang/tomahawk_" ) + locale ); translator.load( QString( ":/lang/tomahawk_" ) + locale );
a.installTranslator( &translator ); a.installTranslator( &translator );