[banshee/stable-2.2] GnomeBackend: Be more robust against GConf failures (bgo#659841)



commit 24022eef2288a6de1e1ae665554a1539d09f9fb1
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Tue Nov 1 15:51:50 2011 +0100

    GnomeBackend: Be more robust against GConf failures (bgo#659841)
    
    Wrap the call to GConf.Client.Set in a try/catch to work around a
    bug in GConf 3.2.0 (bgo#659835). This prevents Banshee from going
    haywire if the GConf daemon is not available because of that bug.

 .../GConfConfigurationClient.cs                    |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs b/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs
index 9372b6f..42a2045 100644
--- a/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs
+++ b/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs
@@ -135,7 +135,13 @@ namespace Banshee.GnomeBackend
                 client = new GConf.Client ();
             }
 
-            client.Set (CreateKey (@namespace, key), value);
+            // We wrap the Set call in a try/catch to work around bgo#659835,
+            // which causes Banshee to go haywire (see bgo#659841)
+            try {
+                client.Set (CreateKey (@namespace, key), value);
+            } catch (Exception e) {
+                Log.Exception (String.Format ("Could not set GConf key {0}.{1}.", @namespace, key), e);
+            }
         }
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]