Core: Fix segfault with -presentationMode

Change-Id: I5db01695fd6af338348994bed7498a3d4c7676ea
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Dieter Piringer
2014-11-07 18:56:48 +01:00
parent c43d958e6b
commit 4a4ee5cda0

View File

@@ -95,6 +95,7 @@ void CorePlugin::parseArguments(const QStringList &arguments)
QString themeName = QLatin1String("default");
QColor overrideColor;
bool overrideTheme = false;
bool presentationMode = false;
for (int i = 0; i < arguments.size(); ++i) {
if (arguments.at(i) == QLatin1String("-color")) {
@@ -103,7 +104,7 @@ void CorePlugin::parseArguments(const QStringList &arguments)
i++; // skip the argument
}
if (arguments.at(i) == QLatin1String("-presentationMode"))
ActionManager::setPresentationModeEnabled(true);
presentationMode = true;
if (arguments.at(i) == QLatin1String("-theme")) {
overrideTheme = true;
themeName = arguments.at(i + 1);
@@ -137,6 +138,7 @@ void CorePlugin::parseArguments(const QStringList &arguments)
// defer creation of these widgets until here,
// because they need a valid theme set
m_mainWindow = new MainWindow;
ActionManager::setPresentationModeEnabled(presentationMode);
m_findPlugin = new FindPlugin;
m_locator = new Locator;