Commit 7922089d authored by Laurent Montel's avatar Laurent Montel
Browse files

Use QCommandLineOption directly => avoid potential bug with QString value

parent 7bc967b1
Pipeline #212022 passed with stage
in 1 minute and 56 seconds
......@@ -52,7 +52,8 @@ int main(int argc, char *argv[])
KAboutData::setApplicationData(aboutData);
QCommandLineParser parser;
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("mode"), i18n("Mode: %1", QStringLiteral("manual|automatic"))));
const QCommandLineOption modeOption(QStringList() << QStringLiteral("mode"), i18n("Mode: %1", QStringLiteral("manual|automatic")));
parser.addOption(modeOption);
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
......@@ -60,7 +61,7 @@ int main(int argc, char *argv[])
KDBusService service(KDBusService::Unique);
ImportWizard::WizardMode mode = ImportWizard::WizardMode::AutoDetect;
if (parser.isSet(QStringLiteral("mode"))) {
if (parser.isSet(modeOption)) {
if (!parser.positionalArguments().isEmpty()) {
const QString modeStr = parser.positionalArguments().at(0);
if (modeStr == QLatin1String("manual")) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment