From d4ab9eae6cb53f2af73e104ae3bcb7e72daaf660 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 19 Apr 2024 04:35:28 +0300 Subject: [PATCH] kio: KRecentDocument optimization the bug report was related to the resources system that Katie does not support Signed-off-by: Ivailo Monev --- kio/kfile/krecentdocument.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/kio/kfile/krecentdocument.cpp b/kio/kfile/krecentdocument.cpp index b4c4bb8c..23b1e5d8 100644 --- a/kio/kfile/krecentdocument.cpp +++ b/kio/kfile/krecentdocument.cpp @@ -68,18 +68,9 @@ QStringList KRecentDocument::recentDocuments() d.mkdir(recentDocumentDirectory()); } - const QStringList list = d.entryList(); QStringList fullList; - - foreach (const QString &it, list) { - QString pathDesktop; - if (it.startsWith(":")) { - // FIXME: Remove when Qt will be fixed - // http://bugreports.qt.nokia.com/browse/QTBUG-11223 - pathDesktop = KRecentDocument::recentDocumentDirectory() + it; - } else { - pathDesktop = d.absoluteFilePath(it); - } + foreach (const QString &it, d.entryList()) { + const QString pathDesktop = d.absoluteFilePath(it); KDesktopFile tmpDesktopFile(pathDesktop); KUrl urlDesktopFile(tmpDesktopFile.desktopGroup().readPathEntry("URL", QString())); if (urlDesktopFile.isLocalFile() && !QFile::exists(urlDesktopFile.toLocalFile())) { @@ -167,9 +158,8 @@ void KRecentDocument::add(const KUrl &url, const QString &desktopEntryName) void KRecentDocument::clear() { - const QStringList list = recentDocuments(); QDir dir; - foreach(const QString &it, list) { + foreach(const QString &it, recentDocuments()) { kDebug(s_krecentdocumentarea) << "clearing" << it; dir.remove(it); }