Bug 448764 - KDF should not rely on having Dolphin in runtime
Summary: KDF should not rely on having Dolphin in runtime
Status: RESOLVED FIXED
Alias: None
Product: kdf
Classification: Applications
Component: general (show other bugs)
Version: 21.12.1
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-19 11:47 UTC by Snehit Sah
Modified: 2022-01-23 11:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Snehit Sah 2022-01-19 11:47:36 UTC
SUMMARY

KDF currently relies on having Dolphin installed to be able to
open a disk in file explorer. The choice seems to be hardcoded
in source code 

https://invent.kde.org/utilities/kdf/-/blob/master/src/stdoption.cpp#L16

A better way to open local paths might be to use
QUrl::fromLocalFile and pass it to QDesktopServices::openUrl
This will ensure that disk is opened in whichever file manager
is available on user's system, rather than assuming that
Dolphin is always available.

STEPS TO REPRODUCE

Install KDF on a system without Dolphin. In KDF, right click
on a disk and select "Open in File Manager".

OBSERVED RESULT

Nothing happens

EXPECTED RESULT

Disk should open in whichever file manager is available
on user's system.
Comment 1 Nicolas Fella 2022-01-19 23:06:18 UTC
You can set a file manager in the settings, but yes, it should just open the default one
Comment 2 Nicolas Fella 2022-01-19 23:19:08 UTC
Since you already know what needs to be done, would you like to submit a patch for it?
Comment 3 Snehit Sah 2022-01-20 15:11:09 UTC
Thanks for the acknowledgement about opening default file manager. I'll send a merge request soon.
Comment 4 Bug Janitor Service 2022-01-20 15:21:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kdf/-/merge_requests/4
Comment 5 Bug Janitor Service 2022-01-22 02:59:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kdf/-/merge_requests/5
Comment 6 Albert Astals Cid 2022-01-23 11:49:41 UTC
Git commit 7ca2f908a5dc5285c5b94ae053e32ff0016d1afe by Albert Astals Cid, on behalf of Snehit Sah.
Committed on 23/01/2022 at 11:45.
Pushed by aacid into branch 'master'.

Add feature to use system default file manager to open drive

Added an option in settings to use system default file manager to
open drives. If selected, KDF will use QDesktopServices to open
disk. If unchecked, KDF will use the previous behaviour of executing
supplied command in settings.

Signed-off-by: Snehit Sah <snehitsah@protonmail.com>

M  +10   -0    src/kdfconfig.cpp
M  +11   -4    src/kdfconfig.ui
M  +7    -1    src/kdfwidget.cpp
M  +16   -0    src/stdoption.cpp
M  +3    -0    src/stdoption.h

https://invent.kde.org/utilities/kdf/commit/7ca2f908a5dc5285c5b94ae053e32ff0016d1afe