Skip to content

Commit

Permalink
Add separate about command for about
Browse files Browse the repository at this point in the history
WE2-713

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma committed Aug 8, 2023
1 parent 0448f7e commit 12bab1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion install/web-eid.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application

Exec=web-eid %F
Exec=web-eid --about
Icon=web-eid

Name=Web eID
Expand Down
8 changes: 8 additions & 0 deletions src/controller/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ CommandWithArgumentsPtr Application::parseArgs()
QCommandLineOption parentWindow(QStringLiteral("parent-window"),
QStringLiteral("Parent window handle (unused)"),
QStringLiteral("parent-window"));
QCommandLineOption aboutArgument(QStringLiteral("about"),
QStringLiteral("Show Web-eID about Window"));
QCommandLineParser parser;
parser.setApplicationDescription(QStringLiteral(
"Application that communicates with the Web eID browser extension via standard input and "
Expand All @@ -128,6 +130,7 @@ CommandWithArgumentsPtr Application::parseArgs()
parser.addOptions({{{"c", "command-line-mode"},
"Command-line mode, read commands from command line arguments instead of "
"standard input."},
aboutArgument,
parentWindow});

static const auto COMMANDS = "'" + CMDLINE_GET_SIGNING_CERTIFICATE + "', '"
Expand Down Expand Up @@ -161,9 +164,14 @@ CommandWithArgumentsPtr Application::parseArgs()
// https://bugs.chromium.org/p/chromium/issues/detail?id=354597#c2
qDebug() << "Parent window handle is unused" << parser.value(parentWindow);
}
if (parser.isSet(aboutArgument)) {
return std::make_unique<CommandWithArguments>(CommandType::ABOUT, QVariantMap());
}
#ifndef Q_OS_LINUX
if (arguments().size() == 1) {
return std::make_unique<CommandWithArguments>(CommandType::ABOUT, QVariantMap());
}
#endif
return nullptr;
}

Expand Down

0 comments on commit 12bab1f

Please sign in to comment.