From 589d9c777355de26b426263190e9bd782ac69590 Mon Sep 17 00:00:00 2001
From: Nikolai Kosjar <nikolai.kosjar@digia.com>
Date: Fri, 4 Oct 2013 15:54:39 +0200
Subject: [PATCH] CppTools: Rename "Update Code Model" to "Reparse Externally
 Changed Files"

It was not clear what "Update Code Model" did.

Change-Id: I245307039f8770047b80c7234481099edfe60bc9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
---
 doc/src/editors/creator-coding-edit-mode.qdoc | 12 +++++-------
 src/plugins/cppeditor/cppeditorplugin.cpp     | 12 ++++++------
 src/plugins/cppeditor/cppeditorplugin.h       |  2 +-
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/doc/src/editors/creator-coding-edit-mode.qdoc b/doc/src/editors/creator-coding-edit-mode.qdoc
index 4da42fe1619..dac877fc123 100644
--- a/doc/src/editors/creator-coding-edit-mode.qdoc
+++ b/doc/src/editors/creator-coding-edit-mode.qdoc
@@ -170,12 +170,10 @@
     If you change the default behavior, the shortcuts for opening link targets
     in the next split are used to open them in the current split.
 
-    \section1 Using Update Code Model
-
-    To refresh the internal information in \QC pertaining to your code,
-    select \gui{Tools} > \gui{C++} > \gui{Update Code Model}.
-
-    \note In \QC indexing updates the code automatically. Use
-    \gui{Update Code Model} only as an emergency command.
+    \section1 Reparsing Externally Changed Files
 
+    If source files are modified from outside \QC, the opened files will be
+    reparsed automatically. For all other files, you can use \gui{Tools} >
+    \gui{C++} > \gui{Reparse Externally Changed Files} to update the code
+    model.
 */
diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp
index 62640202505..4735be7018b 100644
--- a/src/plugins/cppeditor/cppeditorplugin.cpp
+++ b/src/plugins/cppeditor/cppeditorplugin.cpp
@@ -102,7 +102,7 @@ CppEditorPlugin::CppEditorPlugin() :
     m_sortedOutline(false),
     m_renameSymbolUnderCursorAction(0),
     m_findUsagesAction(0),
-    m_updateCodeModelAction(0),
+    m_reparseExternallyChangedFiles(0),
     m_openTypeHierarchyAction(0),
     m_openIncludeHierarchyAction(0),
     m_quickFixProvider(0)
@@ -272,10 +272,10 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
 
     // Update context in global context
     cppToolsMenu->addSeparator(globalContext);
-    m_updateCodeModelAction = new QAction(tr("Update Code Model"), this);
-    cmd = ActionManager::registerAction(m_updateCodeModelAction, Constants::UPDATE_CODEMODEL, globalContext);
+    m_reparseExternallyChangedFiles = new QAction(tr("Reparse Externally Changed Files"), this);
+    cmd = ActionManager::registerAction(m_reparseExternallyChangedFiles, Constants::UPDATE_CODEMODEL, globalContext);
     CppTools::CppModelManagerInterface *cppModelManager = CppTools::CppModelManagerInterface::instance();
-    connect(m_updateCodeModelAction, SIGNAL(triggered()), cppModelManager, SLOT(updateModifiedSourceFiles()));
+    connect(m_reparseExternallyChangedFiles, SIGNAL(triggered()), cppModelManager, SLOT(updateModifiedSourceFiles()));
     cppToolsMenu->addAction(cmd);
 
     m_actionHandler = new TextEditor::TextEditorActionHandler(CppEditor::Constants::C_CPPEDITOR,
@@ -359,7 +359,7 @@ void CppEditorPlugin::onTaskStarted(Core::Id type)
     if (type == CppTools::Constants::TASK_INDEX) {
         m_renameSymbolUnderCursorAction->setEnabled(false);
         m_findUsagesAction->setEnabled(false);
-        m_updateCodeModelAction->setEnabled(false);
+        m_reparseExternallyChangedFiles->setEnabled(false);
         m_openTypeHierarchyAction->setEnabled(false);
         m_openIncludeHierarchyAction->setEnabled(false);
     }
@@ -370,7 +370,7 @@ void CppEditorPlugin::onAllTasksFinished(Core::Id type)
     if (type == CppTools::Constants::TASK_INDEX) {
         m_renameSymbolUnderCursorAction->setEnabled(true);
         m_findUsagesAction->setEnabled(true);
-        m_updateCodeModelAction->setEnabled(true);
+        m_reparseExternallyChangedFiles->setEnabled(true);
         m_openTypeHierarchyAction->setEnabled(true);
         m_openIncludeHierarchyAction->setEnabled(true);
     }
diff --git a/src/plugins/cppeditor/cppeditorplugin.h b/src/plugins/cppeditor/cppeditorplugin.h
index 427d7302876..99b0bdc811d 100644
--- a/src/plugins/cppeditor/cppeditorplugin.h
+++ b/src/plugins/cppeditor/cppeditorplugin.h
@@ -312,7 +312,7 @@ private:
     bool m_sortedOutline;
     QAction *m_renameSymbolUnderCursorAction;
     QAction *m_findUsagesAction;
-    QAction *m_updateCodeModelAction;
+    QAction *m_reparseExternallyChangedFiles;
     QAction *m_openTypeHierarchyAction;
     QAction *m_openIncludeHierarchyAction;
 
-- 
GitLab