From 97afa6f7b0683420dfc2b58ed814aaeb32af97fc Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Thu, 23 Jul 2009 11:18:21 +0200
Subject: [PATCH] debugger: move code around

---
 src/plugins/debugger/gdb/gdbengine.cpp | 12 +++++++++---
 src/plugins/debugger/watchhandler.cpp  | 11 -----------
 src/plugins/debugger/watchhandler.h    |  2 --
 3 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 08d502f986b..e5d279fade2 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -3032,13 +3032,19 @@ void GdbEngine::updateSubItem(const WatchData &data0)
         qDebug() << "IT'S A POINTER";
         #endif
 #if 1
-        insertData(data.pointerChildPlaceHolder());
         data.setChildrenUnneeded();
         insertData(data);
+        WatchData data1;
+        data1.iname = data.iname + QLatin1String(".*");
+        data1.name = QLatin1Char('*') + data.name;
+        data1.exp = QLatin1String("(*(") + data.exp + QLatin1String("))");
+        data1.type = stripPointerType(data.type);
+        data1.setValueNeeded();
+        insertData(data1);
 #else
         // Try automatic dereferentiation
-        data.exp = "*(" + data.exp + ")";
-        data.type = data.type + "."; // FIXME: fragile HACK to avoid recursion
+        data.exp = _("*(") + data.exp + _(")");
+        data.type = data.type + _("."); // FIXME: fragile HACK to avoid recursion
         insertData(data);
 #endif
         return;
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 455350d69bf..b4e7ad020d9 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -198,17 +198,6 @@ void WatchData::setAddress(const QString &str)
     addr = str;
 }
 
-WatchData WatchData::pointerChildPlaceHolder() const
-{
-    WatchData data1;
-    data1.iname = iname + QLatin1String(".*");
-    data1.name = QLatin1Char('*') + name;
-    data1.exp = QLatin1String("(*(") + exp + QLatin1String("))");
-    data1.type = stripPointerType(type);
-    data1.setValueNeeded();
-    return data1;
-}
-
 QString WatchData::toString() const
 {
     const char *doubleQuoteComma = "\",";
diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h
index 10ec730bfe7..661e9a0c728 100644
--- a/src/plugins/debugger/watchhandler.h
+++ b/src/plugins/debugger/watchhandler.h
@@ -102,8 +102,6 @@ public:
     void setHasChildren(bool c) { hasChildren = c; setHasChildrenUnneeded();
         if (!c) setChildrenUnneeded(); }
 
-    WatchData pointerChildPlaceHolder() const;
-
     QString toString() const;
     QString toToolTip() const;
     bool isLocal() const { return iname.startsWith(QLatin1String("local.")); }
-- 
GitLab