Fix various context menu actions from project managers

The correct pattern is this: The actions in the build menu are supposed
to be for the startup project. They should use the global context and be
manually hidden/shown if the startup project changes.

This fixes a crash on assigning keyboard shortcut to the edit files
context menu action.

The slot connected assumed that the action could only be triggered via
the context menu. By using ProjectTree;:currentProject() the code now
works even if the project tree is not actually focused.

It also fixes that the "Run CMake" action was shown even in the build menu,
even though a non cmake project was the startup project.

Change-Id: I0bb8086d8b1078b4c71c3b5ba9d7f8596757e724
Task-number: QTCREATORBUG-14728
Task-number: QTCREATORBUG-14768
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Daniel Teske
2015-07-14 13:10:18 +02:00
parent 513c4e0a89
commit cea36f1376
4 changed files with 18 additions and 24 deletions

View File

@@ -69,14 +69,13 @@ public:
static QString findCbpFile(const QDir &);
private:
void updateContextMenu(ProjectExplorer::Project *project, ProjectExplorer::Node *node);
void updateRunCmakeAction();
void runCMake(ProjectExplorer::Project *project);
private:
CMakeSettingsPage *m_settingsPage;
QAction *m_runCMakeAction;
QAction *m_runCMakeActionContextMenu;
ProjectExplorer::Project *m_contextProject;
};
} // namespace Internal