CMakePM: Fix always showing "Build > Clear CMake Configuration"

By always I mean for all build systems. I've noticed this with QMake and
it makes no sense.

Change-Id: Ib59b10722fa07a7009f3a2033b113f7038c19dd0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Cristian Adam
2024-08-28 17:33:59 +02:00
parent 1874680029
commit e5dcb96548

View File

@@ -75,6 +75,7 @@ private:
QAction *m_runCMakeAction;
QAction *m_clearCMakeCacheAction;
QAction *m_runCMakeActionContextMenu;
QAction *m_clearCMakeCacheActionContextMenu;
QAction *m_rescanProjectAction;
QAction *m_buildFileContextMenu;
QAction *m_reloadCMakePresetsAction;
@@ -141,7 +142,7 @@ CMakeManager::CMakeManager()
ActionBuilder(this, Constants::CLEAR_CMAKE_CACHE_CONTEXT_MENU)
.setText(Tr::tr("Clear CMake Configuration"))
.setContext(projectContext)
.bindContextAction(&m_clearCMakeCacheAction)
.bindContextAction(&m_clearCMakeCacheActionContextMenu)
.setCommandAttribute(Command::CA_Hide)
.addToContainer(PEC::M_PROJECTCONTEXT, PEC::G_PROJECT_REBUILD)
.addOnTriggered(this, [this] { clearCMakeCache(ProjectManager::startupBuildSystem()); });
@@ -237,6 +238,7 @@ void CMakeManager::updateCmakeActions(Node *node)
const bool visible = project && !BuildManager::isBuilding(project);
m_runCMakeAction->setVisible(visible);
m_runCMakeActionContextMenu->setEnabled(visible);
m_clearCMakeCacheActionContextMenu->setVisible(visible);
m_clearCMakeCacheAction->setVisible(visible);
m_rescanProjectAction->setVisible(visible);
m_cmakeProfilerAction->setEnabled(visible);