Code cleanups
ClosedPublic

Authored by tcanabrava on Jul 8 2019, 10:11 AM.

Details

Summary

Send options as an Array

*should* be faster as potentially there will be just one allocation

Rename variable: QApplication qa to app.

qa means nothing and the default for Qt apps is to have the
QApplication var named app.

Return directly without creating temporaries

Extract logic from main function

Diff Detail

Repository
R871 DrKonqi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
tcanabrava created this revision.Jul 8 2019, 10:11 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 8 2019, 10:11 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
tcanabrava requested review of this revision.Jul 8 2019, 10:11 AM
sitter accepted this revision.Jul 8 2019, 10:25 AM
sitter added a subscriber: sitter.

I do wonder if it wouldn't make sense to make the two helpers into a new class DrKonqiLauncher or some such and then delegate this entire decision to the class. The way this was before the diff is weird, and the way it is after the diff is still weird IMHO. Also the two objects that are allocated in the two methods aren't properly deleted anywhere it seems.

src/main.cpp
56

excess space before (

This revision is now accepted and ready to land.Jul 8 2019, 10:25 AM

I do wonder if it wouldn't make sense to make the two helpers into a new class DrKonqiLauncher or some such and then delegate this entire decision to the class. The way this was before the diff is weird, and the way it is after the diff is still weird IMHO. Also the two objects that are allocated in the two methods aren't properly deleted anywhere it seems.

I'll try to rework them in classes in a followup change.

This revision was automatically updated to reflect the committed changes.