From d6da4e513668e558081008494019c377ac7a90d4 Mon Sep 17 00:00:00 2001
From: Nikolai Kosjar <nikolai.kosjar@qt.io>
Date: Fri, 15 Sep 2017 15:25:27 +0200
Subject: [PATCH] CppEditor: Use class enum for
 CppUseSelectionsUpdater::CallType

Change-Id: Iaf6df1ccec50b84048933506a46b93bedf77da8e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
---
 src/plugins/cppeditor/cppeditorwidget.cpp         | 6 +++---
 src/plugins/cppeditor/cppuseselectionsupdater.cpp | 2 +-
 src/plugins/cppeditor/cppuseselectionsupdater.h   | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp
index f0f02934d95..e11b2c8143d 100644
--- a/src/plugins/cppeditor/cppeditorwidget.cpp
+++ b/src/plugins/cppeditor/cppeditorwidget.cpp
@@ -774,7 +774,7 @@ QMenu *CppEditorWidget::createRefactorMenu(QWidget *parent) const
     // updateSemanticInfo(m_semanticHighlighter->semanticInfo(currentSource()));
 
     if (isSemanticInfoValidExceptLocalUses()) {
-        d->m_useSelectionsUpdater.update(CppUseSelectionsUpdater::Synchronous);
+        d->m_useSelectionsUpdater.update(CppUseSelectionsUpdater::CallType::Synchronous);
         addRefactoringActions(menu, createAssistInterface(QuickFix, ExplicitlyInvoked));
     }
 
@@ -881,8 +881,8 @@ void CppEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo,
 
     if (!d->m_localRenaming.isActive()) {
         const CppUseSelectionsUpdater::CallType type = updateUseSelectionSynchronously
-                                                           ? CppUseSelectionsUpdater::Synchronous
-                                                           : CppUseSelectionsUpdater::Asynchronous;
+            ? CppUseSelectionsUpdater::CallType::Synchronous
+            : CppUseSelectionsUpdater::CallType::Asynchronous;
         d->m_useSelectionsUpdater.update(type);
     }
 
diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.cpp b/src/plugins/cppeditor/cppuseselectionsupdater.cpp
index 44012b1c95f..a254ed7eae7 100644
--- a/src/plugins/cppeditor/cppuseselectionsupdater.cpp
+++ b/src/plugins/cppeditor/cppuseselectionsupdater.cpp
@@ -78,7 +78,7 @@ void CppUseSelectionsUpdater::update(CallType callType)
     params.semanticInfo = cppEditorWidget->semanticInfo();
     params.textCursor = TextEditor::Convenience::wordStartCursor(cppEditorWidget->textCursor());
 
-    if (callType == Asynchronous) {
+    if (callType == CallType::Asynchronous) {
         if (isSameIdentifierAsBefore(params.textCursor))
             return;
 
diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.h b/src/plugins/cppeditor/cppuseselectionsupdater.h
index 478a816f980..7e10eeb680c 100644
--- a/src/plugins/cppeditor/cppuseselectionsupdater.h
+++ b/src/plugins/cppeditor/cppuseselectionsupdater.h
@@ -49,8 +49,8 @@ public:
     void scheduleUpdate();
     void abortSchedule();
 
-    enum CallType { Synchronous, Asynchronous };
-    void update(CallType callType = Asynchronous);
+    enum class CallType { Synchronous, Asynchronous };
+    void update(CallType callType = CallType::Asynchronous);
 
 signals:
     void finished(CppTools::SemanticInfo::LocalUseMap localUses);
-- 
GitLab