1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

check -P option for invalid profiles

closes #977
This commit is contained in:
Dubslow 2015-01-20 02:24:25 -06:00
parent 96fd1e514d
commit f0c3ca1c9e
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA

View File

@ -71,7 +71,16 @@ int main(int argc, char *argv[])
Settings::getInstance(); // Build our Settings singleton as soon as QApplication is ready, not before
if (parser.isSet("P"))
Settings::getInstance().setCurrentProfile(parser.value("P"));
{
QString profile = parser.value("P");
if (QDir(Settings::getSettingsDirPath()).exists(profile + ".tox"))
{
qDebug() << "Setting profile to" << profile;
Settings::getInstance().setCurrentProfile(profile);
}
else
qWarning() << "Warning: -P profile" << profile + ".tox" << "doesn't exist";
}
sodium_init(); // For the auto-updater