1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-13 20:39:57 +01:00

fix loading and saving of dynamic playlists, forgot to update the mode and type settings when setting a new revision

This commit is contained in:
Leo Franchi 2011-01-13 18:33:38 -05:00
parent 9ff370199c
commit 327df4bedc
2 changed files with 21 additions and 4 deletions

View File

@ -141,4 +141,18 @@ DatabaseCommand_SetDynamicPlaylistRevision::exec( DatabaseImpl* lib )
controlsQuery.exec();
}
if( m_applied )
{
qDebug() << "updating dynamic playlist, optimistic locking okay";
TomahawkSqlQuery query2 = lib->newquery();
query2.prepare( "UPDATE dynamic_playlist SET pltype = ?, plmode = ? WHERE guid = ?" );
query2.bindValue( 0, m_type );
query2.bindValue( 1, m_mode );
query2.bindValue( 2, m_playlistguid );
query2.exec();
}
}

View File

@ -316,11 +316,11 @@ void DynamicPlaylist::setRevision( const QString& rev,
dpr.type = type;
dpr.mode = Static;
if( applied )
if( applied ) {
setCurrentrevision( rev );
}
// qDebug() << "EMITTING REVISION LOADED 1!";
emit dynamicRevisionLoaded( dpr );
emit dynamicRevisionLoaded( dpr );
}
@ -385,7 +385,10 @@ void DynamicPlaylist::setRevision( const QString& rev,
dpr.controls = controls;
dpr.type = type;
dpr.mode = OnDemand;
if( applied ) {
setCurrentrevision( rev );
}
// qDebug() << "EMITTING REVISION LOADED 2!";
emit dynamicRevisionLoaded( dpr );
}