diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index c00beae44f4..e21c752b55c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -55,7 +55,8 @@ using namespace CMakeProjectManager::Internal; // CMakeEditor::CMakeEditor(CMakeEditorWidget *editor) - : BaseTextEditor(editor) + : BaseTextEditor(editor), + m_infoBarShown(false) { setContext(Core::Context(CMakeProjectManager::Constants::C_CMAKEEDITOR, TextEditor::Constants::C_TEXTEDITOR)); @@ -78,6 +79,11 @@ QString CMakeEditor::id() const void CMakeEditor::markAsChanged() { + if (!file()->isModified()) + return; + if (m_infoBarShown) + return; + m_infoBarShown = true; Core::InfoBarEntry info(QLatin1String("CMakeEditor.RunCMake"), tr("Changes to cmake files are shown in the project tree after building.")); info.setCustomButtonInfo(tr("Build now"), this, SLOT(build())); diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.h b/src/plugins/cmakeprojectmanager/cmakeeditor.h index b0cb039efc9..3b328b3262a 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.h +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.h @@ -65,6 +65,8 @@ public: private slots: void markAsChanged(); void build(); +private: + bool m_infoBarShown; }; class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget