Port to QApplication
ClosedPublic

Authored by wbauer on Nov 8 2017, 2:56 PM.

Details

Summary

Ports KApplication to QApplication, K4AboutData to KAboutData, and KCmdLineArgs to QCommandLineParser.
Also uses KDBusService instead of KUniqueApplication to prevent more than one instance running, and sets the translation domain via KLocalizedString::setApplicationDomain().

Test Plan
  • still starts if it's not running already and accepts command line arguments (e.g. passed URLs)
  • if it is running, it correctly passes the arguments to the running instance and quits
  • the KGet DBUS service shows up in qdbusviewer, methods can be called
  • application is translated

Diff Detail

Repository
R433 KGet
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
wbauer created this revision.Nov 8 2017, 2:56 PM
stikonas accepted this revision.Nov 8 2017, 3:31 PM
stikonas added a subscriber: stikonas.

I would probably use more C++11 like syntax for QStringLists though... E.g. QCommandLineOption( { QLatin1String("test"), i18n("Execute Unit Testing") } );
But in any case it should work.

This revision is now accepted and ready to land.Nov 8 2017, 3:31 PM
wbauer added a comment.Nov 8 2017, 4:52 PM

I would probably use more C++11 like syntax for QStringLists though... E.g. QCommandLineOption( { QLatin1String("test"), i18n("Execute Unit Testing") } );

TBH, those lines were created by the convert-kcmdlineargs.pl porting script from kde-dev-scripts...

But thanks for the hint!

I prefer to submit it as-is though, maybe I'll change that later at some point.

I would probably use more C++11 like syntax for QStringLists though... E.g. QCommandLineOption( { QLatin1String("test"), i18n("Execute Unit Testing") } );

TBH, those lines were created by the convert-kcmdlineargs.pl porting script from kde-dev-scripts...

But thanks for the hint!

I prefer to submit it as-is though, maybe I'll change that later at some point.

Sure, no problem. Please commit... I just said it as some side remark...

This revision was automatically updated to reflect the committed changes.
wbauer added a comment.Nov 8 2017, 5:05 PM

Sure, no problem. Please commit... I just said it as some side remark...

Yes, that's how I understood it. ;-)
Thanks for your reviews btw.