Bug 420632

Summary: App names in ExportMenu::getKServiceItems() are unsorted
Product: [Applications] Spectacle Reporter: Giovanni.Antonio.Carl.Friedrich
Component: GeneralAssignee: Boudhayan Gupta <me>
Status: RESOLVED INTENTIONAL    
Severity: minor CC: kde, nate, noahadvs
Priority: NOR Keywords: junior-jobs
Version First Reported In: 20.04.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Giovanni.Antonio.Carl.Friedrich 2020-04-26 19:00:01 UTC
SUMMARY
in ExportMenu::getKServiceItems() we get services unsorted

STEPS TO REPRODUCE
1. query KMimeTypeTrader
2. iterate over services
3. addAction(action);

OBSERVED RESULT
sometimes it's Gwenview + Gimp + Chromium + KolourPaint + qutebrowser
sometimes it's Gwenview + qutebrowser + Chromium + Gimp + KolourPaint

EXPECTED RESULT
from A to Z:
Chromium + Gimp + Gwenview + KolourPaint + qutebrowser

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.18.4.1
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
* std::tolower(service->name()) before sorting?
* for (auto service : sorted(services)) ?
Comment 1 Bug Janitor Service 2022-01-21 21:00:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/120
Comment 2 Noah Davis 2023-08-14 20:10:59 UTC
They're actually sorted according to user preferences for the mimetype of the image file. If you have a PNG and you compare the app list in Spectacle to the app list for images/png in System Settings -> Applications -> File Associations, they're exactly the same.
Comment 3 Nate Graham 2023-08-15 00:41:43 UTC
Yeah, I agree that this should be declared intentional and the MR closed.