Bug 416950 - ktraderclient5 ignores mimeapps.list when XDG_CURRENT_DESKTOP=KDE
Summary: ktraderclient5 ignores mimeapps.list when XDG_CURRENT_DESKTOP=KDE
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-kservice
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.66.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-30 15:34 UTC by Martin
Modified: 2020-10-09 01:01 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
ktraderclient5 with 'KDE' and 'all' in XDG env var (5.08 KB, text/x-log)
2020-01-30 15:45 UTC, Martin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2020-01-30 15:34:55 UTC
SUMMARY
ktraderclient5 ignores ~/.config/mimeapps.list when XDG_CURRENT_DESKTOP=KDE, it only shows XDG entries in .desktop files.

When the env var is set to anything else, it correctly shows both the mimeapps.list and .desktop entries.

STEPS TO REPRODUCE
1. XDG_CURRENT_DESKTOP="KDE" /usr/bin/ktraderclient5 --mimetype application/x-7z-compressed
2. XDG_CURRENT_DESKTOP="all" /usr/bin/ktraderclient5 --mimetype application/x-7z-compressed


SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.66.0
Qt Version: 5.14.1

ADDITIONAL INFORMATION

This ends up breaking xdg-mime as it relies on ktraderclient5
https://gitlab.freedesktop.org/xdg/xdg-utils/issues/164
Comment 1 Martin 2020-01-30 15:45:37 UTC
Created attachment 125545 [details]
ktraderclient5 with 'KDE' and 'all' in XDG env var

Refer to the linked xdg-utils Issue to see how to create a relevant .desktop entry if needed
Comment 2 Martin 2020-01-31 19:28:49 UTC
I forgot to add that using XDG_CURRENT_DESKTOP="" is also broken and only ends up showing .desktop entries just like "KDE" does.
Comment 3 Martin 2020-08-12 16:11:43 UTC
Empty env var probably has identical behavior because of
currentDesktops.append(&kde);
in KService:src/services/kservice.cpp

Seems like the XDG var is also used in KService:src/sycoca/kmimeassociations.cpp

The ktrader app itself is in https://invent.kde.org/plasma/kde-cli-tools/-/blob/master/ktraderclient/ktraderclient.cpp but it seems pretty barebones and relying on KService

I haven't been able to figure out more so far.
Comment 4 Janet Blackquill 2020-10-09 00:12:20 UTC
After a debugging session with Martin, it turns out the desktop file not showing up under XDG_CURRENT_DESKTOP=KDE has NotShowIn=KDE, therefore this is behaving exactly as it should. Removing the line "fixes" it (allows it to show up under KDE again).

Marking as not a bug.
Comment 5 Martin 2020-10-09 01:01:33 UTC
Since the NotShownIn behavior is as expected, I opened a more proper issue here https://bugs.kde.org/show_bug.cgi?id=427469 per Jan's advice