summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/watchhandler.cpp
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2010-06-25 09:53:23 +0200
committerhjk <qtc-committer@nokia.com>2010-06-25 10:21:39 +0200
commit6493b4853d5d023f9db2cb7edbd58ac14c27b701 (patch)
treee902b5e04a093b9a983f7d96a2f083fa78a9c318 /src/plugins/debugger/watchhandler.cpp
parenteb75f40a9883b437f1e1ce722a769a450a905d39 (diff)
downloadqt-creator-6493b4853d5d023f9db2cb7edbd58ac14c27b701.tar.gz
debugger: adjust loading/saving of watched expressions to recent changes
Diffstat (limited to 'src/plugins/debugger/watchhandler.cpp')
-rw-r--r--src/plugins/debugger/watchhandler.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index ddf6f9e023..4f4e174fdd 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -667,6 +667,9 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
int pos = type.indexOf("::Q");
if (pos >= 0 && type.count(':') == 2)
type = type.mid(pos + 2);
+ pos = type.indexOf('<');
+ if (pos >= 0)
+ type = type.left(pos);
return m_handler->m_reportedTypeFormats.value(type);
}
@@ -1083,7 +1086,6 @@ void WatchModel::formatRequests(QByteArray *out, const WatchItem *item) const
WatchHandler::WatchHandler(DebuggerEngine *engine)
{
m_engine = engine;
- m_expandPointers = true;
m_inChange = false;
m_return = new WatchModel(this, ReturnWatch);
@@ -1235,11 +1237,10 @@ void WatchHandler::watchExpression(const QString &exp)
if (exp.isEmpty() || exp == watcherEditPlaceHolder())
data.setAllUnneeded();
data.iname = watcherName(data.exp);
- if (m_engine && m_engine->isSynchroneous())
+ if (m_engine->isSynchroneous() && !m_engine->isSessionEngine())
m_engine->updateWatchData(data);
else
insertData(data);
- m_engine->updateWatchData(data);
updateWatchersWindow();
saveWatchers();
emitAllChanged();
@@ -1351,8 +1352,8 @@ void WatchHandler::removeWatchExpression(const QString &exp0)
break;
}
}
- updateWatchersWindow();
emitAllChanged();
+ updateWatchersWindow();
}
void WatchHandler::updateWatchersWindow()
@@ -1434,14 +1435,17 @@ void WatchHandler::saveTypeFormats()
void WatchHandler::saveSessionData()
{
+ QTC_ASSERT(m_engine->isSessionEngine(), return);
saveWatchers();
saveTypeFormats();
}
void WatchHandler::loadSessionData()
{
+ QTC_ASSERT(m_engine->isSessionEngine(), return);
loadWatchers();
loadTypeFormats();
+
foreach (const QByteArray &exp, m_watcherNames.keys()) {
WatchData data;
data.iname = watcherName(exp);
@@ -1450,8 +1454,24 @@ void WatchHandler::loadSessionData()
data.exp = exp;
insertData(data);
}
+ updateWatchersWindow();
}
+void WatchHandler::initializeFromTemplate(WatchHandler *other)
+{
+ m_watcherNames = other->m_watcherNames;
+ m_typeFormats = other->m_typeFormats;
+ m_individualFormats = other->m_individualFormats;
+}
+
+void WatchHandler::storeToTemplate(WatchHandler *other)
+{
+ other->m_watcherNames = m_watcherNames;
+ other->m_typeFormats = m_typeFormats;
+ other->m_individualFormats = m_individualFormats;
+}
+
+
WatchModel *WatchHandler::model(WatchType type) const
{
switch (type) {