Formatting

This commit is contained in:
Jonas Kvinge
2021-08-23 21:21:08 +02:00
parent ed7794f396
commit ea2bfbda44
111 changed files with 833 additions and 425 deletions

View File

@@ -65,22 +65,26 @@ void AutoExpandingTreeView::RecursivelyExpandSlot(const QModelIndex &idx) {
bool AutoExpandingTreeView::RecursivelyExpand(const QModelIndex &idx, int *count) {
if (!CanRecursivelyExpand(idx))
if (!CanRecursivelyExpand(idx)) {
return true;
}
if (model()->canFetchMore(idx))
if (model()->canFetchMore(idx)) {
model()->fetchMore(idx);
}
int children = model()->rowCount(idx);
if (*count + children > kRowsToShow)
if (*count + children > kRowsToShow) {
return false;
}
expand(idx);
*count += children;
for (int i = 0 ; i < children ; ++i) {
if (!RecursivelyExpand(model()->index(i, 0, idx), count))
for (int i = 0; i < children; ++i) {
if (!RecursivelyExpand(model()->index(i, 0, idx), count)) {
return false;
}
}
return true;