summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-12-12 17:29:28 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-12-13 09:55:39 +0000
commit159ec429d136adc208922f27ba6044b529022dde (patch)
treefcec5d4ab6ee6e152c9c7625c250d35116b9db31 /desktop
parent9c1d6f5e3549cf3c90d28f86b67db4af41dcbde8 (diff)
SafeMode: Restart goes into safe mode again
Looks like the XRestartManager keeps all command line arguments when restarting, so it also keeps --safe-mode. Solution is to add a flag file when restarting from safe mode, to prevent going into safe mode again. Change-Id: I9820d3ccbddf98b0bf6132f254c989f52ea5e808 Reviewed-on: https://gerrit.libreoffice.org/31913 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 0fda52cc4a5c78c55f96850faa734ea66891808c) Reviewed-on: https://gerrit.libreoffice.org/31937 Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 7abfdda84c89..ea49fd2b0ca9 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -558,7 +558,10 @@ void Desktop::Init()
// Check whether safe mode is enabled
CommandLineArgs& rCmdLine = GetCommandLineArgs();
- if (rCmdLine.IsSafeMode() || sfx2::SafeMode::hasFlag())
+ // Check if we are restarting from safe mode - in that case we don't want to enter it again
+ if (sfx2::SafeMode::hasRestartFlag())
+ sfx2::SafeMode::removeRestartFlag();
+ else if (rCmdLine.IsSafeMode() || sfx2::SafeMode::hasFlag())
Application::EnableSafeMode();
// When we are in SafeMode we need to do changes before the configuration