aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2018-02-07 13:53:54 +0100
committerTobias Hunger <tobias.hunger@qt.io>2018-02-07 13:42:50 +0000
commit31f1713c759e5bf76299171c86273b5960dec7ff (patch)
tree154cc358aac4df18b6a3369a8d1bcefa0eb0ec32 /src
parent87543118d5516dba3d1fc111206db5df8dcc5b37 (diff)
ProjectTree: Do not register action more than once
Change-Id: I9d9c86694cd8066ba4be2a065805a3b52bc272ff Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/projectexplorer/projecttreewidget.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp
index eef8f772b7..545e9e63b1 100644
--- a/src/plugins/projectexplorer/projecttreewidget.cpp
+++ b/src/plugins/projectexplorer/projecttreewidget.cpp
@@ -256,12 +256,14 @@ ProjectTreeWidget::ProjectTreeWidget(QWidget *parent) : QWidget(parent)
connect(m_filterGeneratedFilesAction, &QAction::toggled,
this, &ProjectTreeWidget::setGeneratedFilesFilter);
- auto focusDocumentInProjectTree = new QAction(tr("Focus Document in Project Tree"), this);
- Command *cmd = ActionManager::registerAction(focusDocumentInProjectTree,
- "ProjectExplorer.FocusDocumentInProjectTree");
- cmd->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+L")));
- connect(focusDocumentInProjectTree, &QAction::triggered,
- this, [this]() { syncFromDocumentManager(); });
+ const char focusActionId[] = "ProjectExplorer.FocusDocumentInProjectTree";
+ if (!ActionManager::command(focusActionId)) {
+ auto focusDocumentInProjectTree = new QAction(tr("Focus Document in Project Tree"), this);
+ Command *cmd = ActionManager::registerAction(focusDocumentInProjectTree, focusActionId);
+ cmd->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+L")));
+ connect(focusDocumentInProjectTree, &QAction::triggered,
+ this, [this]() { syncFromDocumentManager(); });
+ }
m_trimEmptyDirectoriesAction = new QAction(tr("Hide Empty Directories"), this);
m_trimEmptyDirectoriesAction->setCheckable(true);