From 4a4ee5cda0ca821ee9b6ac219f93e7e5880b8e2c Mon Sep 17 00:00:00 2001
From: Dieter Piringer <dieter.piringer@gmail.com>
Date: Fri, 7 Nov 2014 18:56:48 +0100
Subject: [PATCH] Core: Fix segfault with -presentationMode

Change-Id: I5db01695fd6af338348994bed7498a3d4c7676ea
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
---
 src/plugins/coreplugin/coreplugin.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp
index 62be9d7c2e9..cd50daf04bb 100644
--- a/src/plugins/coreplugin/coreplugin.cpp
+++ b/src/plugins/coreplugin/coreplugin.cpp
@@ -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;
 
-- 
GitLab