1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-30 09:10:53 +02:00

remove empty Playlists or Stations entry if all are deleted from peers

This commit is contained in:
Leo Franchi
2011-07-31 19:46:24 -04:00
parent 432d6af37c
commit 7ea0de753e

View File

@@ -192,6 +192,14 @@ CollectionItem::playlistDeletedInternal( SourceTreeItem* parent, const T& p )
break; 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();
}
} }