Avoid Qt warning of unused cmd.line argument (QCommandLineParser: option not defined)

Log msg: QCommandLineParser: option not defined: "clientIdAndKey"
This commit is contained in:
Klaus Basan
2018-08-15 19:07:56 +02:00
parent 9be7572c36
commit 5ff5c18b32

View File

@@ -581,6 +581,8 @@ namespace BlackCore
int id = 0; int id = 0;
QString key; QString key;
if (!CNetworkVatlib::getCmdLineClientIdAndKey(id, key)) { return args; } if (!CNetworkVatlib::getCmdLineClientIdAndKey(id, key)) { return args; }
// from cmd. line
args << "--idAndKey"; args << "--idAndKey";
args << sApp->getParserValue("clientIdAndKey"); // as typed in args << sApp->getParserValue("clientIdAndKey"); // as typed in
return args; return args;
@@ -762,6 +764,7 @@ namespace BlackCore
key = ""; key = "";
// split parser values // split parser values
if (CNetworkVatlib::getCmdLineOptions().isEmpty()) { return false; } // no such option, avoid warnings
const QString clientIdAndKey = sApp->getParserValue("clientIdAndKey").toLower(); const QString clientIdAndKey = sApp->getParserValue("clientIdAndKey").toLower();
if (clientIdAndKey.isEmpty() || !clientIdAndKey.contains(':')) { return false; } if (clientIdAndKey.isEmpty() || !clientIdAndKey.contains(':')) { return false; }
const QStringList stringList = clientIdAndKey.split(':'); const QStringList stringList = clientIdAndKey.split(':');