Consider desktop files with NoDisplay attribute
AbandonedPublic

Authored by meven on Oct 26 2019, 7:14 AM.

Details

Reviewers
mart
fvogt
apol
davidedmundson
Group Reviewers
Plasma
Summary
NoDisplay means "this application exists, but don't display it in the menus". This can be useful to e.g. associate this application with MIME types, so that it gets launched from a file manager (or other apps), without having a menu entry for it (there are tons of good reasons for this, including e.g. the netscape -remote, or kfmclient openURL kind of stuff).

https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

NoDisplay specify to ignore desktop files with no Display in menus. It specifically states that mimetype are a case where an app might be associated with one, but not shown in the menus.
Shortcuts should be treated the same as mimetype association.

To allow cases such as Krunner, where the app won't be in the menu but still needs shortcuts.
Related: D24857

Diff Detail

Repository
R268 KGlobalAccel
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18184
Build 18202: arc lint + arc unit
meven created this revision.Oct 26 2019, 7:14 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptOct 26 2019, 7:14 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
meven requested review of this revision.Oct 26 2019, 7:14 AM
meven added a comment.Oct 26 2019, 7:16 AM

This was added previously in D2103

I think you have also to check the the kcm as i also saw some nodisplay there.
Also it seems kglobalaccel uses nodisplay when a component is disabled. https://cgit.kde.org/kglobalaccel.git/tree/src/runtime/kserviceactioncomponent.cpp#n144

I think you have also to check the the kcm as i also saw some nodisplay there.
Also it seems kglobalaccel uses nodisplay when a component is disabled. https://cgit.kde.org/kglobalaccel.git/tree/src/runtime/kserviceactioncomponent.cpp#n144

It should probably use a custom field in the desktop file like X-KDE-Shortcuts-disable=true or similiar.

apol added a comment.Apr 15 2020, 11:57 AM

+1 This makes sense to me

kglobalshortcutseditor.cpp
needs updating to match

I think you're right with your reasoning about NoDisplay, but we do want something to be able to mask system files. From the spec should we be checking Hidden= ?

kglobalshortcutseditor.cpp
needs updating to match

I think you're right with your reasoning about NoDisplay, but we do want something to be able to mask system files. From the spec should we be checking Hidden= ?

Hidden=true is equivalent to not having the file at all according to the spec, so it would make sense. There's also D25088 open.

davidedmundson accepted this revision.Apr 15 2020, 2:15 PM

[14:12] <d_ed> DavidRedondo1: my understanding is that a system might ship "konsole opens with control+t" . The UI allows you to remove that. This would remove the entry in kglobalshortcutsrc, but because it's still in the system defaults file as soon as you log in again it'll add it back

[14:25] <DavidRedondo1> d_ed, fvogt Apparently the runtime writes the hidden thing when a component is cleanedUp https://cgit.kde.org/kglobalaccel.git/tree/src/runtime/kserviceactioncomponent.cpp#n135
[14:27] <DavidRedondo1> Does that fail or something when the file is not writeable?
[14:31] <DavidRedondo1> I think it fails
[14:31] <DavidRedondo1> I just tested it

if it is indeed broken...then we may as well just merge this.

This revision is now accepted and ready to land.Apr 15 2020, 2:15 PM
meven added a comment.Apr 15 2020, 2:45 PM

[14:12] <d_ed> DavidRedondo1: my understanding is that a system might ship "konsole opens with control+t" . The UI allows you to remove that. This would remove the entry in kglobalshortcutsrc, but because it's still in the system defaults file as soon as you log in again it'll add it back

[14:25] <DavidRedondo1> d_ed, fvogt Apparently the runtime writes the hidden thing when a component is cleanedUp https://cgit.kde.org/kglobalaccel.git/tree/src/runtime/kserviceactioncomponent.cpp#n135

This is addressed in D25088

[14:12] <d_ed> DavidRedondo1: my understanding is that a system might ship "konsole opens with control+t" . The UI allows you to remove that. This would remove the entry in kglobalshortcutsrc, but because it's still in the system defaults file as soon as you log in again it'll add it back

[14:25] <DavidRedondo1> d_ed, fvogt Apparently the runtime writes the hidden thing when a component is cleanedUp https://cgit.kde.org/kglobalaccel.git/tree/src/runtime/kserviceactioncomponent.cpp#n135

This is addressed in D25088

This has the same failure that it only works for writable files. I have the idea to save in kglobalshortcutsrc if a desktopfile is disabled

fvogt added a comment.Apr 15 2020, 2:49 PM

[14:12] <d_ed> DavidRedondo1: my understanding is that a system might ship "konsole opens with control+t" . The UI allows you to remove that. This would remove the entry in kglobalshortcutsrc, but because it's still in the system defaults file as soon as you log in again it'll add it back

[14:25] <DavidRedondo1> d_ed, fvogt Apparently the runtime writes the hidden thing when a component is cleanedUp https://cgit.kde.org/kglobalaccel.git/tree/src/runtime/kserviceactioncomponent.cpp#n135
[14:27] <DavidRedondo1> Does that fail or something when the file is not writeable?
[14:31] <DavidRedondo1> I think it fails
[14:31] <DavidRedondo1> I just tested it

if it is indeed broken...then we may as well just merge this.

It might not be broken for imported desktop files, in which case this would be a noticable regression. Not tested though.

meven abandoned this revision.Apr 24 2020, 12:41 PM

D28856 should be preferred