mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-02 18:33:16 +02:00
* Now we can have temporary dynamic playlists.
This commit is contained in:
@@ -150,17 +150,20 @@ DynamicPlaylist::create( const Tomahawk::source_ptr& author,
|
|||||||
GeneratorMode mode,
|
GeneratorMode mode,
|
||||||
bool shared,
|
bool shared,
|
||||||
const QString& type,
|
const QString& type,
|
||||||
bool autoLoad
|
bool autoLoad,
|
||||||
)
|
bool temporary )
|
||||||
{
|
{
|
||||||
dynplaylist_ptr dynplaylist = Tomahawk::dynplaylist_ptr( new DynamicPlaylist( author, guid, title, info, creator, type, mode, shared, autoLoad ), &QObject::deleteLater );
|
dynplaylist_ptr dynplaylist = Tomahawk::dynplaylist_ptr( new DynamicPlaylist( author, guid, title, info, creator, type, mode, shared, autoLoad ), &QObject::deleteLater );
|
||||||
dynplaylist->setWeakSelf( dynplaylist.toWeakRef() );
|
dynplaylist->setWeakSelf( dynplaylist.toWeakRef() );
|
||||||
|
|
||||||
|
if ( !temporary )
|
||||||
|
{
|
||||||
DatabaseCommand_CreateDynamicPlaylist* cmd = new DatabaseCommand_CreateDynamicPlaylist( author, dynplaylist, autoLoad );
|
DatabaseCommand_CreateDynamicPlaylist* cmd = new DatabaseCommand_CreateDynamicPlaylist( author, dynplaylist, autoLoad );
|
||||||
connect( cmd, SIGNAL( finished() ), dynplaylist.data(), SIGNAL( created() ) );
|
connect( cmd, SIGNAL( finished() ), dynplaylist.data(), SIGNAL( created() ) );
|
||||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
||||||
if ( autoLoad )
|
if ( autoLoad )
|
||||||
dynplaylist->reportCreated( dynplaylist );
|
dynplaylist->reportCreated( dynplaylist );
|
||||||
|
}
|
||||||
|
|
||||||
return dynplaylist;
|
return dynplaylist;
|
||||||
}
|
}
|
||||||
|
@@ -85,7 +85,8 @@ public:
|
|||||||
GeneratorMode mode,
|
GeneratorMode mode,
|
||||||
bool shared,
|
bool shared,
|
||||||
const QString& type = QString(),
|
const QString& type = QString(),
|
||||||
bool autoLoad = true
|
bool autoLoad = true,
|
||||||
|
bool temporary = false
|
||||||
);
|
);
|
||||||
|
|
||||||
static void remove( const dynplaylist_ptr& playlist );
|
static void remove( const dynplaylist_ptr& playlist );
|
||||||
|
Reference in New Issue
Block a user