forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -1889,7 +1889,7 @@ void CdbEngine::handleLocals(const CdbCommandPtr &reply, int flags)
|
|||||||
watchData[i].name = it.value();
|
watchData[i].name = it.value();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
handler->insertData(watchData);
|
handler->insertDataList(watchData);
|
||||||
if (debugLocals) {
|
if (debugLocals) {
|
||||||
QDebug nsp = qDebug().nospace();
|
QDebug nsp = qDebug().nospace();
|
||||||
nsp << "Obtained " << watchData.size() << " items:\n";
|
nsp << "Obtained " << watchData.size() << " items:\n";
|
||||||
|
@@ -678,7 +678,7 @@ void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object)
|
|||||||
WatchHandler *watchHandler = m_debuggerEngine->watchHandler();
|
WatchHandler *watchHandler = m_debuggerEngine->watchHandler();
|
||||||
if (printTime)
|
if (printTime)
|
||||||
timeElapsed.start();
|
timeElapsed.start();
|
||||||
watchHandler->insertData(watchData);
|
watchHandler->insertDataList(watchData);
|
||||||
qCDebug(qmlInspectorLog) << __FUNCTION__ << "Time: Insertion took "
|
qCDebug(qmlInspectorLog) << __FUNCTION__ << "Time: Insertion took "
|
||||||
<< timeElapsed.elapsed() << " ms";
|
<< timeElapsed.elapsed() << " ms";
|
||||||
|
|
||||||
|
@@ -1582,7 +1582,7 @@ void QmlV8DebuggerClient::updateScope(const QVariant &bodyVal, const QVariant &r
|
|||||||
d->lookup(handlesToLookup);
|
d->lookup(handlesToLookup);
|
||||||
|
|
||||||
if (!locals.isEmpty())
|
if (!locals.isEmpty())
|
||||||
d->engine->watchHandler()->insertData(locals);
|
d->engine->watchHandler()->insertDataList(locals);
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlJS::ConsoleItem *constructLogItemTree(QmlJS::ConsoleItem *parent,
|
QmlJS::ConsoleItem *constructLogItemTree(QmlJS::ConsoleItem *parent,
|
||||||
@@ -1687,7 +1687,7 @@ void QmlV8DebuggerClient::updateEvaluationResult(int sequence, bool success,
|
|||||||
watchDataList << data << createWatchDataList(&data, body.properties, refsVal);
|
watchDataList << data << createWatchDataList(&data, body.properties, refsVal);
|
||||||
}
|
}
|
||||||
//Insert the newly evaluated expression to the Watchers Window
|
//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,
|
QList<WatchData> QmlV8DebuggerClient::createWatchDataList(const WatchData *parent,
|
||||||
|
@@ -1135,6 +1135,7 @@ void WatchModel::insertDataItem(const WatchData &data, bool destructive)
|
|||||||
emit itemIsExpanded(indexFromItem(parent));
|
emit itemIsExpanded(indexFromItem(parent));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_handler->showEditValue(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchModel::insertBulkData(const QList<WatchData> &list)
|
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) {
|
for (int i = 0, n = list.size(); i != n; ++i) {
|
||||||
const WatchData &data = list.at(i);
|
const WatchData &data = list.at(i);
|
||||||
insertDataItem(data, true);
|
insertDataItem(data, true);
|
||||||
m_handler->showEditValue(data);
|
|
||||||
}
|
}
|
||||||
emit columnAdjustmentRequested();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int WatchItem::requestedFormat() const
|
int WatchItem::requestedFormat() const
|
||||||
@@ -1247,15 +1246,14 @@ void WatchModel::reexpandItems()
|
|||||||
|
|
||||||
void WatchHandler::insertData(const WatchData &data)
|
void WatchHandler::insertData(const WatchData &data)
|
||||||
{
|
{
|
||||||
QList<WatchData> list;
|
m_model->insertDataItem(data, true);
|
||||||
list.append(data);
|
m_contentsValid = true;
|
||||||
insertData(list);
|
updateWatchersWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::insertData(const QList<WatchData> &list)
|
void WatchHandler::insertDataList(const QList<WatchData> &list)
|
||||||
{
|
{
|
||||||
m_model->insertBulkData(list);
|
m_model->insertBulkData(list);
|
||||||
|
|
||||||
m_contentsValid = true;
|
m_contentsValid = true;
|
||||||
updateWatchersWindow();
|
updateWatchersWindow();
|
||||||
}
|
}
|
||||||
@@ -1463,6 +1461,8 @@ void WatchHandler::clearWatches()
|
|||||||
|
|
||||||
void WatchHandler::updateWatchersWindow()
|
void WatchHandler::updateWatchersWindow()
|
||||||
{
|
{
|
||||||
|
emit m_model->columnAdjustmentRequested();
|
||||||
|
|
||||||
// Force show/hide of watchers and return view.
|
// Force show/hide of watchers and return view.
|
||||||
static int previousShowWatch = -1;
|
static int previousShowWatch = -1;
|
||||||
static int previousShowReturn = -1;
|
static int previousShowReturn = -1;
|
||||||
|
@@ -236,8 +236,8 @@ public:
|
|||||||
void updateWatchersWindow();
|
void updateWatchersWindow();
|
||||||
void appendFormatRequests(DebuggerCommand *cmd);
|
void appendFormatRequests(DebuggerCommand *cmd);
|
||||||
|
|
||||||
void insertData(const WatchData &data); // Convenience.
|
void insertData(const WatchData &data); // DEPRECATED
|
||||||
void insertData(const QList<WatchData> &list);
|
void insertDataList(const QList<WatchData> &list); // DEPRECATED
|
||||||
void insertItem(WatchItem *item); // Takes ownership.
|
void insertItem(WatchItem *item); // Takes ownership.
|
||||||
void removeData(const QByteArray &iname);
|
void removeData(const QByteArray &iname);
|
||||||
void removeChildren(const QByteArray &iname);
|
void removeChildren(const QByteArray &iname);
|
||||||
|
Reference in New Issue
Block a user