mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
* Emit Playlist::aboutToBeDeleted from inside Playlist.
This commit is contained in:
@@ -503,10 +503,13 @@ void
|
|||||||
Playlist::removeFromDatabase()
|
Playlist::removeFromDatabase()
|
||||||
{
|
{
|
||||||
Q_D( Playlist );
|
Q_D( Playlist );
|
||||||
|
|
||||||
|
emit aboutToBeDeleted( d->weakSelf.toStrongRef() );
|
||||||
DatabaseCommand_DeletePlaylist* cmd = new DatabaseCommand_DeletePlaylist( d->source, d->guid );
|
DatabaseCommand_DeletePlaylist* cmd = new DatabaseCommand_DeletePlaylist( d->source, d->guid );
|
||||||
Database::instance()->enqueue( Tomahawk::dbcmd_ptr(cmd) );
|
Database::instance()->enqueue( Tomahawk::dbcmd_ptr( cmd ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Playlist::Playlist( PlaylistPrivate *d )
|
Playlist::Playlist( PlaylistPrivate *d )
|
||||||
: d_ptr( d )
|
: d_ptr( d )
|
||||||
{
|
{
|
||||||
@@ -906,7 +909,6 @@ Playlist::updaters() const
|
|||||||
void
|
void
|
||||||
PlaylistRemovalHandler::remove( const playlist_ptr& playlist )
|
PlaylistRemovalHandler::remove( const playlist_ptr& playlist )
|
||||||
{
|
{
|
||||||
emit playlist->aboutToBeDeleted( playlist );
|
|
||||||
playlist->removeFromDatabase();
|
playlist->removeFromDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -87,9 +87,9 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Playlist* q_ptr;
|
Playlist* q_ptr;
|
||||||
Q_DECLARE_PUBLIC ( Playlist )
|
Q_DECLARE_PUBLIC ( Playlist )
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWeakPointer< Playlist > weakSelf;
|
QWeakPointer< Playlist > weakSelf;
|
||||||
source_ptr source;
|
source_ptr source;
|
||||||
|
Reference in New Issue
Block a user