diff --git a/containments/desktop/plugins/folder/foldermodel.h b/containments/desktop/plugins/folder/foldermodel.h --- a/containments/desktop/plugins/folder/foldermodel.h +++ b/containments/desktop/plugins/folder/foldermodel.h @@ -317,7 +317,7 @@ KDirModel *m_dirModel; KDirWatch *m_dirWatch; QString m_url; - QHash m_isDirCache; + mutable QHash m_isDirCache; mutable QHash m_isDirJobs; QItemSelectionModel *m_selectionModel; QItemSelection m_pinnedSelection; diff --git a/containments/desktop/plugins/folder/foldermodel.cpp b/containments/desktop/plugins/folder/foldermodel.cpp --- a/containments/desktop/plugins/folder/foldermodel.cpp +++ b/containments/desktop/plugins/folder/foldermodel.cpp @@ -1386,6 +1386,13 @@ return false; } + // Assume the root folder of a protocol is always a folder. + // This avoids spinning up e.g. trash KIO slave just to check whether trash:/ is a folder. + if (url.path() == QLatin1String("/")) { + m_isDirCache.insert(item.url(), true); + return true; + } + if (KProtocolInfo::protocolClass(url.scheme()) != QStringLiteral(":local")) { return false; }