Open probonopd opened 4 years ago
https://github.com/linuxdeepin/dde-file-manager/search?q=dbusfilemanager1 seems to be relatively straightforward.
Nautilus implements it, XFCE file manager doesn't.
… also (for example) this Open folder button in multimedia/simplescreenrecorder:
Other non-browser apps affected by this issue include:
SSR is using https://doc.qt.io/qt-5/qdesktopservices.html#openUrl
[static]bool QDesktopServices::openUrl(const QUrl &url) Opens the given url in the appropriate Web browser for the user's desktop environment, and returns true if successful; otherwise returns false.
If the URL is a reference to a local file (i.e., the URL scheme is "file") then it will be opened with a suitable application instead of a Web browser.
I think this is not about "show in file manager", and is not using /org/freedesktop/FileManager1
-- "show in file manager" highlights the file in question in the file manager.
Thanks … with KDE Plasma on FreeBSD 14.0-CURRENT
, the Open folder button opens the folder that contains the screen recording in a new tab in Dolphin.
Do you need a separate issue for applications that should show the folder but not select the file?
the Open folder button opens the folder that contains the screen recording in a new tab in Dolphin.
Yes, but this ticket is about applications being able to not only open the folder but also select the file in the file manager. Filer does not implement the protocol needed for this yet.
Do you need a separate issue for applications that should show the folder but not select the file?
Not yet. This stuff is expected to work only once we have a proper "open with" database/implementation.
Looks like @Ashish-Bansal had sent a patch for KDE Dolphin that implements this.
https://phabricator.kde.org/source/dolphin/browse/master/src/dbusinterface.cpp
Can we port this to Filer? Possibly somewhere around
Did I ever mention that I find D-Bus way too complicated? ;-)
Added https://github.com/helloSystem/Filer/commit/4c1f261220f9d0993b219c32f57a929aec753b80
But the wrong methods get exported to D-Bus under the org.freedesktop.FileManager1
service as shown by QDBusViewer below:
Application/org.filer.application
with methods like desktopPreferences
?MenuBar
?All these things we were already exporting under the D-Bus org.filer.Filer
Service.
But under the org.freedesktop.FileManager1
we want to export the methods needed by the File Manager DBus Interface:
/org/freedesktop/FileManager1
with methods like ShowFolders
, ShowItems
, and ShowItemProperties
?In my personal opinion, D-Bus being too complicated starts right with the fact that there is org.freedesktop.FileManager1
and /org/freedesktop/FileManager1
and that the two are not one and the same. As we can see, this complicates things immensely because now one needs to ensure (how?) that /org/freedesktop/FileManager1
(and only it) actually gets published under org.freedesktop.FileManager1
. Why?
What I seem to be missing entirely is how to tell Qt "publish the Qt method DBusInterface::ShowFolders(const QStringList& uriList, const QString& startUpId)
as the D-Bus method ShowFolders
under /org/freedesktop/FileManager1
under org.freedesktop.FileManager1
. Exactly there and only there.
Thanks @zyga for the following explanation:
I don't know Qt but it's fairly simple if you think about it the following way.
Maybe if I meditate long enough over it, then one day I will understand and appreciate the concepts behind D-Bus ;-)
This works:
gdbus call --session --dest org.freedesktop.FileManager1 --object-path /org/freedesktop/FileManager1 --method org.freedesktop.FileManager1.ShowItems '["file:///Applications"]' ""
It will open a Filer window at /
and highlight the Applications
folder therein.
Thanks @mszoek.
Looks like ShowFolders
is not implemented here yet.
Causes:
It is implemented correctly in https://github.com/probonopd/Filer
User story: When I select "show in folder" for a download in a browser, then not only the Downloads folder should open but also the downloaded file should be selected.
Looks like GNOME and KDE use https://www.freedesktop.org/wiki/Specifications/file-manager-interface/,
org.freedesktop.FileManager1
DBus name and the/org/freedesktop/FileManager1
object path.And e.g., Chromium implements it: https://chromium.googlesource.com/chromium/src/+/master/chrome/browser/platform_util_linux.cc
Reference: https://github.com/probonopd/go-appimage/issues/12
This was also requested upstream.