summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/documentmanager.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-03-15 15:46:48 +0100
committerhjk <hjk@qt.io>2017-04-05 12:47:03 +0000
commitbd5e2faa756f1c852a0d7ae019561413e5278cc3 (patch)
treee1d0680c4e5e5fa9aeb6db14ecbc48c6d67ceae8 /src/plugins/qmldesigner/documentmanager.cpp
parent8410c0bbad626c8ca38a161968c71a09ffb47df7 (diff)
downloadqt-creator-bd5e2faa756f1c852a0d7ae019561413e5278cc3.tar.gz
ProjectNodes: Handle supported actions one-by-one
Getting the full list for a node can get quite expensive e.g. in cases of recursive calls of QMakeProjectManager::findPriFile. However, the FlatModel needs to decide quickly on whether an item is editable to potentially allow renaming. So split up QList<Actions> supportedActions() into individual bool supportsAction(action) calls and make sure Rename is not on the critical path. Task-number: QTCREATORBUG-17953 Change-Id: I31841847f8aa7d7b94c63d76ce71efb1c930fa69 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/documentmanager.cpp')
-rw-r--r--src/plugins/qmldesigner/documentmanager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/documentmanager.cpp b/src/plugins/qmldesigner/documentmanager.cpp
index 357420c1d8..abf45bfbb1 100644
--- a/src/plugins/qmldesigner/documentmanager.cpp
+++ b/src/plugins/qmldesigner/documentmanager.cpp
@@ -438,7 +438,7 @@ bool DocumentManager::isoProFileSupportsAddingExistingFiles(const QString &resou
ProjectExplorer::ProjectNode *projectNode = node->parentFolderNode()->asProjectNode();
if (!projectNode)
return false;
- if (!projectNode->supportedActions(projectNode).contains(ProjectExplorer::AddExistingFile)) {
+ if (!projectNode->supportsAction(ProjectExplorer::AddExistingFile, projectNode)) {
qCWarning(documentManagerLog) << "Project" << projectNode->displayName() << "does not support adding existing files";
return false;
}