diff --git a/src/libtomahawk/database/DatabaseCommand_CreateDynamicPlaylist.cpp b/src/libtomahawk/database/DatabaseCommand_CreateDynamicPlaylist.cpp index ad8d8e374..b64c45b5f 100644 --- a/src/libtomahawk/database/DatabaseCommand_CreateDynamicPlaylist.cpp +++ b/src/libtomahawk/database/DatabaseCommand_CreateDynamicPlaylist.cpp @@ -114,14 +114,13 @@ DatabaseCommand_CreateDynamicPlaylist::postCommitHook() qDebug() << Q_FUNC_INFO << "..reporting.."; if( m_playlist.isNull() ) { source_ptr src = source(); -#ifndef ENABLE_HEADLESS - QMetaObject::invokeMethod( ViewManager::instance(), - "createDynamicPlaylist", - Qt::BlockingQueuedConnection, - QGenericArgument( "Tomahawk::source_ptr", (const void*)&src ), - Q_ARG( QVariant, m_v ) ); -#endif - } else { + + Tomahawk::dynplaylist_ptr p = Tomahawk::dynplaylist_ptr( new Tomahawk::DynamicPlaylist( src, m_v.toMap().value( "type", QString() ).toString() ) ); + QJson::QObjectHelper::qvariant2qobject( m_v.toMap(), p.data() ); + p->reportCreated( p ); + } + else + { m_playlist->reportCreated( m_playlist ); } if( source()->isLocal() ) diff --git a/src/libtomahawk/database/DatabaseCommand_CreatePlaylist.cpp b/src/libtomahawk/database/DatabaseCommand_CreatePlaylist.cpp index 31fb7e285..f2e2ce771 100644 --- a/src/libtomahawk/database/DatabaseCommand_CreatePlaylist.cpp +++ b/src/libtomahawk/database/DatabaseCommand_CreatePlaylist.cpp @@ -82,13 +82,10 @@ DatabaseCommand_CreatePlaylist::postCommitHook() if ( m_playlist.isNull() ) { source_ptr src = source(); -#ifndef ENABLE_HEADLESS - QMetaObject::invokeMethod( ViewManager::instance(), - "createPlaylist", - Qt::BlockingQueuedConnection, - QGenericArgument( "Tomahawk::source_ptr", (const void*)&src ), - Q_ARG( QVariant, m_v ) ); -#endif + + Tomahawk::playlist_ptr p = Tomahawk::playlist_ptr( new Tomahawk::Playlist( src ) ); + QJson::QObjectHelper::qvariant2qobject( m_v.toMap(), p.data() ); + p->reportCreated( p ); } else {