[moserial] migrate from gconf to gsettings



commit ea10275f08714c4f45f0bcbf6798e7af073ed843
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Wed Aug 17 10:03:56 2011 -0400

    migrate from gconf to gsettings

 Makefile.am          |    2 +-
 src/Preferences.vala |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index e3659a6..508bb88 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,7 +50,7 @@ moserial_SOURCES = \
 	$(NULL)
 
 src/moserial.vala.stamp: $(moserial_VALASOURCES)
-	$(VALAC) -C --pkg gtk+-2.0 --pkg gdk-2.0 --pkg Config --pkg posix --pkg gconf-2.0 --pkg linux --vapidir src/ --basedir $(top_srcdir) $^
+	$(VALAC) -C --pkg gtk+-2.0 --pkg gdk-2.0 --pkg gio-2.0 --pkg Config --pkg posix --pkg linux --vapidir src/ --basedir $(top_srcdir) $^
 	touch $@
 
 moserial_LDADD = \
diff --git a/src/Preferences.vala b/src/Preferences.vala
index c419e66..0666b14 100644
--- a/src/Preferences.vala
+++ b/src/Preferences.vala
@@ -57,15 +57,15 @@ public class Preferences : GLib.Object
 			highlightColor=DEFAULT_HIGHLIGHT_COLOR;
 	}
 	public static string getSystemDefaultMonospaceFont() {
-		string value = "";
 
-                var gc = GConf.Client.get_default ();
-                try {
-                        value = gc.get_string("/desktop/gnome/interface/monospace_font_name");
-                } catch (GLib.Error e) {
-                        warning(_("Unable to retrieve gconf key: %s"), e.message);
-                        value = "Monospace 10";
+		var settings = new GLib.Settings ("org.gnome.desktop.interface");
+                string value = settings.get_string ("monospace-font-name");
+
+		if (value == "") {
+                        warning(_("Unable to retrieve system font setting"));
+                        value = DEFAULT_FONT;
                 }
+
                 return value;
 	}
 	public static Gdk.Color getGdkColor(string color) {



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