mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-30 00:55:33 +01:00
CollectionModel: Add ItemNeverHasChildren
This commit is contained in:
parent
32be33847c
commit
f2eb0c3b6b
@ -389,12 +389,13 @@ QVariant CollectionModel::data(const CollectionItem *item, const int role) const
|
||||
Qt::ItemFlags CollectionModel::flags(const QModelIndex &idx) const {
|
||||
|
||||
switch (IndexToItem(idx)->type) {
|
||||
case CollectionItem::Type::Song:
|
||||
case CollectionItem::Type::Container:
|
||||
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled;
|
||||
case CollectionItem::Type::Divider:
|
||||
case CollectionItem::Type::Root:
|
||||
case CollectionItem::Type::LoadingIndicator:
|
||||
case CollectionItem::Type::Divider:
|
||||
return Qt::ItemIsEnabled | Qt::ItemNeverHasChildren;
|
||||
case CollectionItem::Type::Container:
|
||||
case CollectionItem::Type::Song:
|
||||
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled;
|
||||
case CollectionItem::Type::Root:
|
||||
default:
|
||||
return Qt::ItemIsEnabled;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user