forked from qt-creator/qt-creator
ProjectTree: Do not register action more than once
Change-Id: I9d9c86694cd8066ba4be2a065805a3b52bc272ff Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user