mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:44:21 +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);
|
||||
}
|
||||
|
||||
// Remove folders from list
|
||||
auto it = existingPaths.begin();
|
||||
while (it != existingPaths.end()) {
|
||||
auto item = _pathToItemMap[*it];
|
||||
if (item->data(Qt::UserRole + 1).toBool()) {
|
||||
it = existingPaths.erase(it);
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& path : existingPaths) {
|
||||
Q_ASSERT(_pathToItemMap.contains(path));
|
||||
auto item = _pathToItemMap[path];
|
||||
if (item->data(Qt::UserRole + 1).toBool()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
qDebug() << "removing existing: " << path;
|
||||
|
||||
auto item = _pathToItemMap[path];
|
||||
|
||||
while (item) {
|
||||
// During each iteration, delete item
|
||||
QStandardItem* nextItem = nullptr;
|
||||
|
|
Loading…
Reference in a new issue