Bug 383287 - 'GNOME Application Style (GTK)' module is not showing upon search in 'Application Menu'/'Application Dashboard'
Summary: 'GNOME Application Style (GTK)' module is not showing upon search in 'Applica...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.10.4
Platform: Netrunner Linux
: NOR normal
Target Milestone: 1.0
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-08 16:33 UTC by Alexander Mentyu
Modified: 2019-03-18 12:01 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.16.0


Attachments
no-gnome-application-style-entry-upon-search (91.69 KB, image/png)
2017-08-08 16:33 UTC, Alexander Mentyu
Details
desktop-appearance-is-highlighted (112.04 KB, image/png)
2017-08-08 16:33 UTC, Alexander Mentyu
Details
desktop-appearance-is-not-highlighted (112.45 KB, image/png)
2017-08-08 16:33 UTC, Alexander Mentyu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Mentyu 2017-08-08 16:33:10 UTC
Created attachment 107160 [details]
no-gnome-application-style-entry-upon-search

Also 'Desktop Appearance' 'System Settings' entry (where 'GNOME Application Style (GTK)' module is located) highlighting only after entering 'GNOME Application Style' (without '(GTK)' part) text in 'System Settings' 'Search' field - if 'GNOME Application Style (GTK)' (with '(GTK)' part) text is entered in 'System Settings' 'Search' field - 'Desktop Appearance' settings entry becomes not highlighted.
Comment 1 Alexander Mentyu 2017-08-08 16:33:25 UTC
Created attachment 107161 [details]
desktop-appearance-is-highlighted
Comment 2 Alexander Mentyu 2017-08-08 16:33:39 UTC
Created attachment 107162 [details]
desktop-appearance-is-not-highlighted
Comment 3 Kai Uwe Broulik 2017-08-10 08:41:59 UTC
Git commit 4e31ca3f05a0ad9f513b4e0f2da197f4116e4ae0 by Kai Uwe Broulik.
Committed on 10/08/2017 at 08:40.
Pushed by broulik into branch 'master'.

Add some keywords so it's more easily found in System Settings search

M  +1    -0    kde-gtk-config.desktop

https://commits.kde.org/kde-gtk-config/4e31ca3f05a0ad9f513b4e0f2da197f4116e4ae0
Comment 4 Kai Uwe Broulik 2017-08-10 08:43:17 UTC
Harald, there's explicit code in servicerunner that also erroneously(?) matches "kde-gtk-config" and thus it doesn't show up:

    if (id.startsWith(QLatin1String("kde-"))) {
        if (!service->isApplication()) {
            // avoid showing old kcms and what not
            continue;
        }
    ...
Comment 5 Harald Sitter 2017-08-10 08:55:30 UTC
Copy pasta from IRC for the record:

‎[10:47] ‎<‎sitter‎>‎ kbroulik: foo-desktop.desktop is foo/desktop.desktop on disk (haven't read bug yet)
‎[10:51] ‎<‎sitter‎>‎ kbroulik: mh, yeah, I think that is the problem here. the startsWith code is to filter out the old KDE3 `/usr/share/applications/kde/foo.desktop` entities which have the desktop id `kde-foo.desktop`
‎[10:52] ‎<‎sitter‎>‎ also see https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#desktop-file-id ... it's bit of a mess in the spec which I guess is largely because we put our stuff into a subdir even before the spec was a thing
‎[10:53] ‎<‎sitter‎>‎ seeing as the kde-* filter is only applicable to KDE3 we can probalby drop it, I think the better fix is to rename the KCM though. inparticular kde-* and kde4-* I can easily imagine being subject to filtering in more places than just the service runner
Comment 6 Patrick Silva 2019-02-20 16:37:28 UTC
Bug persists.

Operating System: Arch Linux 
KDE Plasma Version: 5.15.1
KDE Frameworks Version: 5.55.0
Qt Version: 5.12.1
Comment 7 Harald Sitter 2019-03-18 11:06:07 UTC
(as suspected this kde- filtering also happens elsewhere. albeit differently than what I thought: people forked the servicerunner in plasma-mobile and lancelot, so they inherit all the same defects and none of the fixes made since ...)
Comment 8 Harald Sitter 2019-03-18 11:06:54 UTC
Git commit 1f3ab6f7dddba56679645ed12ebc07ff1f187e84 by Harald Sitter.
Committed on 18/03/2019 at 11:06.
Pushed by sitter into branch 'Plasma/5.15'.

[service runner] throw out kde3 "compat" code

Summary:
Desktop files such as kde/foo.desktop are identified as kde-foo.desktop
because of the menu spec

```
If the directory contains sub-directories then these sub-directories should be (recursively) scanned as well. The name of the subdirectory should be added as prefix to the desktop-file id together with a dash character ("-")
```

the runner therefore broadly assumed that kde-foo.desktop is always
the desktop file kde/foo.desktop and since kde/ was only used up to KDE3
this assumption formed the basis for sepcial KDE3 compat handling. that is
of course wrong because a service might just as well actually have a
prefix and be actually called kde-foo.desktop rather than
kde/foo.desktop. Specific example: kde-gtk-config.desktop

seeing as this is ancient compatibility code that is actually wrong,
the easiest solution seems to be dropping the code entirely (and thus no
longer assume kde- has some special meaning).

(also I didn't find a way to get the underlying filename of a kservice,
 so making the code not wrong seems non-trivial)

CHANGELOG: the GTK+ settings module now correctly appears in krunner and kickoff

Test Plan: gtk kcm correctly shows up in both kickoff and krunner searches

Reviewers: broulik

Reviewed By: broulik

Subscribers: GB_2, plasma-devel

Tags: #plasma

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

M  +1    -18   runners/services/servicerunner.cpp

https://commits.kde.org/plasma-workspace/1f3ab6f7dddba56679645ed12ebc07ff1f187e84