Fix initial loading of autostart program names

Authored by yuyichao on Mar 18 2020, 3:03 AM.

Description

Fix initial loading of autostart program names

Summary:
When the auto start entry is first loaded, the module only take into account
the "Name" entry in the desktop file. However, after editing or when adding
a new one, KService::name is used which uses the file name as a fallback.
This causes the name to "mysteriously" appear and disappear when
checking the setting or reopenning the setting page.

This change fixes the issue by using the same function KService::name
in all cases. This is less efficient but easier to maintain than
duplicating the logic from KService.

Also use the newly available KService instance to replace some of
the manual reading of the desktop file.
The handling of NotShowIn and OnlyShowIn are left in place since
KService::showInCurrentDesktop() takes into account the current running
environment rather than only KDE.
Changing that behavior should be a separate issue.

Test Plan: Tested on 5.18.3. Unable to test on master (5.18.80)

Reviewers: apol, davidedmundson

Reviewed By: apol, davidedmundson

Subscribers: plasma-devel

Tags: Plasma

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

Details

Committed
yuyichaoApr 11 2020, 1:53 PM
Reviewer
apol
Differential Revision
D28113: Fix initial loading of autostart program names
Parents
R119:90ac7c210411: [Fonts KCM] Use KFontChooserDialog instead of QFontDialog
Branches
Unknown
Tags
Unknown