aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2009-08-26 17:29:22 +0200
committercon <qtc-committer@nokia.com>2009-08-26 17:33:22 +0200
commitdfebb2d28d16e279cece4f54e00d23d1d4e30ffc (patch)
treeeed5d03e7512c3fd1d9938ce2a593e7078e8ebdc
parent91c9e66731578e7c84a39c4c050feccd24d47db1 (diff)
debugger: fix collapse/uncollapse bug in locals view
(cherry picked from commit 64daf410dca75f35fdb94501212b7688354b3ef4)
-rw-r--r--src/plugins/debugger/watchhandler.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index cbb9f036b7..1587af28e7 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -203,6 +203,7 @@ QString WatchData::toString() const
const char *doubleQuoteComma = "\",";
QString res;
QTextStream str(&res);
+ str << QLatin1Char('{');
if (!iname.isEmpty())
str << "iname=\"" << iname << doubleQuoteComma;
if (!addr.isEmpty())
@@ -855,6 +856,22 @@ void WatchModel::insertBulkData(const QList<WatchData> &list)
typedef QMap<IName, WatchData>::iterator Iterator;
foreach (const WatchItem &data, list)
newList[data.iname] = data;
+ if (newList.size() != list.size()) {
+ qDebug() << "LIST: ";
+ foreach (const WatchItem &data, list)
+ qDebug() << data.toString();
+ qDebug() << "NEW LIST: ";
+ foreach (const WatchItem &data, newList.values())
+ qDebug() << data.toString();
+ qDebug() << "P->CHILDREN: ";
+ foreach (const WatchItem *item, parent->children)
+ qDebug() << item->toString();
+ qDebug()
+ << "P->CHILDREN.SIZE: " << parent->children.size()
+ << "NEWLIST SIZE: " << newList.size()
+ << "LIST SIZE: " << list.size();
+ }
+ QTC_ASSERT(newList.size() == list.size(), return);
foreach (WatchItem *oldItem, parent->children) {
Iterator it = newList.find(oldItem->iname);
@@ -871,15 +888,7 @@ void WatchModel::insertBulkData(const QList<WatchData> &list)
// overwrite existing items
Iterator it = newList.begin();
- int oldCount = newList.size() - list.size();
- if (oldCount != parent->children.size())
- qDebug() //<< "LIST:" << list.keys()
- << "NEWLIST: " << newList.keys()
- << "OLD COUNT: " << oldCount
- << "P->CHILDREN.SIZE: " << parent->children.size()
- << "NEWLIST SIZE: " << newList.size()
- << "LIST SIZE: " << list.size();
- QTC_ASSERT(oldCount == parent->children.size(), return);
+ const int oldCount = parent->children.size();
for (int i = 0; i < oldCount; ++i, ++it)
parent->children[i]->setData(*it);
QModelIndex idx = watchIndex(parent);