summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/sfx2/safemode.hxx24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/sfx2/safemode.hxx b/include/sfx2/safemode.hxx
index 03f85904271c..47034f62130a 100644
--- a/include/sfx2/safemode.hxx
+++ b/include/sfx2/safemode.hxx
@@ -40,9 +40,31 @@ public:
*/
static bool removeFlag();
+ /**
+ * Write a flag to the user profile indicating that we are currently restarting from safe mode -
+ * that means we don't want to enter safe mode again.
+ *
+ * @return Whether the file could be written successfully
+ */
+ static bool putRestartFlag();
+
+ /**
+ * Check the existence of the restart flag file.
+ *
+ * @return Whether the restart flag file exists
+ */
+ static bool hasRestartFlag();
+
+ /**
+ * Remove the restart flag file.
+ *
+ * @return Whether the flag file could be removed successfully
+ */
+ static bool removeRestartFlag();
+
private:
/** Returns the path of the safe mode flag file.*/
- static OUString getFileName();
+ static OUString getFilePath(const OUString& sFilename);
};
}