[frameworks/kio/prettier-deletions-for-desktop-items] src/widgets: Don't show percent-encoded strings for items of desktop:/ IO worker
Nate Graham <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 91289e16dfb161ee7b1001a1f31ef17649472d26 by Nate Graham.
Committed on 18/08/2026 at 18:08.
Pushed by ngraham into branch 'prettier-deletions-for-desktop-items'.
Don't show percent-encoded strings for items of desktop:/ IO worker
desktop:/ is our creation, not a standard thing, so these items don't
have a valid URL scheme from the perspective of QUrl::toDisplayString.
Thus it goes into a fallback path internally and returns something ugly.
To prevent that, the code here already handles it for trash:/ URLs;
let's extend the same thing to desktop:/ URLs.
BUG: 522470
FIXED-IN: 6.30
M +1 -1 src/widgets/widgetsaskuseractionhandler.cpp
https://invent.kde.org/frameworks/kio/-/commit/91289e16dfb161ee7b1001a1f31ef17649472d26
diff --git a/src/widgets/widgetsaskuseractionhandler.cpp b/src/widgets/widgetsaskuseractionhandler.cpp
index 85aedca460..0a2ca54a69 100644
--- a/src/widgets/widgetsaskuseractionhandler.cpp
+++ b/src/widgets/widgetsaskuseractionhandler.cpp
@@ -210,7 +210,7 @@ static ProcessAskDeleteResult processAskDelete(const QList<QUrl> &urls, AskIface
ProcessAskDeleteResult res;
res.prettyList.reserve(urls.size());
std::transform(urls.cbegin(), urls.cend(), std::back_inserter(res.prettyList), [](const auto &url) {
- if (url.scheme() == QLatin1String("trash")) {
+ if (url.scheme() == QLatin1String("trash") || url.scheme() == QLatin1String("desktop")) {
QString path = url.path();
// HACK (#98983): remove "0-foo". Note that it works better than
// displaying KFileItem::name(), for files under a subdir.