Allows printing version with -v when an instance is already running

Fixes #1362 by checking if the -v argument was used when deciding
whether to print the "keepassxc is already running" error message
This commit is contained in:
Nick Fox 2018-06-29 20:46:33 -04:00 committed by Jonathan White
parent c5cd4b6783
commit c19df0130b

View File

@ -96,7 +96,7 @@ int main(int argc, char** argv)
"handle");
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption versionOption = parser.addVersionOption();
parser.addOption(configOption);
parser.addOption(keyfileOption);
parser.addOption(pwstdinOption);
@ -105,7 +105,7 @@ int main(int argc, char** argv)
parser.process(app);
const QStringList fileNames = parser.positionalArguments();
if (app.isAlreadyRunning()) {
if (app.isAlreadyRunning() && !parser.isSet(versionOption)) {
if (!fileNames.isEmpty()) {
app.sendFileNamesToRunningInstance(fileNames);
}