mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-10-11 21:10:48 -04:00
Don't show application if we're only showing the help / version
This commit is contained in:
parent
265325057a
commit
ca328242bc
1 changed files with 7 additions and 1 deletions
|
@ -95,7 +95,7 @@ int main(int argc, char** argv)
|
||||||
QCoreApplication::translate("main", "Parent window handle"),
|
QCoreApplication::translate("main", "Parent window handle"),
|
||||||
"handle");
|
"handle");
|
||||||
|
|
||||||
parser.addHelpOption();
|
QCommandLineOption helpOption = parser.addHelpOption();
|
||||||
QCommandLineOption versionOption = parser.addVersionOption();
|
QCommandLineOption versionOption = parser.addVersionOption();
|
||||||
parser.addOption(configOption);
|
parser.addOption(configOption);
|
||||||
parser.addOption(keyfileOption);
|
parser.addOption(keyfileOption);
|
||||||
|
@ -103,6 +103,12 @@ int main(int argc, char** argv)
|
||||||
parser.addOption(parentWindowOption);
|
parser.addOption(parentWindowOption);
|
||||||
|
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
|
||||||
|
// Don't try and do anything with the application if we're only showing the help / version
|
||||||
|
if (parser.isSet(versionOption) || parser.isSet(helpOption)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
const QStringList fileNames = parser.positionalArguments();
|
const QStringList fileNames = parser.positionalArguments();
|
||||||
|
|
||||||
if (app.isAlreadyRunning() && !parser.isSet(versionOption)) {
|
if (app.isAlreadyRunning() && !parser.isSet(versionOption)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue