Commit 9fc5243e authored by Martin Schultz's avatar Martin Schultz

moved commandLine parsing prior to context creation

so core profile option is set properly
parent c5943198
......@@ -472,15 +472,35 @@ int main(int argc, char **argv)
QApplication app(argc,argv);
#if QT_VERSION >= 0x050500
switch (parseCommandLine(parser, &errorMessage)) {
case CommandLineOk:
break;
case CommandLineError:
fputs(qPrintable(errorMessage), stderr);
fputs("\n\n", stderr);
fputs(qPrintable(parser.helpText()), stderr);
return 1;
case CommandLineVersionRequested:
printf("%s %s\n", qPrintable(QCoreApplication::applicationName()),
qPrintable(QCoreApplication::applicationVersion()));
return 0;
case CommandLineHelpRequested:
parser.showHelp();
Q_UNREACHABLE();
}
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
format.setVersion(4, 4);
if (OpenFlipper::Options::coreProfile())
{
format.setProfile(QSurfaceFormat::CoreProfile);
}
else {
format.setProfile(QSurfaceFormat::CompatibilityProfile);
format.setOption(QSurfaceFormat::DeprecatedFunctions);
}
if (OpenFlipper::Options::debug())
format.setOption(format.options() | QSurfaceFormat::DebugContext);
......@@ -517,25 +537,6 @@ int main(int argc, char **argv)
// create core ( this also reads the ini files )
Core * w = new Core( );
switch (parseCommandLine(parser, &errorMessage)) {
case CommandLineOk:
break;
case CommandLineError:
fputs(qPrintable(errorMessage), stderr);
fputs("\n\n", stderr);
fputs(qPrintable(parser.helpText()), stderr);
delete w;
return 1;
case CommandLineVersionRequested:
printf("%s %s\n", qPrintable(QCoreApplication::applicationName()),
qPrintable(QCoreApplication::applicationVersion()));
return 0;
case CommandLineHelpRequested:
parser.showHelp();
Q_UNREACHABLE();
}
QString tLang = OpenFlipperSettings().value("Core/Language/Translation","en_US").toString();
if (tLang == "locale")
......@@ -605,24 +606,6 @@ int main(int argc, char **argv)
// create widget ( this also reads the ini files )
Core * w = new Core( );
switch (parseCommandLine(parser, &errorMessage)) {
case CommandLineOk:
break;
case CommandLineError:
fputs(qPrintable(errorMessage), stderr);
fputs("\n\n", stderr);
fputs(qPrintable(parser.helpText()), stderr);
delete w;
return 1;
case CommandLineVersionRequested:
printf("%s %s\n", qPrintable(QCoreApplication::applicationName()),
qPrintable(QCoreApplication::applicationVersion()));
return 0;
case CommandLineHelpRequested:
parser.showHelp();
Q_UNREACHABLE();
}
// After setting all Options from command line, build the real gui
w->init();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment