aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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);