Bug 387961 - Device action disappears from "Disks & Devices" applet when its description is edited
Summary: Device action disappears from "Disks & Devices" applet when its description i...
Status: CONFIRMED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_solid-actions (show other bugs)
Version: 5.27.80
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: System Settings Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-16 15:47 UTC by Patrick Silva
Modified: 2023-11-18 21:24 UTC (History)
5 users (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 Patrick Silva 2017-12-16 15:47:32 UTC
Steps to Reproduce:
1. connect a pendrive to usb port, open device notifier in system tray and see the actions available for your device
2. open system settings, open "removable devices"
3. double click on any device action available for your device ("open with dolphin", for example), edit its description (first text field) and click "Ok" button
4. remove and connect your device again
5. click on "device notifier" tray icon and see the device actions available

Result: The device action just edited is not available anymore
Comment 1 Alexander Mentyu 2018-01-26 19:04:22 UTC
Can reproduce in:

Plasma: 5.11.5
Apps: 17.12.1
Qt: 5.10.0
Frameworks: 5.42.0
Kernel: 4.14.14-1-MANJARO
Comment 2 Patrick Silva 2018-09-10 15:18:56 UTC
Bug persists in plasma 5.13.5, Arch Linux. I have just edited "Open with VLC player" and such option disappeared from device notifier.
Comment 3 skierpage 2019-01-14 02:51:17 UTC
I think the problem is if you edit only the first text field, it creates a truncated two-line file in ~/.local/share/solid/actions/SOME_NAME.desktop containing only
  [Desktop Action open]
  Name=YOUR NEW DESCRIPTION

and this isn't enough and confuses Device Notifier. It seems you need the Exec line and other info from the original SOME_NAME.desktop file in /usr/share/solid/actions/ .

As a workaround, you can copy the entire original file and modify just the Name  line in your local copy. But then System Settings > Removable Devices > Device Actions listed two device actions with the new name, either of which I could discard.
Comment 4 Stan Towianski 2019-07-14 22:48:38 UTC
same on newer mageia 7: KDE Plasma version 5.15.4
KDE Frameworks 5.57.0
Qt 5.12.2

Also in Manjaro current/up-to-date 18.0.4 I think it is

Alt-space   go to Device actions
choose "Open with File Manager" the one with all the Storage stuff
change kde-open5 "%f"
to whatever : myscript.sh "%f"

plug in usb stick
missing option to "open with file manager"

go edit again and change back to kde-open5 "%f"
it is still missing.

I am not taking anything out. this is a minor change. 
I am guessing it is not writing out some config file properly.

also, if /usr/share/solid/actions/  is where it writes files,
there are now 17 files in there and they are like gwenview, dragonplayer, digikam, vlc, but nothing about file-manager or dolphin...
Comment 5 Stan Towianski 2020-01-19 02:34:40 UTC
I at least figured out how to make it work by creating my own device action file.
don't know if it matters but only version diff seems to be Qt Version 5.12.6
I did one "no change" edit and it did not mess up my file but I do not know if editting works yet.

so I think default files must be at: /usr/share/solid/actions
per skierpage I copied one : test-predicate-openinwindow.desktop
to: /home/myuser/.local/share/solid/actions
as: test-predicate-openinwindow-jfp.desktop      (jfp file manager)

------------  test-predicate-openinwindow-jfp.desktop  ---------------------
[Desktop Entry]
X-KDE-Solid-Predicate=[ [ [ StorageVolume.ignored == false AND StorageVolume.usage == 'FileSystem' ] OR [ IS StorageAccess AND StorageDrive.driveType == 'Floppy' ] ] OR StorageAccess.ignored == false ]
Type=Service
Actions=open;

[Desktop Action open]
Name=Open with JFileProcessor
Exec=/mypath/programs/jfp-to-use/run.sh "%f"
Icon=/mypath/github/jfileprocessorRest/src/main/resources/icons/jfp.png
---------------------------------------------------


------------  jfp-to-use/run.sh  --------------
#!/bin/bash
cd /mypath/programs/jfp-to-use
java -jar JFileProcessor-1.8.9.war $1


at least this works and the device action file does not get mangled or disappear.
When I pop in a usb stick
It does show my name, my icon and opens my program for the usb stick path.
Comment 6 Patrick Silva 2020-11-20 08:23:19 UTC
This bug persists.

Steps to Reproduce:
1. connect a usb flash drive to usb port
2. click on "Disks & Devices" in system tray, click on your device
and see the actions currently available for it
3. open System Settings > Removable Storage > Device Actions
4. double click on a device action available for your device (I double-clicked on "Open with File Manager" whose second column says "Storage Volume, Storage Drive, Storage Access")
5. edit its description (first text field) and click on "Ok" button
6. disconnect and reconnect your device to usb port
7. click on "Disks & Devices" in system tray, click on your device
and see the actions currently available for it again

Operating System: Arch Linux
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2
Comment 7 Nate Graham 2020-11-25 02:55:31 UTC
Yep, I can also reproduce.
Comment 8 Nate Graham 2021-05-07 16:59:20 UTC
This seems like a bug in how the KCM creates the overrided .desktop file. Moving there.
Comment 9 Patrick Silva 2023-11-18 21:24:07 UTC
I have just edited "Download Photos with digiKam" device action and it disappeared.

Operating System: Arch Linux 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.245.0
Qt Version: 6.6.0
Graphics Platform: Wayland