[kcmshell] set application data only after parsing command line
ClosedPublic

Authored by graesslin on Oct 26 2016, 5:35 AM.

Details

Summary

KAboutData provides some information needed for the output of the
command line options like version. Thus it needs to be called before
processing the QCommandLineParser. But if done before any command line
arguments are processed the switch like --desktopfile does not work.

This change reorders the calls so that the command line is first parsed,
then the options of the KAboutData are processed. After that the about
data is set on the application and the command line parser is processed.

With this change both the version option and the desktopfile option is
working. It's important for kcmshell to have the desktopfile option
working so that applications using kcmshell5 as a helper to show
configuration can pass their own app id to kcmshell5, so that it e.g.
registers to a Wayland compositor as org.kde.foo instead of
org.kde.kcmshell5.

Test Plan

Run kcmshell5 --version, --help, --list and --desktopfile
and compared to variant before

Diff Detail

Repository
R126 KDE CLI Utilities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 7661.Oct 26 2016, 5:35 AM
graesslin retitled this revision from to [kcmshell] set application data only after parsing command line.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptOct 26 2016, 5:35 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart accepted this revision.Oct 27 2016, 8:20 AM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Oct 27 2016, 8:20 AM
This revision was automatically updated to reflect the committed changes.