debugger: save a few cycles when updating a large locals view

This commit is contained in:
hjk
2010-11-25 18:44:07 +01:00
parent da115606fa
commit 950a12f687

View File

@@ -551,21 +551,27 @@ void WatchWindow::setUpdatesEnabled(bool enable)
void WatchWindow::resetHelper() void WatchWindow::resetHelper()
{ {
bool old = updatesEnabled();
setUpdatesEnabled(false);
resetHelper(model()->index(0, 0)); resetHelper(model()->index(0, 0));
setUpdatesEnabled(old);
} }
void WatchWindow::resetHelper(const QModelIndex &idx) void WatchWindow::resetHelper(const QModelIndex &idx)
{ {
if (idx.data(LocalsExpandedRole).toBool()) { if (idx.data(LocalsExpandedRole).toBool()) {
//qDebug() << "EXPANDING " << model()->data(idx, INameRole); //qDebug() << "EXPANDING " << model()->data(idx, INameRole);
expand(idx); if (!isExpanded(idx)) {
for (int i = 0, n = model()->rowCount(idx); i != n; ++i) { expand(idx);
QModelIndex idx1 = model()->index(i, 0, idx); for (int i = 0, n = model()->rowCount(idx); i != n; ++i) {
resetHelper(idx1); QModelIndex idx1 = model()->index(i, 0, idx);
resetHelper(idx1);
}
} }
} else { } else {
//qDebug() << "COLLAPSING " << model()->data(idx, INameRole); //qDebug() << "COLLAPSING " << model()->data(idx, INameRole);
collapse(idx); if (isExpanded(idx))
collapse(idx);
} }
} }