mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
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
This commit is contained in:
parent
2d59d53eeb
commit
6941c3d3d7
1 changed files with 9 additions and 6 deletions
15
src/main.cpp
15
src/main.cpp
|
@ -176,12 +176,6 @@ main(int argc, char *argv[])
|
||||||
100,
|
100,
|
||||||
userdata);
|
userdata);
|
||||||
|
|
||||||
if (app.isSecondary()) {
|
|
||||||
// open uri in main instance
|
|
||||||
app.sendMessage(matrixUri.toUtf8());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
parser.addVersionOption();
|
parser.addVersionOption();
|
||||||
|
@ -202,6 +196,15 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
parser.process(app);
|
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"}));
|
app.setWindowIcon(QIcon::fromTheme("nheko", QIcon{":/logos/nheko.png"}));
|
||||||
|
|
||||||
http::init();
|
http::init();
|
||||||
|
|
Loading…
Reference in a new issue