Fix warning on launch from QCommandLineParser
ClosedPublic

Authored by nazark on Jan 6 2020, 11:42 AM.

Details

Summary

Currently kcalc shows next warning on launch:

QCommandLineParser: already having an option named "h"
QCommandLineParser: already having an option named "help-all"
QCommandLineParser: already having an option named "v"

This patch fixes that by removing duplicate code from kcalc, "help" and "version" options are already being added in KAboutData::setupCommandLine

Diff Detail

Repository
R353 KCalc
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nazark created this revision.Jan 6 2020, 11:42 AM
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptJan 6 2020, 11:42 AM
nazark requested review of this revision.Jan 6 2020, 11:42 AM

If this fix is correct, the same things should be probably done in some other apps, so far I found konsole to produce the same warning.

elvisangelaccio accepted this revision.Jan 6 2020, 3:06 PM
elvisangelaccio added a subscriber: elvisangelaccio.

Yes, the fix is correct. Feel free to submit patches for all affected apps :)

This revision is now accepted and ready to land.Jan 6 2020, 3:06 PM

Can you please rebase this patch? It doesn't apply currently.

nazark added a comment.Jan 6 2020, 3:40 PM

I'm afraid that I'll need a bit of help in order to do that, sorry :-(
Git tells me that my copy is up-to-date, so I think that my patch is applied on top of most recent commit.
What exactly should I do to rebase it?

I'm afraid that I'll need a bit of help in order to do that, sorry :-(
Git tells me that my copy is up-to-date, so I think that my patch is applied on top of most recent commit.
What exactly should I do to rebase it?

Indeed. I've no idea why applying this patch fails. :/

Anyway, I've tested this by creating the commit manually but the warnings are still there. Am I missing something? Does this work for you?

nazark added a comment.Jan 6 2020, 7:18 PM

Yep, I tested it before submitting a patch, and the warning is gone when I launch my compiled version of kcalc..
https://i.imgur.com/qSATbjg.png

Fixed, it was a problem on my end. I'm going to push it, thanks!

This revision was automatically updated to reflect the committed changes.
nazark added a comment.EditedJan 6 2020, 7:50 PM

Nice, thanks =)

And now about the other apps, I found out that actually there are quite a lot of apps that have this issue, not only the kcalc and the konsole.
So, there is no better option than just making one patch per app and submitting it on the phabricator, right?

Nice, thanks =)

And now about the other apps, I found out that actually there are quite a lot of apps that have this issue, not only the kcalc and the konsole.
So, there is no better option than just making one patch per app and submitting it on the phabricator, right?

Well, you could try to send an email to kde-devel@kde.org telling people about this warning. I can't promise you it will work though ;)