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)
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);