Fix file browser getting stuck in endless loop on empty directories

This commit is contained in:
Martchus 2024-06-22 22:36:51 +02:00
parent 8caf7124fd
commit 96741945f3
1 changed files with 1 additions and 1 deletions

View File

@ -878,7 +878,6 @@ void SyncthingFileModel::processFetchQueue(const QString &lastItemPath)
beginInsertRows(
refreshedIndex, 0, last < std::numeric_limits<int>::max() ? static_cast<int>(last) : std::numeric_limits<int>::max());
refreshedItem->children = std::move(items);
refreshedItem->childrenPopulated = true;
switch (refreshedItem->checked) {
case Qt::Checked:
setChildrenChecked(refreshedItem, Qt::Checked);
@ -890,6 +889,7 @@ void SyncthingFileModel::processFetchQueue(const QString &lastItemPath)
}
endInsertRows();
}
refreshedItem->childrenPopulated = true;
if (refreshedItem->children.size() != previousChildCount) {
const auto sizeIndex = refreshedIndex.siblingAtColumn(1);
emit dataChanged(sizeIndex, sizeIndex, QVector<int>{ Qt::DisplayRole });