[tomboy/gnome-2-26] Prevent initialization of GConfPreferencesClient before calling Gtk.Application.Init.



commit 86ad5a06f612bc5145d16cdbb8370ef66ce559a8
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date:   Sun Apr 26 09:38:11 2009 -0700

    Prevent initialization of GConfPreferencesClient before calling Gtk.Application.Init.
---
 Tomboy/Services.cs |    3 ++-
 Tomboy/Tomboy.cs   |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Tomboy/Services.cs b/Tomboy/Services.cs
index 9db361b..b364d7f 100644
--- a/Tomboy/Services.cs
+++ b/Tomboy/Services.cs
@@ -46,7 +46,6 @@ namespace Tomboy
 #endif
 			
 			nativeApp = factory.CreateNativeApplication ();
-			prefs = factory.CreatePreferencesClient ();
 		}
 
 		public static IPlatformFactory Factory {
@@ -57,6 +56,8 @@ namespace Tomboy
 
 		public static IPreferencesClient Preferences {
 			get {
+				if (prefs == null)
+					prefs = factory.CreatePreferencesClient ();
 				return prefs;
 			}
 		}
diff --git a/Tomboy/Tomboy.cs b/Tomboy/Tomboy.cs
index e6c98c6..42a1d8f 100644
--- a/Tomboy/Tomboy.cs
+++ b/Tomboy/Tomboy.cs
@@ -43,6 +43,8 @@ namespace Tomboy
 			}
 #endif // ENABLE_DBUS || WIN32
 
+			// NOTE: It is important not to use the Preferences
+			//       class before this call.
 			Initialize ("tomboy", "tomboy", "tomboy", args);
 
 			// Add private icon dir to search path



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