1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

TabTreeModel: Don't allow to move pinned tabs

This commit is contained in:
David Rosca 2018-01-31 19:56:31 +01:00
parent 85def54d3c
commit dc8ddb03c1
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -108,10 +108,15 @@ WebTab *TabTreeModel::tab(const QModelIndex &index) const
Qt::ItemFlags TabTreeModel::flags(const QModelIndex &index) const Qt::ItemFlags TabTreeModel::flags(const QModelIndex &index) const
{ {
if (!index.isValid()) { TabTreeModelItem *it = item(index);
if (!it || !it->tab) {
return Qt::ItemIsDropEnabled; return Qt::ItemIsDropEnabled;
} }
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled; Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
if (!it->tab->isPinned()) {
flags |= Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled;
}
return flags;
} }
QVariant TabTreeModel::data(const QModelIndex &index, int role) const QVariant TabTreeModel::data(const QModelIndex &index, int role) const