mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-23 17:29:42 +01:00
* Made DatabaseCommand_CreateDynamicPlaylist and
DatabaseCommand_CreatePlaylist independent of ViewManager
This commit is contained in:
parent
4949e787a3
commit
811c0e618d
@ -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() )
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user