From b94821b6a9dc81ae4dc24356c33a14f23b669e31 Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Wed, 21 Jul 2010 12:47:14 +0200
Subject: [PATCH] Get rid of the deprecated method
 Overview::setShowFullQualifiedNames().

---
 src/libs/cplusplus/Overview.cpp           | 11 -------
 src/libs/cplusplus/Overview.h             |  4 ---
 src/libs/cplusplus/TypePrettyPrinter.cpp  | 39 ++---------------------
 src/plugins/cppeditor/cpphoverhandler.cpp |  2 --
 4 files changed, 2 insertions(+), 54 deletions(-)

diff --git a/src/libs/cplusplus/Overview.cpp b/src/libs/cplusplus/Overview.cpp
index 78d5373b747..aabad07a19d 100644
--- a/src/libs/cplusplus/Overview.cpp
+++ b/src/libs/cplusplus/Overview.cpp
@@ -44,7 +44,6 @@ Overview::Overview()
       _showArgumentNames(false),
       _showReturnTypes(false),
       _showFunctionSignatures(true),
-      _showFullyQualifiedNames(false),
       _showDefaultArguments(true)
 { }
 
@@ -111,16 +110,6 @@ void Overview::setShowFunctionSignatures(bool showFunctionSignatures)
     _showFunctionSignatures = showFunctionSignatures;
 }
 
-bool Overview::showFullyQualifiedNames() const
-{
-    return _showFullyQualifiedNames;
-}
-
-void Overview::setShowFullyQualifiedNamed(bool showFullyQualifiedNames)
-{
-    _showFullyQualifiedNames = showFullyQualifiedNames;
-}
-
 bool Overview::showDefaultArguments() const
 {
     return _showDefaultArguments;
diff --git a/src/libs/cplusplus/Overview.h b/src/libs/cplusplus/Overview.h
index 3982aca7dab..a2c27216495 100644
--- a/src/libs/cplusplus/Overview.h
+++ b/src/libs/cplusplus/Overview.h
@@ -53,9 +53,6 @@ public:
     bool showFunctionSignatures() const;
     void setShowFunctionSignatures(bool showFunctionSignatures);
 
-    bool showFullyQualifiedNames() const;
-    void setShowFullyQualifiedNamed(bool showFullyQualifiedNames);
-
     bool showDefaultArguments() const;
     void setShowDefaultArguments(bool showDefaultArguments);
 
@@ -94,7 +91,6 @@ private:
     bool _showArgumentNames: 1;
     bool _showReturnTypes: 1;
     bool _showFunctionSignatures: 1;
-    bool _showFullyQualifiedNames: 1;
     bool _showDefaultArguments: 1;
 };
 
diff --git a/src/libs/cplusplus/TypePrettyPrinter.cpp b/src/libs/cplusplus/TypePrettyPrinter.cpp
index e1277f27261..61e18f5e7e9 100644
--- a/src/libs/cplusplus/TypePrettyPrinter.cpp
+++ b/src/libs/cplusplus/TypePrettyPrinter.cpp
@@ -41,35 +41,6 @@
 using namespace CPlusPlus;
 
 
-static QString fullyQualifiedName(Symbol *symbol, const Overview *overview)
-{
-    QStringList nestedNameSpecifier;
-
-    for (Scope *scope = symbol->scope(); scope && scope->enclosingScope();
-         scope = scope->enclosingScope())
-    {
-        Symbol *owner = scope->owner();
-
-        if (! owner) {
-            qWarning() << "invalid scope."; // ### better message.
-            continue;
-        }
-
-        if (! owner->name())
-            nestedNameSpecifier.prepend(QLatin1String("$anonymous"));
-
-        else {
-            const QString name = overview->prettyName(owner->name());
-
-            nestedNameSpecifier.prepend(name);
-        }
-    }
-
-    nestedNameSpecifier.append(overview->prettyName(symbol->name()));
-
-    return nestedNameSpecifier.join(QLatin1String("::"));
-}
-
 TypePrettyPrinter::TypePrettyPrinter(const Overview *overview)
     : _overview(overview)
     , _needsParens(false)
@@ -171,20 +142,14 @@ void TypePrettyPrinter::visit(Namespace *type)
 
 void TypePrettyPrinter::visit(Class *classTy)
 {
-    if (overview()->showFullyQualifiedNames())
-        _text.prepend(fullyQualifiedName(classTy, overview()));
-    else
-        _text.prepend(overview()->prettyName(classTy->name()));
+    _text.prepend(overview()->prettyName(classTy->name()));
     prependCv(_fullySpecifiedType);
 }
 
 
 void TypePrettyPrinter::visit(Enum *type)
 {
-    if (overview()->showFullyQualifiedNames())
-        _text.prepend(fullyQualifiedName(type, overview()));
-    else
-        _text.prepend(overview()->prettyName(type->name()));
+    _text.prepend(overview()->prettyName(type->name()));
     prependCv(_fullySpecifiedType);
 }
 
diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp
index 2b4f7a3cdc1..ecb2cecc957 100644
--- a/src/plugins/cppeditor/cpphoverhandler.cpp
+++ b/src/plugins/cppeditor/cpphoverhandler.cpp
@@ -304,7 +304,6 @@ void CppHoverHandler::handleLookupItemMatch(const LookupItem &lookupItem,
     Overview overview;
     overview.setShowArgumentNames(true);
     overview.setShowReturnTypes(true);
-    overview.setShowFullyQualifiedNamed(true);
 
     if (!matchingDeclaration && assignTooltip) {
         m_toolTip = overview.prettyType(matchingType, QString());
@@ -356,7 +355,6 @@ void CppHoverHandler::handleLookupItemMatch(const LookupItem &lookupItem,
         overview.setShowArgumentNames(false);
         overview.setShowReturnTypes(false);
         overview.setShowFunctionSignatures(false);
-        overview.setShowFullyQualifiedNamed(false);
         const QString &simpleName = overview.prettyName(matchingDeclaration->name());
         overview.setShowFunctionSignatures(true);
         const QString &specifierId = overview.prettyType(matchingType, simpleName);
-- 
GitLab