┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dolphinviewcontainer.cpp11
-rw-r--r--src/views/dolphinview.cpp3
2 files changed, 8 insertions, 6 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index e55519d04..c89621dbd 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -975,10 +975,13 @@ void DolphinViewContainer::slotCurrentDirectoryRemoved()
const QString dirPath = url().toLocalFile();
const QString newPath = getNearestExistingAncestorOfPath(dirPath);
const QUrl newUrl = QUrl::fromLocalFile(newPath);
- setUrl(newUrl);
- }
-
- showMessage(xi18n("Current location changed, <filename>%1</filename> is no longer accessible.", location), KMessageWidget::Warning);
+ // #473377: Delay changing the url to avoid modifying KCoreDirLister before KCoreDirListerCache::deleteDir() returns.
+ QTimer::singleShot(0, this, [&, newUrl, location] {
+ setUrl(newUrl);
+ showMessage(xi18n("Current location changed, <filename>%1</filename> is no longer accessible.", location), KMessageWidget::Warning);
+ });
+ } else
+ showMessage(xi18n("Current location changed, <filename>%1</filename> is no longer accessible.", location), KMessageWidget::Warning);
}
void DolphinViewContainer::slotOpenUrlFinished(KJob *job)
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 11c0423be..9d6a449c9 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -199,8 +199,7 @@ DolphinView::DolphinView(const QUrl &url, QWidget *parent)
connect(m_model, &KFileItemModel::directoryRedirection, this, &DolphinView::slotDirectoryRedirection);
connect(m_model, &KFileItemModel::urlIsFileError, this, &DolphinView::urlIsFileError);
connect(m_model, &KFileItemModel::fileItemsChanged, this, &DolphinView::fileItemsChanged);
- // #473377: Use a QueuedConnection to avoid modifying KCoreDirLister before KCoreDirListerCache::deleteDir() returns.
- connect(m_model, &KFileItemModel::currentDirectoryRemoved, this, &DolphinView::currentDirectoryRemoved, Qt::QueuedConnection);
+ connect(m_model, &KFileItemModel::currentDirectoryRemoved, this, &DolphinView::currentDirectoryRemoved);
connect(this, &DolphinView::itemCountChanged, this, &DolphinView::updatePlaceholderLabel);