mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:24:36 +02:00
Fix bugs in mapping model update
This commit is contained in:
parent
232bfc9061
commit
3467e06199
1 changed files with 14 additions and 5 deletions
|
@ -173,15 +173,24 @@ void AssetMappingModel::refresh() {
|
||||||
|
|
||||||
Q_ASSERT(fullPath == path);
|
Q_ASSERT(fullPath == path);
|
||||||
}
|
}
|
||||||
for (auto& path : existingPaths) {
|
|
||||||
Q_ASSERT(_pathToItemMap.contains(path));
|
// Remove folders from list
|
||||||
auto item = _pathToItemMap[path];
|
auto it = existingPaths.begin();
|
||||||
|
while (it != existingPaths.end()) {
|
||||||
|
auto item = _pathToItemMap[*it];
|
||||||
if (item->data(Qt::UserRole + 1).toBool()) {
|
if (item->data(Qt::UserRole + 1).toBool()) {
|
||||||
continue;
|
it = existingPaths.erase(it);
|
||||||
|
} else {
|
||||||
|
++it;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto& path : existingPaths) {
|
||||||
|
Q_ASSERT(_pathToItemMap.contains(path));
|
||||||
qDebug() << "removing existing: " << path;
|
qDebug() << "removing existing: " << path;
|
||||||
|
|
||||||
|
auto item = _pathToItemMap[path];
|
||||||
|
|
||||||
while (item) {
|
while (item) {
|
||||||
// During each iteration, delete item
|
// During each iteration, delete item
|
||||||
QStandardItem* nextItem = nullptr;
|
QStandardItem* nextItem = nullptr;
|
||||||
|
|
Loading…
Reference in a new issue