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