Commit 761d4804 authored by Tobias Hunger's avatar Tobias Hunger

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: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent c1a91419
......@@ -35,7 +35,6 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/infobar.h>
#include <extensionsystem/pluginmanager.h>
......@@ -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<CMakeProject *>(p)) {
if (cmakeProject->isProjectFile(document->filePath())) {
ProjectExplorerPlugin::buildProject(cmakeProject);
break;
}
}
}
});
infoBar->addInfo(info);
});
}
QString CMakeEditor::contextHelpId() const
{
int pos = position();
......
......@@ -39,9 +39,6 @@ class CMakeEditor : public TextEditor::BaseTextEditor
Q_OBJECT
public:
CMakeEditor();
void finalizeInitialization() override;
QString contextHelpId() const override;
friend class CMakeEditorWidget;
......
......@@ -36,8 +36,6 @@
#include "cmakeprojectmanager.h"
#include <coreplugin/icore.h>
#include <coreplugin/infobar.h>
#include <coreplugin/editormanager/editormanager.h>
#include <cpptools/cppmodelmanager.h>
#include <cpptools/projectinfo.h>
#include <cpptools/projectpartbuilder.h>
......@@ -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<CMakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
rootProjectNode()->setDisplayName(m_buildDirManager->projectName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment