Bug 415826 - Implement FileManager1 dbus interface
Summary: Implement FileManager1 dbus interface
Status: CONFIRMED
Alias: None
Product: krusader
Classification: Applications
Component: general (other bugs)
Version First Reported In: 2.7.2
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-03 00:29 UTC by Denis Lisov
Modified: 2020-01-03 16:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Lisov 2020-01-03 00:29:38 UTC
Some programs use it to open file manager, fail to open Krusader and fall back to other file managers instead. For example:

- make Krusader the default file manager,
- open Spectacle,
- press Tools - Open Screenshots Folder,
- observe that the directory did not open in Krusader (in my case it was Dolphin instead).
Comment 1 Davide Gianforte 2020-01-03 07:44:01 UTC
Hi, I tried your steps: same result. I also tried to set other programs as default file manager (FileLight, Gwenview), but Spectacle keeps opening Dolphin. I also did logout/login but no changes.

It does work from the K menu - History, I can open recent folder with the default file manager, no need to logout/login.

Looking at the code of Spectacle, the Open button simply does a KRun on the designated folder. Must investigate.

Operating System: Slackware 14.2
KDE Plasma Version: 5.17.3
KDE Frameworks Version: 5.65.0
Qt Version: 5.13.2
Kernel Version: 5.4.7
OS Type: 64-bit
Comment 2 Davide Gianforte 2020-01-03 08:52:01 UTC
Proposed patch: https://phabricator.kde.org/D26383
Comment 3 Denis Lisov 2020-01-03 10:38:40 UTC
Hi Davide,

Thank you for your attempt, but I don't think that's the correct way. Spectacle is not the one at fault here, or we'll have to fix this at every place separately. Shouldn't KRun be the one to know how to open the user default file manager?

For example, your patch does not fix Spectacle's own Open Containing Folder button that appears after saving the screenshot - and that one uses KIO::highlightInFileManager, which will immediately cause you to find bug 397953.

There are also other cases such using highlightInFileManager such as "Open Containing Folder" in file context menu in the Open dialog of, for example, Kate. Or Firefox opening the folder containing a downloaded file using the FileManager1 DBus interface.
Comment 4 David Redondo 2020-01-03 10:51:11 UTC
Hi I just stepped through KIO to what happens and it essentially does the same as your patch. It ends up in KRun::runURL which looks similiar to your code.
https://cgit.kde.org/kio.git/tree/src/widgets/krun.cpp#n421

Are you sure this happens in Spectacle 19.12.0? The KRun line  that your patch touches is only in master, 19.12.0 has complicated logic here that ends up calling KIO::highlightInFileManager
Comment 5 Davide Gianforte 2020-01-03 16:30:02 UTC
I see your points; while there are some programs that work the same way as the patch I proposed, using dbus is forward-looking: it is better to change the file manager habits for all programs than change all programs to look what is the default file manager.

This will be a non-trivial patch, switching to wishlist.