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

* Fixed DbCmds for offline sources. Well hopefully.

This commit is contained in:
Christian Muehlhaeuser
2011-02-16 05:52:17 +01:00
parent a7f90d097d
commit e1d5d8ec22
10 changed files with 50 additions and 5 deletions

View File

@@ -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.

View File

@@ -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;

View File

@@ -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;

View File

@@ -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() );

View File

@@ -34,6 +34,11 @@ 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() );

View File

@@ -15,6 +15,11 @@ 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 );

View File

@@ -37,6 +37,11 @@ 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() );

View File

@@ -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() )

View File

@@ -37,6 +37,11 @@ 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;

View File

@@ -87,7 +87,6 @@ DatabaseWorker::doWork()
}
try
{
if ( !cmd->source().isNull() && !cmd->source()->collection().isNull() )
{
cmd->_exec( m_dbimpl ); // runs actual SQL stuff