From 761d480453c42f6671bb7ff0ea5c5fa60663ecec Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 12 Feb 2016 15:32:27 +0100 Subject: [PATCH] CMake: Do not ask to rebuild after editing CMakeLists.txt files This happens automatically now, do not bother the user with that anymore. Change-Id: Icc411e74ea5de42037f3718c6b75cc15772a64b9 Reviewed-by: Tim Jenssen --- .../cmakeprojectmanager/cmakeeditor.cpp | 32 ------------------- src/plugins/cmakeprojectmanager/cmakeeditor.h | 3 -- .../cmakeprojectmanager/cmakeproject.cpp | 6 ---- 3 files changed, 41 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index df2fefe7ca0..bbfda35c4d7 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include @@ -62,37 +61,6 @@ namespace Internal { // CMakeEditor // -CMakeEditor::CMakeEditor() -{ -} - -void CMakeEditor::finalizeInitialization() -{ - connect(document(), &IDocument::changed, [this]() { - BaseTextDocument *document = textDocument(); - if (!document->isModified()) - return; - InfoBar *infoBar = document->infoBar(); - Id infoRunCMake("CMakeEditor.RunCMake"); - if (!infoBar->canInfoBeAdded(infoRunCMake)) - return; - InfoBarEntry info(infoRunCMake, - tr("Changes to cmake files are shown in the project tree after building."), - InfoBarEntry::GlobalSuppressionEnabled); - info.setCustomButtonInfo(tr("Build now"), [document]() { - foreach (Project *p, SessionManager::projects()) { - if (CMakeProject *cmakeProject = qobject_cast(p)) { - if (cmakeProject->isProjectFile(document->filePath())) { - ProjectExplorerPlugin::buildProject(cmakeProject); - break; - } - } - } - }); - infoBar->addInfo(info); - }); -} - QString CMakeEditor::contextHelpId() const { int pos = position(); diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.h b/src/plugins/cmakeprojectmanager/cmakeeditor.h index 0ade9ec3eef..7d5bda378cf 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.h +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.h @@ -39,9 +39,6 @@ class CMakeEditor : public TextEditor::BaseTextEditor Q_OBJECT public: - CMakeEditor(); - - void finalizeInitialization() override; QString contextHelpId() const override; friend class CMakeEditorWidget; diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index d5fa23491ab..bcf7db72c76 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -36,8 +36,6 @@ #include "cmakeprojectmanager.h" #include -#include -#include #include #include #include @@ -251,10 +249,6 @@ void CMakeProject::parseCMakeOutput() QTC_ASSERT(m_buildDirManager, return); QTC_ASSERT(activeTarget() && activeTarget()->activeBuildConfiguration(), return); - foreach (Core::IDocument *document, Core::DocumentModel::openedDocuments()) - if (isProjectFile(document->filePath())) - document->infoBar()->removeInfo("CMakeEditor.RunCMake"); - auto activeBC = static_cast(activeTarget()->activeBuildConfiguration()); rootProjectNode()->setDisplayName(m_buildDirManager->projectName());