diff --git a/src/widgets/krun.cpp b/src/widgets/krun.cpp --- a/src/widgets/krun.cpp +++ b/src/widgets/krun.cpp @@ -760,7 +760,11 @@ if ((flags & DeleteTemporaryFiles) == 0) { // Remember we opened those urls, for the "recent documents" menu in kicker for (const QUrl &url : urls) { - KRecentDocument::add(url, service.desktopEntryName()); + // Only add files, or else the list of recent documents fills up + // with non-documents (e.g. web URLs, appstream URLs, etc) + if (KProtocolManager::supportsListing(url)) { + KRecentDocument::add(url, service.desktopEntryName()); + } } } @@ -779,7 +783,11 @@ if (!tempFiles) { // Remember we opened those urls, for the "recent documents" menu in kicker for (const QUrl &url : _urls) { - KRecentDocument::add(url, _service.desktopEntryName()); + // Only add files, or else the list of recent documents fills up + // with non-documents (e.g. web URLs, appstream URLs, etc) + if (KProtocolManager::supportsListing(url)) { + KRecentDocument::add(url, _service.desktopEntryName()); + } } } diff --git a/src/widgets/kurlrequesterdialog.cpp b/src/widgets/kurlrequesterdialog.cpp --- a/src/widgets/kurlrequesterdialog.cpp +++ b/src/widgets/kurlrequesterdialog.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -120,7 +121,9 @@ dlg.exec(); const QUrl &url = dlg.selectedUrl(); - if (url.isValid()) { + // Only add files, or else the list of recent documents fills up + // with non-documents (e.g. web URLs, appstream URLs, etc) + if (url.isValid() && KProtocolManager::supportsListing(url)) { KRecentDocument::add(url); }