summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorThulinma <jaron@vietors.com>2021-09-27 23:20:25 +0200
committerThulinma <jaron@vietors.com>2021-09-28 00:45:00 +0200
commit6941c3d3d7086ffac55b96e6fdc186b868094b2d (patch)
tree8042d656d9556dd945267877a3eddc695dedabdf /src
parentUpdate translation files (diff)
downloadnheko-6941c3d3d7086ffac55b96e6fdc186b868094b2d.tar.xz
Fix --help and --version command line options when Nheko is already running. Also adds an info message when it sends a URI to another instance
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp

index cf7e29e6..f6373d2a 100644 --- a/src/main.cpp +++ b/src/main.cpp
@@ -176,12 +176,6 @@ main(int argc, char *argv[]) 100, userdata); - if (app.isSecondary()) { - // open uri in main instance - app.sendMessage(matrixUri.toUtf8()); - return 0; - } - QCommandLineParser parser; parser.addHelpOption(); parser.addVersionOption(); @@ -202,6 +196,15 @@ main(int argc, char *argv[]) parser.process(app); + // This check needs to happen _after_ process(), so that we actually print help for --help when + // Nheko is already running. + if (app.isSecondary()) { + nhlog::ui()->info("Sending Matrix URL to main application: {}", matrixUri.toStdString()); + // open uri in main instance + app.sendMessage(matrixUri.toUtf8()); + return 0; + } + app.setWindowIcon(QIcon::fromTheme("nheko", QIcon{":/logos/nheko.png"})); http::init();