Bug 416737 - New strange "system-settings" category created after looking in "KDE Daemon" category and clicking on "Launch Konsole"
Summary: New strange "system-settings" category created after looking in "KDE Daemon" ...
Status: REOPENED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keys (show other bugs)
Version: 5.17.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Jansen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-25 11:18 UTC by Tony
Modified: 2020-05-15 07:47 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.19.0


Attachments
First setting. (139.79 KB, image/png)
2020-01-25 11:19 UTC, Tony
Details
Second setting. (121.03 KB, image/png)
2020-01-25 11:19 UTC, Tony
Details
new Global Shortcuts kcm on Plasma 5.19 beta (89.11 KB, image/png)
2020-05-14 23:16 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tony 2020-01-25 11:18:29 UTC
SUMMARY
Hello,
i am confused by a System settings behavior and wondered if it's normal (i mean, intended by devs) or a bug. 
I set Ctrl+Alt+T shortcut for launching konsole in System settings->Shortcuts->Global shortcuts->KDE daemon and Apply. I click on Custom Shortcuts, go back to Global shortcuts and Ctrl+Alt+T has been moved to another voice, "System-settings" missing before. If i re-open System settings the situation doesn't change.
At the next reboot, the story repeats: first System settings launch and Ctrl+Alt+T is under Global-shortcuts->KDE-daemon and System-settings is missing; another System settings launch and it has been moved to the magically appeared "System-settings" voice. I've attached two screenshots to be clear.

STEPS TO REPRODUCE
1. Open System settings->Shortcuts->Global shortcuts and in KDE-daemon set Ctrl+Alt+T to launch konsole, then Apply.
2. Move on Custom shortcuts, go back to Global shortcuts and you can see the shortcut has been moved to a previously missing voice, "System-settings" 
3. Restart the system, open System settings and the shortcut initially appears under KDE-daemon and next times under the System-settings voice previously missing.

OBSERVED RESULT
Ctrl+Alt+T shortcut gets moved from a voice to another on every restart.
 
EXPECTED RESULT
Ctrl+Alt+T stays in same voice forever.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon
KDE Plasma Version: Plasma 5.17.5
KDE Frameworks Version: 5.66.0
Qt Version: 5.13.2
Comment 1 Tony 2020-01-25 11:19:06 UTC
Created attachment 125390 [details]
First setting.
Comment 2 Tony 2020-01-25 11:19:33 UTC
Created attachment 125391 [details]
Second setting.
Comment 3 Nate Graham 2020-01-28 20:43:41 UTC
Whoa totally bizarre! I can reproduce the issue.
Comment 4 David Redondo 2020-04-30 17:15:53 UTC
Git commit 1ee6660ceb62d4584a5371d0cce107b7008e75df by David Redondo.
Committed on 30/04/2020 at 16:51.
Pushed by davidre into branch 'master'.

Rewrite of the global shortcuts kcm

Summary:
This is a total rewrite of the global shortcuts kcm from scratch. It uses an
abstract item model backend with a qml frontend. This resolves some issues the
old kcm inherently had because it just stacked KShortcutEditors. First it enables
a global serach/filter which either matches the component name, actions, default
or set key combinations across components. Secondly KGlobalAccel can have multiple
default/active key combinations for each action - the old kcm only exposed two each.
The new kcm displays all default or set key combinations.
The main visual structure is similiar to the old kcm. On the left there is a list
with all components but rather than divided into "Application Launchers" and
"Other Shortcuts" the sections are now called "Applications" and "System Services"
(cf. notifications kcm) and the components are now assigned whether the service
we find for a component is an application or not rather if the component was
added via .desktop file. In the main view the shortcuts are displayed. Each item
corresponds to one action. Initially each item is collapsed and shows the action
name and a list of the currently set key combinations for that action. In the
expanded form all default shortcuts are shown which can be activated or
deactivated and all other active shortcuts ("Custom Shortcuts"). It is possible
to change, remove or add new custom shortcuts.
The kcm and model communicate directly with the daemon over DBus. This removes
the need to awkwardly construct actions to pass to the KGlobalAccel API.
Related: bug 157468, bug 213101, bug 230583, bug 250121, bug 251437, bug 272554, bug 318964, bug 341817, bug 348264, bug 366257, bug 369020, bug 388574, bug 393403, bug 408942, bug 416149, bug 417915, bug 419215, bug 419515, bug 419624, bug 419692, bug 419825, bug 419909, bug 420093
FIXED-IN: 5.19.0

