summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-03-06 14:25:33 +0100
committerhjk <hjk@theqtcompany.com>2015-03-06 13:59:42 +0000
commit3f79ae203fa520cca3c11e24069e24a33ce1540c (patch)
treef0dae1124a59d6b17118c1199f4fa3b2f366117f
parent46fcfa90180f0ea705b06bb34ebb68be15011be9 (diff)
downloadqt-creator-3f79ae203fa520cca3c11e24069e24a33ce1540c.tar.gz
Debugger: Start disentangling WatchHandler::insertData
Rename the list overload. Make the single item overload use the direct path to insertItem, hook the column resize requests to the showing/hiding of the watchers pane. Change-Id: I0a1940c8e1919341a815e6bccbcf55d989d663da Reviewed-by: hjk <hjk@theqtcompany.com>
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp2
-rw-r--r--src/plugins/debugger/qml/qmlinspectoragent.cpp2
-rw-r--r--src/plugins/debugger/qml/qmlv8debuggerclient.cpp6
-rw-r--r--src/plugins/debugger/watchhandler.cpp14
-rw-r--r--src/plugins/debugger/watchhandler.h4
5 files changed, 14 insertions, 14 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index b239ca3e4c..4b3d33af83 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -1889,7 +1889,7 @@ void CdbEngine::handleLocals(const CdbCommandPtr &reply, int flags)
watchData[i].name = it.value();
}
}
- handler->insertData(watchData);
+ handler->insertDataList(watchData);
if (debugLocals) {
QDebug nsp = qDebug().nospace();
nsp << "Obtained " << watchData.size() << " items:\n";
diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp
index 0e34026b37..4eaff58033 100644
--- a/src/plugins/debugger/qml/qmlinspectoragent.cpp
+++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp
@@ -678,7 +678,7 @@ void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object)
WatchHandler *watchHandler = m_debuggerEngine->watchHandler();
if (printTime)
timeElapsed.start();
- watchHandler->insertData(watchData);
+ watchHandler->insertDataList(watchData);
qCDebug(qmlInspectorLog) << __FUNCTION__ << "Time: Insertion took "
<< timeElapsed.elapsed() << " ms";
diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
index 26b54be1b1..f2e5fd250e 100644
--- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
+++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
@@ -1582,7 +1582,7 @@ void QmlV8DebuggerClient::updateScope(const QVariant &bodyVal, const QVariant &r
d->lookup(handlesToLookup);
if (!locals.isEmpty())
- d->engine->watchHandler()->insertData(locals);
+ d->engine->watchHandler()->insertDataList(locals);
}
QmlJS::ConsoleItem *constructLogItemTree(QmlJS::ConsoleItem *parent,
@@ -1687,7 +1687,7 @@ void QmlV8DebuggerClient::updateEvaluationResult(int sequence, bool success,
watchDataList << data << createWatchDataList(&data, body.properties, refsVal);
}
//Insert the newly evaluated expression to the Watchers Window
- watchHandler->insertData(watchDataList);
+ watchHandler->insertDataList(watchDataList);
}
}
}
@@ -1734,7 +1734,7 @@ void QmlV8DebuggerClient::expandLocalsAndWatchers(const QVariant &bodyVal, const
}
}
- watchHandler->insertData(watchDataList);
+ watchHandler->insertDataList(watchDataList);
}
QList<WatchData> QmlV8DebuggerClient::createWatchDataList(const WatchData *parent,
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 7ff91ffd9f..f2d273bd61 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -1135,6 +1135,7 @@ void WatchModel::insertDataItem(const WatchData &data, bool destructive)
emit itemIsExpanded(indexFromItem(parent));
}
}
+ m_handler->showEditValue(data);
}
void WatchModel::insertBulkData(const QList<WatchData> &list)
@@ -1142,9 +1143,7 @@ void WatchModel::insertBulkData(const QList<WatchData> &list)
for (int i = 0, n = list.size(); i != n; ++i) {
const WatchData &data = list.at(i);
insertDataItem(data, true);
- m_handler->showEditValue(data);
}
- emit columnAdjustmentRequested();
}
int WatchItem::requestedFormat() const
@@ -1247,15 +1246,14 @@ void WatchModel::reexpandItems()
void WatchHandler::insertData(const WatchData &data)
{
- QList<WatchData> list;
- list.append(data);
- insertData(list);
+ m_model->insertDataItem(data, true);
+ m_contentsValid = true;
+ updateWatchersWindow();
}
-void WatchHandler::insertData(const QList<WatchData> &list)
+void WatchHandler::insertDataList(const QList<WatchData> &list)
{
m_model->insertBulkData(list);
-
m_contentsValid = true;
updateWatchersWindow();
}
@@ -1463,6 +1461,8 @@ void WatchHandler::clearWatches()
void WatchHandler::updateWatchersWindow()
{
+ emit m_model->columnAdjustmentRequested();
+
// Force show/hide of watchers and return view.
static int previousShowWatch = -1;
static int previousShowReturn = -1;
diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h
index 303c56a040..b5e898b564 100644
--- a/src/plugins/debugger/watchhandler.h
+++ b/src/plugins/debugger/watchhandler.h
@@ -236,8 +236,8 @@ public:
void updateWatchersWindow();
void appendFormatRequests(DebuggerCommand *cmd);
- void insertData(const WatchData &data); // Convenience.
- void insertData(const QList<WatchData> &list);
+ void insertData(const WatchData &data); // DEPRECATED
+ void insertDataList(const QList<WatchData> &list); // DEPRECATED
void insertItem(WatchItem *item); // Takes ownership.
void removeData(const QByteArray &iname);
void removeChildren(const QByteArray &iname);