| Summary: | Local recent files in non-KDE apps are opened using kio-fuse mounted location instead of local path | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Igor Poboiko <igor.poboiko> |
| Component: | general | Assignee: | KIO Bugs <kio-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | fabian, kdelibs-bugs-null, kio-bugs-null, nate |
| Priority: | NOR | ||
| Version First Reported In: | 5.96.0 | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/plasma/plasma-desktop/commit/615c286f3be390fa6dc5eb39f139ddf7bf39c2f1 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Igor Poboiko
2022-08-09 16:56:51 UTC
Yep, I can reproduce the issue. Here I edited kate's desktop file to use %f instead of %U and it uses kio-fuse. Reassigning to kio, which decides which URLs to hand over to kio-fuse. The issue appears to be caused by whatever writes into the recently-used.xbel file. In some cases it stores a file path instead of a URL in the "href" attribute, which is treated as a URL by KIO. QUrl("/file/path") has an empty scheme() and isLocalFile() returns false, so it passes the not-really-URL to kio-fuse. kio-fuse in turn uses QUrl::fromUserInput which is smart enough to recognize that it's in fact a local path and converts it to a proper file:// URL internally. That's why it works at all...
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2008 Now I can't find a way to reliably get such a broken path into the recently-used.xbel file, so I can't really find out which code path triggers the bad format. I found one candidate though and made a MR for that, but there are probably some other places. KActivities doesn't really distinguish between file paths and URLs unfortunately, it's all just stored as strings. What doesn't help is that sometimes the context menu entries are broken. In the panel they sometimes do nothing and QML complains about "calling indexOf on undefined". In kicker the entries sometimes do nothing because 'Desktop Entry file "" doesn't have a valid Exec key'. A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1085 Git commit bf37558f36494d13f0fe0f00862937d859aa20f1 by Fabian Vogt. Committed on 11/08/2022 at 08:15. Pushed by fvogt into branch 'master'. taskmanager: Use proper QUrls for recent document actions The resource can either be a URL or an absolute path, the url() method converts the latter into a proper URL. Without this, a local path might end up getting parsed (badly) as URL, causing weird behaviour later, like resorting to kioexec/kio-fuse. M +5 -10 applets/taskmanager/plugin/backend.cpp https://invent.kde.org/plasma/plasma-desktop/commit/bf37558f36494d13f0fe0f00862937d859aa20f1 Git commit 24e92862c85cdfee7a0fbe66336b7d259acd86a9 by Fabian Vogt. Committed on 11/08/2022 at 08:47. Pushed by fvogt into branch 'Plasma/5.25'. taskmanager: Use proper QUrls for recent document actions The resource can either be a URL or an absolute path, the url() method converts the latter into a proper URL. Without this, a local path might end up getting parsed (badly) as URL, causing weird behaviour later, like resorting to kioexec/kio-fuse. (cherry picked from commit bf37558f36494d13f0fe0f00862937d859aa20f1) M +5 -10 applets/taskmanager/plugin/backend.cpp https://invent.kde.org/plasma/plasma-desktop/commit/24e92862c85cdfee7a0fbe66336b7d259acd86a9 I've rebuild the plasma-desktop with the patch applied, seems like it fixed the issue for me. Thanks! Git commit d2e3f679cfc81a22c85cbe58fb4fbf570149ed64 by Fabian Vogt. Committed on 11/08/2022 at 16:10. Pushed by fvogt into branch 'master'. Create proper QUrls for recent document actions The resource can either be a URL or an absolute path, the url() method converts the latter into a proper URL. M +1 -2 applets/kicker/plugin/actionlist.cpp https://invent.kde.org/plasma/plasma-workspace/commit/d2e3f679cfc81a22c85cbe58fb4fbf570149ed64 (In reply to Igor Poboiko from comment #8) > I've rebuild the plasma-desktop with the patch applied, seems like it fixed > the issue for me. Thanks! Yay, thanks for confirming! (In reply to Fabian Vogt from comment #4) > What doesn't help is that sometimes the context menu entries are broken. In > the panel they sometimes do nothing and QML complains about "calling indexOf > on undefined". In kicker the entries sometimes do nothing because 'Desktop > Entry file "" doesn't have a valid Exec key'. Turns out this URL confusion bug is actually the cause for both the invalid URLs in recently-used.xbel as well as this weird behaviour that the menu entries sometimes don't work. When using one of those broken entries for the first time, the broken URL is put into the recently-used.xbel file as well as into the kactivitymanagerd database. The latter also saves the mime type of the file, but with the broken URL that failed and it used application/octet-stream as fallback. When using one of those (now doubly-broken!) items, Plasma notices that the application doesn't support the mime type of the recently used file entry and refuses to launch it. Git commit 615c286f3be390fa6dc5eb39f139ddf7bf39c2f1 by Fabian Vogt. Committed on 13/08/2022 at 14:05. Pushed by fvogt into branch 'Plasma/5.24'. taskmanager: Use proper QUrls for recent document actions The resource can either be a URL or an absolute path, the url() method converts the latter into a proper URL. Without this, a local path might end up getting parsed (badly) as URL, causing weird behaviour later, like resorting to kioexec/kio-fuse. Plasma/5.24 backport note: Here it doesn't request URLs, so the resource is actually never a valid URL! (cherry picked from commit bf37558f36494d13f0fe0f00862937d859aa20f1) M +5 -7 applets/taskmanager/plugin/backend.cpp https://invent.kde.org/plasma/plasma-desktop/commit/615c286f3be390fa6dc5eb39f139ddf7bf39c2f1 |