Closes T7267

Test Plan:
kcmshell5 kcm_keys
{F8243559}

{F8243560}

{F8243561}

{F8243562}

{F8243563}

{F8243564}

Reviewers: #vdg, #plasma, ngraham

Reviewed By: #vdg, ngraham

Subscribers: GB_2, broulik, davidedmundson, nicolasfella, ngraham, iasensio, plasma-devel

Tags: #plasma

Maniphest Tasks: T7267

Differential Revision: https://phabricator.kde.org/D28744

M  +43   -33   kcms/keys/CMakeLists.txt
D  +0    -29   kcms/keys/ChangeLog
M  +1    -6    kcms/keys/Messages.sh
D  +0    -7    kcms/keys/README
D  +0    -84   kcms/keys/export_scheme_dialog.cpp
D  +0    -59   kcms/keys/export_scheme_dialog.h
D  +0    -35   kcms/keys/export_scheme_dialog.ui
A  +82   -0    kcms/keys/filteredmodel.cpp     [License: GPL (v2/3)]
A  +46   -0    kcms/keys/filteredmodel.h     [License: GPL (v2/3)]
D  +0    -89   kcms/keys/globalshortcuts.cpp
D  +0    -44   kcms/keys/globalshortcuts.h
A  +198  -0    kcms/keys/kcm_keys.cpp     [License: GPL (v2/3)]
R  +1    -1    kcms/keys/kcm_keys.desktop [from: kcms/keys/keys.desktop - 099% similarity]
A  +74   -0    kcms/keys/kcm_keys.h     [License: GPL (v2/3)]
D  +0    -856  kcms/keys/kglobalshortcutseditor.cpp
D  +0    -153  kcms/keys/kglobalshortcutseditor.h
D  +0    -130  kcms/keys/kglobalshortcutseditor.ui
A  +216  -0    kcms/keys/package/contents/ui/ShortcutActionDelegate.qml     [License: GPL (v2+)]
A  +302  -0    kcms/keys/package/contents/ui/main.qml     [License: GPL (v2+)]
A  +17   -0    kcms/keys/package/metadata.desktop
D  +0    -77   kcms/keys/select_application.ui
D  +0    -102  kcms/keys/select_scheme_dialog.cpp
D  +0    -51   kcms/keys/select_scheme_dialog.h
D  +0    -150  kcms/keys/select_scheme_dialog.ui
A  +489  -0    kcms/keys/shortcutsmodel.cpp     [License: GPL (v2+)]
A  +112  -0    kcms/keys/shortcutsmodel.h     [License: GPL (v2/3)]

https://commits.kde.org/plasma-desktop/1ee6660ceb62d4584a5371d0cce107b7008e75df
Comment 5 Patrick Silva 2020-05-14 23:16:58 UTC
Created attachment 128467 [details]
new Global Shortcuts kcm on Plasma 5.19 beta

This issue is still reproducible with the new Global Shortcuts kcm.
My screenshot shows the "System Settings" category selected and "Launch Konsole" (without ctrl+alt+t shortcut previously configured) in the right pane.

Operating System: Arch Linux 
KDE Plasma Version: 5.18.90
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0 rc2
Comment 6 David Redondo 2020-05-15 07:47:05 UTC
Urgh that's a "feature" of kglobalaccel made worse by the combination with khotkeys. 
KGlobalAccel has the concept of an uniqueName and a name that is displayed to the user. If it receives something with a known uniqueName and a different display name it will update the display name to that. Useful for example when switching languages.
What's happening here is that khotkeys stuff doesn't seem to set an explicit display string defaulting to the one of the process it's running in. On start the shortcuts are registered by the kded module so you get "KDE Daemon" but if you open the Custom Shortcuts kcm, it will register all it's hotkeys with kglobalaccel  with the displayname of "System settings" because the kcm is running in the system settings process ...