summarylogtreecommitdiffstats
path: root/config_crash.patch
blob: 7fbff92d7322e5e67ed0f06b5ce836ab8bd8671d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From: Johannes Dewender <jonnyjd@users.sf.net>
Date: Wed, 25 Jul 2012 01:22:42.463515335 +0200
Subject: [PATCH] fix crash on saving configuration
Holyspirit crashed on exit when the configuration files were not writable.

Signed-off-by: Johannes Dewender <jonnyjd@users.sf.net>

Index: trunk/Source/main.cpp
===================================================================
--- trunk/Source/main.cpp.orig
+++ trunk/Source/main.cpp
@@ -88,7 +88,15 @@ int main (  )
     console->Ajouter("");
     console->Ajouter("Saving configuration");
 
-    configuration->Sauvegarder();
+    try
+    {
+        configuration->Sauvegarder();
+    }
+    catch (const std::string& str)
+    {
+        console->Ajouter("WARNING : ",1);
+        console->Ajouter(str,1);
+    }
 
     console->Ajouter("");
     console->Ajouter("Destruction of engines");
Index: trunk/Source/configuration.cpp
===================================================================
--- trunk/Source/configuration.cpp.orig
+++ trunk/Source/configuration.cpp
@@ -608,7 +608,7 @@ void Configuration::Sauvegarder()
         fichier.close();
     }
     else
-        throw "Unable to save configuration";
+        throw std::string("Unable to save configuration : configuration.conf");
 }
 
 void Configuration::SauvegarderKeyMapping()
@@ -639,7 +639,7 @@ void Configuration::SauvegarderKeyMappin
         fichier.close();
     }
     else
-        throw "Unable to save configuration";
+        throw std::string("Unable to save configuration : key_mapping.conf");
 }