From 24bcbaefe9ad33259a58dee87a7ce4567323baed Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Thu, 15 Oct 2009 13:59:04 +0200
Subject: [PATCH] Don't use modality to inform the user about the dangerous
 world of code refactoring.

---
 src/plugins/cppeditor/cppeditor.cpp        | 11 +++++++++--
 src/plugins/cppeditor/cppeditor.h          |  1 +
 src/plugins/cpptools/cppfindreferences.cpp |  2 ++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index c3942e5794b..d96a3f50087 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -571,6 +571,8 @@ CPPEditor::CPPEditor(QWidget *parent)
 
 CPPEditor::~CPPEditor()
 {
+    Core::EditorManager::instance()->hideEditorInfoBar(QLatin1String("CppEditor.Rename"));
+
     m_semanticHighlighter->abort();
     m_semanticHighlighter->wait();
 }
@@ -763,13 +765,18 @@ void CPPEditor::renameUsages()
     Core::EditorManager::instance()->showEditorInfoBar(QLatin1String("CppEditor.Rename"),
                                                        tr("This change cannot be undone."),
                                                        tr("Yes, I know what I am doing."),
-                                                       this, SLOT(renameUsagesNow()));
+                                                       this, SLOT(hideRenameNotification()));
+    renameUsagesNow();
+}
+
+void CPPEditor::hideRenameNotification()
+{
+    Core::EditorManager::instance()->hideEditorInfoBar(QLatin1String("CppEditor.Rename"));
 }
 
 void CPPEditor::renameUsagesNow()
 {
     if (Symbol *canonicalSymbol = markSymbols()) {
-        Core::EditorManager::instance()->hideEditorInfoBar(QLatin1String("CppEditor.Rename"));
         m_modelManager->renameUsages(canonicalSymbol);
     }
 }
diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h
index f3489d8b998..c0c323a93d9 100644
--- a/src/plugins/cppeditor/cppeditor.h
+++ b/src/plugins/cppeditor/cppeditor.h
@@ -196,6 +196,7 @@ public Q_SLOTS:
     void renameUsages();
     void findUsages();
     void renameUsagesNow();
+    void hideRenameNotification();
 
 protected:
     bool event(QEvent *e);
diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index 3c11479a025..7e3f04bc381 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -682,6 +682,8 @@ static void applyChanges(QTextDocument *doc, const QString &text, const QList<Fi
 void CppFindReferences::onReplaceButtonClicked(const QString &text,
                                                const QList<Find::SearchResultItem> &items)
 {
+    Core::EditorManager::instance()->hideEditorInfoBar(QLatin1String("CppEditor.Rename"));
+
     if (text.isEmpty())
         return;
 
-- 
GitLab