Ignore NoDisplay=true .desktop entries when matching by Name.

Authored by hein on Mar 3 2017, 6:12 PM.



We currently match Krita by Name. It's classClass is "krita",
but its DesktopEntryName is org.kde.krita.desktop. However,
Krita also installs numerous additional .desktop entries to
associate more file types by itself, all of which match by
name, and the first one in the list isn't the right one. All
of those extra .desktop files are NoDisplay=true however, so
we can filter them out, which brings the match list down to
the one and only .desktop file we care for.

Diff Detail

R120 Plasma Workspace
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
hein created this revision.Mar 3 2017, 6:12 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 3 2017, 6:12 PM
rempt added a subscriber: rempt.Mar 3 2017, 6:14 PM

This seems correct to me :-)

hein added a comment.Mar 3 2017, 6:15 PM

And now the recent files work fine for Krita:

broulik edited edge metadata.Mar 3 2017, 6:27 PM

Shouldn't we *always* exclude them, not just for name matching?



hein updated this revision to Diff 12144.Mar 3 2017, 6:30 PM

Remove debug.

broulik accepted this revision.Mar 3 2017, 6:31 PM
This revision is now accepted and ready to land.Mar 3 2017, 6:31 PM
hein added a comment.Mar 3 2017, 6:33 PM

Shouldn't we *always* exclude them, not just for name matching?

Two reasons:

  • I could imagine a case where someone wants to hide a .desktop from the menu (e.g. something like a KCM) but it still has a useful Exec= and could be useful to be pinnable. Excluding an explicit DesktopEntryName match means eliminating the match, since there can be only one match due to the single namespace.
  • DesktopEntryName is more explicit, and if we ever match a NoDisplay entry there we shouldn't, I actually want the 'bug' to bubble up and for us to learn about it so we can think about that case more, because it'd be really weird :).
This revision was automatically updated to reflect the committed changes.