Fix warning on launch from QCommandLineParser
AbandonedPublic

Authored by nazark on Jan 6 2020, 9:22 PM.

Details

Reviewers
None
Summary

Currently konsole 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 konsole, "help" and "version" options are already being added in KAboutData::setupCommandLine

Diff Detail

Repository
R319 Konsole
Lint
Lint Skipped
Unit
Unit Tests Skipped
nazark created this revision.Jan 6 2020, 9:22 PM
Restricted Application added a subscriber: konsole-devel. · View Herald TranscriptJan 6 2020, 9:22 PM
nazark requested review of this revision.Jan 6 2020, 9:22 PM

Thanks I just noticed this - I wonder when it started or if depends on KF5/Qt5 version.

Also we are trying to move over to gitlab for patches - https://invent.kde.org/kde/konsole/merge_requests

wbauer added a subscriber: wbauer.Jan 7 2020, 12:54 PM

Thanks I just noticed this - I wonder when it started or if depends on KF5/Qt5 version.

That warning is new in Qt 5.14:
https://code.qt.io/cgit/qt/qtbase.git/commit/src/corelib/tools/qcommandlineparser.cpp?h=5.14&id=90c86d738e0f36eaa48c7f81f6f5cc035a339d6b

KAboutData::setupCommandLine calls addHelpVersion() and addVersionOption() since kcoreaddons 5.7.0:
https://cgit.kde.org/kcoreaddons.git/commit/src/lib/kaboutdata.cpp?id=e73140695268a8d94812d74178bc0a225a319d17

But konsole's minimum KF5 version is 5.6.0 currently. Maybe this should be increased?

But konsole's minimum KF5 version is 5.6.0 currently. Maybe this should be increased?

As the minimum Qt version is 5.9.0, I highly doubt that anyone would want to build konsole with KF5 5.6.0 (which is more than 2 years older) anyway...

But konsole's minimum KF5 version is 5.6.0 currently. Maybe this should be increased?

As the minimum Qt version is 5.9.0, I highly doubt that anyone would want to build konsole with KF5 5.6.0 (which is more than 2 years older) anyway...

The KF5 version has never been tested to see what's actually required - that is just a low #.

I think this needs a Qt5 and KF5 check; there's no reason to remove in earlier versions.

wbauer added a comment.EditedJan 8 2020, 8:15 AM

I think this needs a Qt5 and KF5 check; there's no reason to remove in earlier versions.

It would only need a KF5 check:
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5,7,0)

The Qt version doesn't matter, it's just that earlier versions don't print a runtime warning if an option is added twice.

But, @lmontel already committed this change also to konsole an hour ago:
https://cgit.kde.org/konsole.git/commit/?id=ac630f7fb15506ef4a49bab519361697c30ff273

So it's probably best to just raise the minimum KF5 version to at least 5.7.0 now (which still is ancient).

Yea I noticed that - he does that a lot - thanks for this patch regardless - you can close this.

nazark abandoned this revision.Jan 8 2020, 6:51 PM

I am not sure that this is how one closes a patch ^ , but that's the closest option I found..