mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-30 01:00:13 +02:00
remove empty Playlists or Stations entry if all are deleted from peers
This commit is contained in:
@@ -192,6 +192,14 @@ CollectionItem::playlistDeletedInternal( SourceTreeItem* parent, const T& p )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( parent->children().isEmpty() && parent->parent() ) // Don't leave an empty Playlist or Station category
|
||||
{
|
||||
int idx = parent->parent()->children().indexOf( parent );
|
||||
parent->parent()->beginRowsRemoved( idx, idx );
|
||||
parent->parent()->removeChild( parent );
|
||||
parent->parent()->endRowsRemoved();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user