mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 19:37:09 +02:00
* Fixed DbCmds for offline sources. Well hopefully.
This commit is contained in:
@@ -33,6 +33,11 @@ void
|
|||||||
DatabaseCommand_AddFiles::postCommitHook()
|
DatabaseCommand_AddFiles::postCommitHook()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if ( source().isNull() || source()->collection().isNull() )
|
||||||
|
{
|
||||||
|
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// make the collection object emit its tracksAdded signal, so the
|
// make the collection object emit its tracksAdded signal, so the
|
||||||
// collection browser will update/fade in etc.
|
// collection browser will update/fade in etc.
|
||||||
|
@@ -79,6 +79,12 @@ void
|
|||||||
DatabaseCommand_CreateDynamicPlaylist::postCommitHook()
|
DatabaseCommand_CreateDynamicPlaylist::postCommitHook()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if ( source().isNull() || source()->collection().isNull() )
|
||||||
|
{
|
||||||
|
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( report() == false )
|
if( report() == false )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -38,6 +38,11 @@ void
|
|||||||
DatabaseCommand_CreatePlaylist::postCommitHook()
|
DatabaseCommand_CreatePlaylist::postCommitHook()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if ( source().isNull() || source()->collection().isNull() )
|
||||||
|
{
|
||||||
|
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
if( m_report == false )
|
if( m_report == false )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -46,6 +46,11 @@ void
|
|||||||
DatabaseCommand_DeleteDynamicPlaylist::postCommitHook()
|
DatabaseCommand_DeleteDynamicPlaylist::postCommitHook()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "..reporting..:" << m_playlistguid;
|
qDebug() << Q_FUNC_INFO << "..reporting..:" << m_playlistguid;
|
||||||
|
if ( source().isNull() || source()->collection().isNull() )
|
||||||
|
{
|
||||||
|
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dynplaylist_ptr playlist = source()->collection()->dynamicPlaylist( m_playlistguid );
|
dynplaylist_ptr playlist = source()->collection()->dynamicPlaylist( m_playlistguid );
|
||||||
Q_ASSERT( !playlist.isNull() );
|
Q_ASSERT( !playlist.isNull() );
|
||||||
|
@@ -34,6 +34,11 @@ void
|
|||||||
DatabaseCommand_DeletePlaylist::postCommitHook()
|
DatabaseCommand_DeletePlaylist::postCommitHook()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "..reporting..";
|
qDebug() << Q_FUNC_INFO << "..reporting..";
|
||||||
|
if ( source().isNull() || source()->collection().isNull() )
|
||||||
|
{
|
||||||
|
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
playlist_ptr playlist = source()->collection()->playlist( m_playlistguid );
|
playlist_ptr playlist = source()->collection()->playlist( m_playlistguid );
|
||||||
Q_ASSERT( !playlist.isNull() );
|
Q_ASSERT( !playlist.isNull() );
|
||||||
|
@@ -15,6 +15,11 @@ void
|
|||||||
DatabaseCommand_LogPlayback::postCommitHook()
|
DatabaseCommand_LogPlayback::postCommitHook()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if ( source().isNull() || source()->collection().isNull() )
|
||||||
|
{
|
||||||
|
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
connect( this, SIGNAL( trackPlaying( Tomahawk::query_ptr ) ),
|
connect( this, SIGNAL( trackPlaying( Tomahawk::query_ptr ) ),
|
||||||
source().data(), SIGNAL( playbackStarted( Tomahawk::query_ptr ) ), Qt::QueuedConnection );
|
source().data(), SIGNAL( playbackStarted( Tomahawk::query_ptr ) ), Qt::QueuedConnection );
|
||||||
|
@@ -37,6 +37,11 @@ void
|
|||||||
DatabaseCommand_RenamePlaylist::postCommitHook()
|
DatabaseCommand_RenamePlaylist::postCommitHook()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "..reporting..";
|
qDebug() << Q_FUNC_INFO << "..reporting..";
|
||||||
|
if ( source().isNull() || source()->collection().isNull() )
|
||||||
|
{
|
||||||
|
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
playlist_ptr playlist = source()->collection()->playlist( m_playlistguid );
|
playlist_ptr playlist = source()->collection()->playlist( m_playlistguid );
|
||||||
Q_ASSERT( !playlist.isNull() );
|
Q_ASSERT( !playlist.isNull() );
|
||||||
|
@@ -60,6 +60,11 @@ void
|
|||||||
DatabaseCommand_SetDynamicPlaylistRevision::postCommitHook()
|
DatabaseCommand_SetDynamicPlaylistRevision::postCommitHook()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if ( source().isNull() || source()->collection().isNull() )
|
||||||
|
{
|
||||||
|
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QStringList orderedentriesguids;
|
QStringList orderedentriesguids;
|
||||||
foreach( const QVariant& v, orderedguids() )
|
foreach( const QVariant& v, orderedguids() )
|
||||||
|
@@ -37,6 +37,11 @@ void
|
|||||||
DatabaseCommand_SetPlaylistRevision::postCommitHook()
|
DatabaseCommand_SetPlaylistRevision::postCommitHook()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
if ( source().isNull() || source()->collection().isNull() )
|
||||||
|
{
|
||||||
|
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( m_localOnly )
|
if ( m_localOnly )
|
||||||
return;
|
return;
|
||||||
|
@@ -87,7 +87,6 @@ DatabaseWorker::doWork()
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( !cmd->source().isNull() && !cmd->source()->collection().isNull() )
|
|
||||||
{
|
{
|
||||||
cmd->_exec( m_dbimpl ); // runs actual SQL stuff
|
cmd->_exec( m_dbimpl ); // runs actual SQL stuff
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user