1
0
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:
novist 2014-11-25 19:56:35 +02:00
parent beae534d66
commit a9134956db

View File

@ -66,9 +66,12 @@ int main(int argc, char *argv[])
parser.addHelpOption();
parser.addVersionOption();
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);
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
@ -153,7 +156,7 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
}
else if(!ipc.isCurrentOwner())
else if(!ipc.isCurrentOwner() && !parser.isSet("P"))
{
time_t event = ipc.postEvent("$activate");
ipc.waitUntilProcessed(event);