Fix initial loading of autostart program names
ClosedPublic

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

Details

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)

Diff Detail

Repository
R119 Plasma Desktop
Branch
names (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 23849
Build 23867: arc lint + arc unit
yuyichao created this revision.Mar 18 2020, 3:07 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 18 2020, 3:07 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
yuyichao requested review of this revision.Mar 18 2020, 3:07 AM
apol accepted this revision.Apr 10 2020, 11:37 PM

Hi, sorry for the delay, this review skipped my attention.

The patch looks good to me.

This revision is now accepted and ready to land.Apr 10 2020, 11:37 PM
davidedmundson accepted this revision.Apr 10 2020, 11:44 PM
This revision was automatically updated to reflect the committed changes.