mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Added -P <profile> parameter which makes qTox start (and not activate any existing instances) and load specified profile
This commit is contained in:
parent
beae534d66
commit
a9134956db
|
@ -66,9 +66,12 @@ int main(int argc, char *argv[])
|
||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
parser.addVersionOption();
|
parser.addVersionOption();
|
||||||
parser.addPositionalArgument("uri", QObject::tr("Tox URI to parse"));
|
parser.addPositionalArgument("uri", QObject::tr("Tox URI to parse"));
|
||||||
|
parser.addOption(QCommandLineOption("P", QObject::tr("Starts new instance and loads specified profile."), "profile"));
|
||||||
parser.process(a);
|
parser.process(a);
|
||||||
|
|
||||||
Settings::getInstance(); // Build our Settings singleton as soon as QApplication is ready, not before
|
Settings::getInstance(); // Build our Settings singleton as soon as QApplication is ready, not before
|
||||||
|
if(parser.isSet("P"))
|
||||||
|
Settings::getInstance().setCurrentProfile(parser.value("P"));
|
||||||
|
|
||||||
sodium_init(); // For the auto-updater
|
sodium_init(); // For the auto-updater
|
||||||
|
|
||||||
|
@ -153,7 +156,7 @@ int main(int argc, char *argv[])
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!ipc.isCurrentOwner())
|
else if(!ipc.isCurrentOwner() && !parser.isSet("P"))
|
||||||
{
|
{
|
||||||
time_t event = ipc.postEvent("$activate");
|
time_t event = ipc.postEvent("$activate");
|
||||||
ipc.waitUntilProcessed(event);
|
ipc.waitUntilProcessed(event);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user