Bug 432026 - "Only automatically mount removable media that has been manually mounted before" does nothing
Summary: "Only automatically mount removable media that has been manually mounted befo...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_deviceautomounter (show other bugs)
Version: 5.20.5
Platform: Neon Linux
: HI normal
Target Milestone: ---
Assignee: Torrie Fischer
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-01-24 10:43 UTC by dagobertram
Modified: 2021-09-20 19:24 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dagobertram 2021-01-24 10:43:40 UTC
SUMMARY
This feature does not work for me anymore.

STEPS TO REPRODUCE
1. Set "Enable automatic mounting of removable media" and "Only automatically mount removable media that has been manually mounted before" to enabled
2. disable both "Automatically mount all removable media at login" and "Automatically mount all removable media when attached"
3. manually mount new media
4. unmount and remove media from the usb port
5. put the media back into the usb port

OBSERVED RESULT
removable media does not get mounted automatically

EXPECTED RESULT
removable media does get mounted automatically


SOFTWARE/OS VERSIONS
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Comment 1 Nate Graham 2021-01-26 17:31:10 UTC
Can confirm. Méven, can you investigate?
Comment 2 Méven Car 2021-01-29 09:42:30 UTC
This is intentional : the "Only automatically mount removable media that has been manually mounted before" is only active in conjunction with "Automatically mount all removable media at login", "Automatically mount all removable media when attached", where the "all" is following the "Only automatically mount removable media that has been manually mounted before".

It seems our phrasing or UI should better reflect things, the "all" in particular and perhaps grey out "Only automatically mount removable media that has been manually mounted before" when both the other checkbox are disabled.
Comment 3 dagobertram 2021-01-29 16:57:46 UTC
(In reply to Méven Car from comment #2)
I am not really sure, if I got what you were saying. I tried the same with a not previously mounted usb media and checked all boxes. It seems that now my laptop is just mounting everything everytime. Even usb media which was not attached before ...
Still looks like a bug to me. :/
Comment 4 dagobertram 2021-01-29 17:28:56 UTC
You are right, that the wording needs to be more clear. I guess "Enable automatic mounting of removable media" is not needed at all.

This page needs to cover a lot of different options:
1 do not mount removable media automatically
2 automatically mount all removable media at login
3 automatically mount all removable media when attached
4 automatically mount all removable media at login and when attached
5 automatically mount removable media at login which has been manually mounted before
6 automatically mount removable media when attached which has been manually mounted before
7 automatically mount removable media at login and when attached which has been manually mounted before

Maybe it would be best to make it less verbose. The following idea could cover all the options above (if I am not mistaken) when implemented correctly.

---------------------------------------
Automatically mount removable media
   [] at login
   [] when attached
   [] if it has been manually mounted before
---------------------------------------

-> "at login" and "when attached" will mount everything all the time except "if it has been manually mounted before" is also checked. The last one should be greyed out, until one of the other checkboxes gets activated (like you said). Does that make any sense to you?
-> Also: Everything else would still be configurable down below, except when "at login" and "when attached" are checked.
Comment 5 Méven Car 2021-01-29 17:43:51 UTC
(In reply to dagobertram from comment #4)
> You are right, that the wording needs to be more clear. I guess "Enable
> automatic mounting of removable media" is not needed at all.
> 
> This page needs to cover a lot of different options:
> 1 do not mount removable media automatically
> 2 automatically mount all removable media at login
> 3 automatically mount all removable media when attached
> 4 automatically mount all removable media at login and when attached
> 5 automatically mount removable media at login which has been manually
> mounted before
> 6 automatically mount removable media when attached which has been manually
> mounted before
> 7 automatically mount removable media at login and when attached which has
> been manually mounted before
> 
> Maybe it would be best to make it less verbose. The following idea could
> cover all the options above (if I am not mistaken) when implemented
> correctly.
> 
> ---------------------------------------
> Automatically mount removable media
>    [] at login
>    [] when attached
>    [] if it has been manually mounted before
> ---------------------------------------
> 
> -> "at login" and "when attached" will mount everything all the time except
> "if it has been manually mounted before" is also checked. The last one
> should be greyed out, until one of the other checkboxes gets activated (like
> you said). Does that make any sense to you?

There is a bug indeed after further checking : "Only automatically mount removable media that has been manually mounted before" condition is inverted :

 - when unchecked only previously mounted devices will get mounted/unmounted based on the other two checkbox
 - when checked any device will get mounted/unmounted based on the other two checkbox

Btw the backing data for this service is in ~/.config/kded_device_automounterrc
You can check or remove the file to wipe any saved history.

I like your suggestions, I will add them to my fix.

> -> Also: Everything else would still be configurable down below, except when
> "at login" and "when attached" are checked.

That is the case already.
Comment 6 Méven Car 2021-01-29 18:00:03 UTC
You can have a look at https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/337
Comment 7 Nate Graham 2021-09-20 19:24:01 UTC
Git commit 808716db8c7812df3dbe78320ed140e0d0f27de7 by Nate Graham, on behalf of Méven Car.
Committed on 20/09/2021 at 19:23.
Pushed by ngraham into branch 'master'.

KCM Automounter: invert text description of AutomountUnknownDevices which was inverted

Make it more clearer that this settings depends on AutomountOnLogin and AutomountOnPlugin to be set.
FIXED-IN: 5.24

M  +64   -14   solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
M  +33   -105  solid-device-automounter/kcm/DeviceAutomounterKCM.ui
M  +5    -5    solid-device-automounter/kcm/DeviceModel.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/808716db8c7812df3dbe78320ed140e0d0f27de7