Commit 0b1cc0f4 authored by dt_'s avatar dt_
Browse files

ProjectModel: Only claim editable if editable

parent 1dbe498f
......@@ -289,7 +289,15 @@ Qt::ItemFlags FlatModel::flags(const QModelIndex &index) const
// We claim that everything is editable
// That's slightly wrong
// We control the only view, and that one does the checks
return Qt::ItemIsSelectable|Qt::ItemIsEnabled | Qt::ItemIsEditable;
Qt::ItemFlags f = Qt::ItemIsSelectable|Qt::ItemIsEnabled;
if (Node *node = nodeForIndex(index)) {
if (!qobject_cast<ProjectNode *>(node)) {
// either folder or file node
if (node->projectNode()->supportedActions(node).contains(ProjectNode::Rename))
f = f | Qt::ItemIsEditable;
return f;
bool FlatModel::setData(const QModelIndex &index, const QVariant &value, int role)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment