for (const KFileItem &item : items) {
if (item.url() == currentDir) {
- Q_EMIT currentDirectoryRemoved();
+ // #473377: Delay emitting currentDirectoryRemoved() to avoid modifying KCoreDirLister
+ // before KCoreDirListerCache::deleteDir() returns.
+ QTimer::singleShot(0, this, [this] {
+ Q_EMIT currentDirectoryRemoved();
+ });
+
return;
}