[sound-juicer] Use GSettings instead of GConf



commit 89f157502bc0898288e72c03707228dffbd25db3
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Sat Aug 6 16:07:16 2011 +0200

    Use GSettings instead of GConf
    
    GConf has been deprecated for some time now. This change removes the
    ability to set a local musicbrainz server. The support for this was
    half-hearted as it was only possible to set a custom hostname, not a
    custom port. This functionality could be restored fairly easily if
    there is a demand for it.
    
    Saving the window size and state is also removed as this should be
    stored in the xdg user config dir instead. This will be implemented
    soon.
    
    Thanks to Gert Kulyk & Phillip Wood for their contributions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=625897

 configure.ac                            |   15 +-
 data/Makefile.am                        |   32 +-
 data/org.gnome.sound-juicer.gschema.xml |   76 ++
 data/sound-juicer.convert               |    9 +
 data/sound-juicer.schemas.in            |  220 ------
 git.mk                                  |    5 +
 libjuicer/sj-metadata-getter.c          |   71 ++-
 libjuicer/sj-metadata-getter.h          |    2 -
 libjuicer/sj-metadata-gvfs.c            |   27 +-
 libjuicer/sj-metadata-musicbrainz5.c    |  151 ++--
 libjuicer/sj-metadata.c                 |   27 +-
 libjuicer/sj-metadata.h                 |    2 -
 po/POTFILES.in                          |    3 +-
 sound-juicer.spec.in                    |   13 -
 src/Makefile.am                         |    2 -
 src/gconf-bridge.c                      | 1244 -------------------------------
 src/gconf-bridge.h                      |  114 ---
 src/sj-main.c                           |  376 +++-------
 src/sj-play.c                           |    2 +-
 src/sj-prefs.c                          |  154 ++--
 src/sj-prefs.h                          |    2 +
 src/sound-juicer.h                      |   40 +-
 tests/mb-test.c                         |   11 -
 23 files changed, 492 insertions(+), 2106 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b1cbc2d..ac325a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,13 +26,14 @@ AM_PROG_CC_C_O
 AC_HEADER_STDC
 AC_PROG_LIBTOOL
 AC_PROG_INSTALL
-IT_PROG_INTLTOOL([0.40.0], [no-xml])
+IT_PROG_INTLTOOL([0.50.0])
 
 GNOME_COMPILE_WARNINGS([maximum])
 GNOME_DEBUG_CHECK
 GNOME_MAINTAINER_MODE_DEFINES
 
 GTK_REQUIRED=3.2.0
+GLIB_GSETTINGS
 
 AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
 
@@ -40,7 +41,7 @@ AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
 YELP_HELP_INIT
 
 # Find GLib and GObject
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32 gthread-2.0 gobject-2.0)
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32 gthread-2.0 gobject-2.0 gio-2.0)
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 
@@ -56,7 +57,7 @@ LIBS="$LIBS $BURN_LIBS"
 # LIBS="$oldlibs"
 
 # Find the UI libraries
-PKG_CHECK_MODULES(UI, gtk+-3.0 >= $GTK_REQUIRED gconf-2.0 gio-2.0 gmodule-export-2.0 libcanberra-gtk3)
+PKG_CHECK_MODULES(UI, gtk+-3.0 >= $GTK_REQUIRED gio-2.0 gmodule-export-2.0 libcanberra-gtk3)
 AC_SUBST(UI_CFLAGS)
 AC_SUBST(UI_LIBS)
 
@@ -93,14 +94,6 @@ PKG_CHECK_MODULES(GIO, gio-2.0)
 AC_SUBST(GIO_CFLAGS)
 AC_SUBST(GIO_LIBS)
 
-# Find how and where to put the GConf schemas
-AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
-if test "$GCONFTOOL" = "no"; then
-        AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
-fi
-AM_GCONF_SOURCE_2
-
-
 # Optionally enable G* deprecations
 AC_MSG_CHECKING([whether to enable deprecation warnings])
 AC_ARG_ENABLE([deprecations],
diff --git a/data/Makefile.am b/data/Makefile.am
index b752400..ed146d7 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -6,10 +6,12 @@ desktop_in_files = sound-juicer.desktop.in.in
 desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
-schemadir = $(GCONF_SCHEMA_FILE_DIR)
-schema_in_files = sound-juicer.schemas.in
-schema_DATA = $(schema_in_files:.schemas.in=.schemas)
- INTLTOOL_SCHEMAS_RULE@
+gsettings_SCHEMAS = org.gnome.sound-juicer.gschema.xml
+
+ GSETTINGS_RULES@
+
+convertdir = $(datadir)/GConf/gsettings
+convert_DATA = sound-juicer.convert
 
 profilesdir = $(datadir)/sound-juicer
 dist_profiles_DATA = rhythmbox.gep
@@ -62,28 +64,22 @@ uninstall-icons:
 
 install-data-local: install-icons
 install-data-hook: update-icon-cache
-if GCONF_SCHEMAS_INSTALL
-       @if test -z "$(DESTDIR)" ; then \
-               for p in $(schema_DATA) ; do \
-                       GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) 
--makefile-install-rule $$p 2>&1 > /dev/null; \
-               done \
-       fi ||  (echo ;\
-                echo "*****************************************************"; \
-                echo "Installation of schemas failed, install them manually"; \
-                echo "*****************************************************";)
-       @true
-endif
 
 uninstall-local: uninstall-icons
 uninstall-hook: update-icon-cache
 
 CLEANFILES = \
-       $(desktop_DATA) \
-       $(schema_DATA)
+       $(desktop_DATA)
+
+DISTCLEANFILES = \
+       $(desktop_DATA)
 
 EXTRA_DIST = \
-       $(schema_in_files) \
+       $(gsettings_SCHEMAS) \
+       sound-juicer.convert \
        $(man1_MANS) \
        $(icons)
 
+MAINTAINERCLEANFILES = $(gsettings_SCHEMAS:.xml=.valid)
+
 -include $(top_srcdir)/git.mk
diff --git a/data/org.gnome.sound-juicer.gschema.xml b/data/org.gnome.sound-juicer.gschema.xml
new file mode 100644
index 0000000..67c2b72
--- /dev/null
+++ b/data/org.gnome.sound-juicer.gschema.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<schemalist>
+
+  <flags id="org.gnome.sound-juicer.paranoia">
+    <value nick="disable" value="0"/>
+    <value nick="fragment" value="2"/>
+    <value nick="overlap" value="4"/>
+    <value nick="scratch" value="8"/>
+    <value nick="repair" value="16"/>
+  </flags>
+
+  <schema gettext-domain="sound-juicer" id="org.gnome.sound-juicer" path="/org/gnome/sound-juicer/">
+
+    <!-- Please note: There is no default value for the 'device' key
+                      because sound-juicer does not handle symlinks like
+                      e.g. /dev/cdrom -->
+    <key name="device" type="s">
+      <default>''</default>
+      <summary>The CD to extract from.</summary>
+      <description>Please note: sound-juicer currently only handles real device names, no symlinks like e.g. 
/dev/cdrom. An empty key implicates that the system's default cdrom drive will be used.</description>
+    </key>
+
+    <key name="eject" type="b">
+      <default>false</default>
+      <summary>Whether to eject the CD when finished extracting.</summary>
+    </key>
+
+    <key name="open-completed" type="b">
+      <default>false</default>
+      <summary>Whether to open the target directory when finished extracting.</summary>
+    </key>
+
+    <key name="base-uri" type="s">
+      <default>''</default>
+      <summary>The URI to save the extracted music to.</summary>
+    </key>
+
+    <key name="path-pattern" type="s">
+      <default>'%aa/%at'</default>
+      <summary>The directory structure for the files</summary>
+      <description>Format specifiers: %at - album title; %aT - album title (lowercase); %aa - album artist; 
%aA - album artist (lowercase); %as - album artist (sortable); %aS - album artist (sortable lowercase); %ac - 
album composer; %aC - album composer (lowercase); %ap - album composer (sortable); %aP - album composer 
(sortable lowercase); %ay - album year; %tt - track title; %tT - track title (lowercase); %ta - track artist; 
%tA - track artist (lowercase); %ts - track artist (sortable); %tS - track artist (sortable lowercase); %tc - 
track composer; %tC - track composer (lowercase); %tp - track composer (sortable); %tP - track composer 
(sortable lowercase)</description>
+    </key>
+
+    <key name="file-pattern" type="s">
+      <default>'%dn - %tt'</default>
+      <summary>The name pattern for files</summary>
+      <description>Do not specify an extension. Format specifiers: %at - album title; %aT - album title 
(lowercase); %aa - album artist; %aA - album artist (lowercase); %as - album artist (sortable); %aS - album 
artist (sortable lowercase); %ac - album composer; %aC - album composer (lowercase); %ap - album composer 
(sortable); %aP - album composer (sortable lowercase); %tn - track number (i.e 8); %tN - track number, zero 
padded (i.e 08); %tt - track title; %tT - track title (lowercase); %ta - track artist; %tA - track artist 
(lowercase); %ts - track artist (sortable); %tS - track artist (sortable lowercase); %tc - track composer; 
%tC - track composer (lowercase); %tp - track composer (sortable); %tP - track composer (sortable lowercase); 
%dn - disc and track number (i.e Disk 2 - 6, or 6); %dN - disc number, zero padded (i.e d02t06, or 
06)</description>
+    </key>
+
+    <key name="paranoia" flags="org.gnome.sound-juicer.paranoia">
+      <default>["fragment","overlap","scratch"]</default>
+      <summary>The paranoia mode to use</summary>
+      <description>Paranoia flags: disable; fragment; overlap; scratch; repair</description>
+    </key>
+
+    <key name="strip-special" type="b">
+      <default>false</default>
+      <summary>Whether to strip special characters from filenames</summary>
+      <description>If enabled, special characters such as space, wildcards and backslashes will be removed 
from the output filename.</description>
+    </key>
+
+    <key name="audio-profile" type="s">
+      <default>'audio/x-vorbis'</default>
+      <summary>Media type to encode to</summary>
+      <description>The GStreamer media type to encode to.</description>
+    </key>
+
+    <!-- Please note: The 'volume' key may be deprecated soon -->
+    <key name="volume" type="d">
+      <default>1.0</default>
+      <summary>Audio volume</summary>
+    </key>
+
+  </schema>
+
+</schemalist>
diff --git a/data/sound-juicer.convert b/data/sound-juicer.convert
new file mode 100644
index 0000000..187d939
--- /dev/null
+++ b/data/sound-juicer.convert
@@ -0,0 +1,9 @@
+[org.gnome.sound-juicer]
+audio-profile = /apps/sound-juicer/audio_profile
+base-uri = /apps/sound-juicer/base_uri
+eject = /apps/sound-juicer/eject
+file-pattern = /apps/sound-juicer/file_pattern
+open-completed = /apps/sound-juicer/open_completed
+path-pattern = /apps/sound-juicer/path_pattern
+strip-special = /apps/sound-juicer/strip-special
+volume = /apps/sound-juicer/volume
diff --git a/git.mk b/git.mk
index 5ab41ba..d086a3a 100644
--- a/git.mk
+++ b/git.mk
@@ -105,6 +105,11 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
                                "*/*.omf.out" \
                        ; do echo /$$x; done; \
                fi; \
+               if test "x$(gsettings_SCHEMAS)" = x; then :; else \
+                       for x in \
+                               $(gsettings_SCHEMAS:.xml=.valid) \
+                       ; do echo /$$x; done; \
+               fi; \
                if test -f $(srcdir)/po/Makefile.in.in; then \
                        for x in \
                                po/Makefile.in.in \
diff --git a/libjuicer/sj-metadata-getter.c b/libjuicer/sj-metadata-getter.c
index aa8d182..b4a3388 100644
--- a/libjuicer/sj-metadata-getter.c
+++ b/libjuicer/sj-metadata-getter.c
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include <gio/gio.h>
 #include <glib-object.h>
 #include <glib/gi18n.h>
 #include "sj-structures.h"
@@ -30,6 +31,12 @@
 #include "sj-metadata-gvfs.h"
 #include "sj-error.h"
 
+#define SJ_SETTINGS_PROXY_HOST "host"
+#define SJ_SETTINGS_PROXY_PORT "port"
+#define SJ_SETTINGS_PROXY_USE_AUTHENTICATION "use-authentication"
+#define SJ_SETTINGS_PROXY_USERNAME "authentication-user"
+#define SJ_SETTINGS_PROXY_PASSWORD "authentication-password"
+
 enum {
   METADATA,
   LAST_SIGNAL
@@ -38,8 +45,6 @@ enum {
 struct SjMetadataGetterPrivate {
   char *url;
   char *cdrom;
-  char *proxy_host;
-  int proxy_port;
 };
 
 struct SjMetadataGetterSignal {
@@ -89,7 +94,6 @@ sj_metadata_getter_finalize (GObject *object)
 
   g_free (priv->url);
   g_free (priv->cdrom);
-  g_free (priv->proxy_host);
 
   G_OBJECT_CLASS (sj_metadata_getter_parent_class)->finalize (object);
 }
@@ -123,26 +127,41 @@ sj_metadata_getter_set_cdrom (SjMetadataGetter *mdg, const char* device)
   priv->cdrom = g_strdup (device);
 }
 
-void
-sj_metadata_getter_set_proxy (SjMetadataGetter *mdg, const char* proxy)
-{
-  SjMetadataGetterPrivate *priv;
-
-  priv = GETTER_PRIVATE (mdg);
-
-  if (priv->proxy_host)
-    g_free (priv->proxy_host);
-  priv->proxy_host = g_strdup (proxy);
-}
-
-void
-sj_metadata_getter_set_proxy_port (SjMetadataGetter *mdg, const int proxy_port)
+static void
+bind_http_proxy_settings (SjMetadata *metadata)
 {
-  SjMetadataGetterPrivate *priv;
-
-  priv = GETTER_PRIVATE (mdg);
-
-  priv->proxy_port = proxy_port;
+  GSettings *settings = g_settings_new ("org.gnome.system.proxy.http");
+  /* bind with G_SETTINGS_BIND_GET_NO_CHANGES to avoid occasional
+     segfaults in g_object_set_property called with an invalid pointer
+     which I think were caused by the update being scheduled before
+     metadata was destroy but happening afterwards (g_settings_bind is
+     not called from the main thread). metadata is a short lived
+     object so there shouldn't be a problem in practice, as the setting
+     are unlikely to change while it exists. If the settings change
+     between ripping one CD and the next then as a new metadata object
+     is created for the second query it will have the updated
+     settings. */
+  g_settings_bind (settings, SJ_SETTINGS_PROXY_HOST,
+                   metadata, "proxy-host",
+                   G_SETTINGS_BIND_GET_NO_CHANGES);
+
+  g_settings_bind (settings, SJ_SETTINGS_PROXY_PORT,
+                   metadata, "proxy-port",
+                   G_SETTINGS_BIND_GET_NO_CHANGES);
+
+  g_settings_bind (settings, SJ_SETTINGS_PROXY_USERNAME,
+                   metadata, "proxy-username",
+                   G_SETTINGS_BIND_GET_NO_CHANGES);
+
+  g_settings_bind (settings, SJ_SETTINGS_PROXY_PASSWORD,
+                   metadata, "proxy-password",
+                   G_SETTINGS_BIND_GET_NO_CHANGES);
+
+  g_settings_bind (settings, SJ_SETTINGS_PROXY_USE_AUTHENTICATION,
+                   metadata, "proxy-use-authentication",
+                   G_SETTINGS_BIND_GET_NO_CHANGES);
+
+  g_object_unref (settings);
 }
 
 static gboolean
@@ -186,10 +205,9 @@ lookup_cd (SjMetadataGetter *mdg)
     GList *albums;
 
     metadata = g_object_new (types[i],
-                            "device", priv->cdrom,
-                            "proxy-host", priv->proxy_host,
-                            "proxy-port", priv->proxy_port,
-                            NULL);
+                             "device", priv->cdrom,
+                             NULL);
+    bind_http_proxy_settings (metadata);
     if (priv->url == NULL)
       albums = sj_metadata_list_albums (metadata, &priv->url, &error);
     else
@@ -245,4 +263,3 @@ sj_metadata_getter_get_submit_url (SjMetadataGetter *mdg)
     return g_strdup (priv->url);
   return NULL;
 }
-
diff --git a/libjuicer/sj-metadata-getter.h b/libjuicer/sj-metadata-getter.h
index 8002fcf..a732bc6 100644
--- a/libjuicer/sj-metadata-getter.h
+++ b/libjuicer/sj-metadata-getter.h
@@ -50,8 +50,6 @@ struct _SjMetadataGetterClass
 GType sj_metadata_getter_get_type (void);
 SjMetadataGetter *sj_metadata_getter_new (void);
 void sj_metadata_getter_set_cdrom (SjMetadataGetter *mdg, const char* device);
-void sj_metadata_getter_set_proxy (SjMetadataGetter *mdg, const char* proxy);
-void sj_metadata_getter_set_proxy_port (SjMetadataGetter *mdg, const int proxy_port);
 gboolean sj_metadata_getter_list_albums (SjMetadataGetter *mdg, GError **error);
 char *sj_metadata_getter_get_submit_url (SjMetadataGetter *mdg);
 
diff --git a/libjuicer/sj-metadata-gvfs.c b/libjuicer/sj-metadata-gvfs.c
index a743083..d2e2aa7 100644
--- a/libjuicer/sj-metadata-gvfs.c
+++ b/libjuicer/sj-metadata-gvfs.c
@@ -41,8 +41,11 @@ struct SjMetadataGvfsPrivate {
 enum {
   PROP_0,
   PROP_DEVICE,
+  PROP_PROXY_USE_AUTHENTICATION,
   PROP_PROXY_HOST,
   PROP_PROXY_PORT,
+  PROP_PROXY_USERNAME,
+  PROP_PROXY_PASSWORD
 };
 
 static void metadata_iface_init (gpointer g_iface, gpointer iface_data);
@@ -176,7 +179,13 @@ sj_metadata_gvfs_get_property (GObject *object, guint property_id,
   case PROP_DEVICE:
     g_value_set_string (value, priv->cdrom);
     break;
+  case PROP_PROXY_USE_AUTHENTICATION:
+    /* Do nothing */
+    g_value_set_boolean (value, FALSE);
+    break;
   case PROP_PROXY_HOST:
+  case PROP_PROXY_USERNAME:
+  case PROP_PROXY_PASSWORD:
     /* Do nothing */
     g_value_set_string (value, "");
     break;
@@ -203,8 +212,11 @@ sj_metadata_gvfs_set_property (GObject *object, guint property_id,
     g_free (priv->uri);
     priv->uri = device_to_cdda_uri (priv->cdrom);
     break;
+  case PROP_PROXY_USE_AUTHENTICATION:
   case PROP_PROXY_HOST:
   case PROP_PROXY_PORT:
+  case PROP_PROXY_USERNAME:
+  case PROP_PROXY_PASSWORD:
     /* Do nothing */
     break;
   default:
@@ -245,9 +257,18 @@ sj_metadata_gvfs_class_init (SjMetadataGvfsClass *class)
   object_class->set_property = sj_metadata_gvfs_set_property;
   object_class->finalize = sj_metadata_gvfs_finalize;
 
-  g_object_class_override_property (object_class, PROP_DEVICE, "device");
-  g_object_class_override_property (object_class, PROP_PROXY_HOST, "proxy-host");
-  g_object_class_override_property (object_class, PROP_PROXY_PORT, "proxy-port");
+  g_object_class_override_property (object_class,
+                                    PROP_DEVICE, "device");
+  g_object_class_override_property (object_class,
+                                    PROP_PROXY_USE_AUTHENTICATION, "proxy-use-authentication");
+  g_object_class_override_property (object_class,
+                                    PROP_PROXY_HOST, "proxy-host");
+  g_object_class_override_property (object_class,
+                                    PROP_PROXY_PORT, "proxy-port");
+  g_object_class_override_property (object_class,
+                                    PROP_PROXY_USERNAME, "proxy-username");
+  g_object_class_override_property (object_class,
+                                    PROP_PROXY_PASSWORD, "proxy-password");
 }
 
 
diff --git a/libjuicer/sj-metadata-musicbrainz5.c b/libjuicer/sj-metadata-musicbrainz5.c
index e7d1179..038fdcf 100644
--- a/libjuicer/sj-metadata-musicbrainz5.c
+++ b/libjuicer/sj-metadata-musicbrainz5.c
@@ -26,7 +26,6 @@
 #include <stdlib.h>
 #include <glib.h>
 #include <glib-object.h>
-#include <gconf/gconf-client.h>
 #include <discid/discid.h>
 #include <musicbrainz5/mb5_c.h>
 
@@ -48,22 +47,18 @@
 #define discid_read_sparse(disc, dev, i) discid_read(disc, dev)
 #endif
 
-#define GCONF_MUSICBRAINZ_SERVER "/apps/sound-juicer/musicbrainz_server"
-#define GCONF_PROXY_USE_PROXY "/system/http_proxy/use_http_proxy"
-#define GCONF_PROXY_HOST "/system/http_proxy/host"
-#define GCONF_PROXY_PORT "/system/http_proxy/port"
-#define GCONF_PROXY_USE_AUTHENTICATION "/system/http_proxy/use_authentication"
-#define GCONF_PROXY_USERNAME "/system/http_proxy/authentication_user"
-#define GCONF_PROXY_PASSWORD "/system/http_proxy/authentication_password"
 #define SJ_MUSICBRAINZ_USER_AGENT "libjuicer-"VERSION
 
 typedef struct {
   Mb5Query mb;
-  DiscId *disc;
-  char *cdrom;
+  DiscId  *disc;
+  char    *cdrom;
   /* Proxy */
-  char *http_proxy;
-  int http_proxy_port;
+  char    *proxy_host;
+  char    *proxy_username;
+  char    *proxy_password;
+  int      proxy_port;
+  gboolean proxy_use_authentication;
 } SjMetadataMusicbrainz5Private;
 
 #define GET_PRIVATE(o)  \
@@ -72,9 +67,11 @@ typedef struct {
 enum {
   PROP_0,
   PROP_DEVICE,
-  PROP_USE_PROXY,
+  PROP_PROXY_USE_AUTHENTICATION,
   PROP_PROXY_HOST,
   PROP_PROXY_PORT,
+  PROP_PROXY_USERNAME,
+  PROP_PROXY_PASSWORD
 };
 
 static void metadata_interface_init (gpointer g_iface, gpointer iface_data);
@@ -640,6 +637,28 @@ artist-rels" };
   return albums;
 }
 
+static void
+setup_http_proxy (SjMetadataMusicbrainz5Private *priv)
+{
+  if (priv->proxy_host == NULL || priv->proxy_port == 0) {
+    mb5_query_set_proxyhost (priv->mb, NULL);
+    mb5_query_set_proxyport (priv->mb, 0);
+    mb5_query_set_proxyusername (priv->mb, NULL);
+    mb5_query_set_proxypassword (priv->mb, NULL);
+  } else {
+    mb5_query_set_proxyhost (priv->mb, priv->proxy_host);
+    mb5_query_set_proxyport (priv->mb, priv->proxy_port);
+    if (priv->proxy_use_authentication &&
+        priv->proxy_username != NULL && priv->proxy_password != NULL) {
+      mb5_query_set_proxyusername (priv->mb, priv->proxy_username);
+      mb5_query_set_proxypassword (priv->mb, priv->proxy_password);
+    } else {
+      mb5_query_set_proxyusername (priv->mb, NULL);
+      mb5_query_set_proxypassword (priv->mb, NULL);
+    }
+  }
+}
+
 /*
  * GObject methods
  */
@@ -655,52 +674,10 @@ metadata_interface_init (gpointer g_iface, gpointer iface_data)
 static void
 sj_metadata_musicbrainz5_init (SjMetadataMusicbrainz5 *self)
 {
-  GConfClient *gconf_client;
-  gchar *server_name;
-
   SjMetadataMusicbrainz5Private *priv;
 
   priv = GET_PRIVATE (self);
-
-  gconf_client = gconf_client_get_default ();
-
-  server_name = gconf_client_get_string (gconf_client, GCONF_MUSICBRAINZ_SERVER, NULL);
-
-  if (server_name && (*server_name == '\0')) {
-    g_free (server_name);
-    server_name = NULL;
-  }
-
-  priv->mb = mb5_query_new (SJ_MUSICBRAINZ_USER_AGENT, server_name, 0);
-  g_free (server_name);
-
-
-  /* Set the HTTP proxy */
-  if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_PROXY, NULL)) {
-    char *proxy_host;
-    int port;
-
-    proxy_host = gconf_client_get_string (gconf_client, GCONF_PROXY_HOST, NULL);
-    mb5_query_set_proxyhost (priv->mb, proxy_host);
-    g_free (proxy_host);
-
-    port = gconf_client_get_int (gconf_client, GCONF_PROXY_PORT, NULL);
-    mb5_query_set_proxyport (priv->mb, port);
-
-    if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_AUTHENTICATION, NULL)) {
-      char *username, *password;
-
-      username = gconf_client_get_string (gconf_client, GCONF_PROXY_USERNAME, NULL);
-      mb5_query_set_proxyusername (priv->mb, username);
-      g_free (username);
-
-      password = gconf_client_get_string (gconf_client, GCONF_PROXY_PASSWORD, NULL);
-      mb5_query_set_proxypassword (priv->mb, password);
-      g_free (password);
-    }
-  }
-
-  g_object_unref (gconf_client);
+  priv->mb = mb5_query_new (SJ_MUSICBRAINZ_USER_AGENT, NULL, 0);
 }
 
 static void
@@ -714,11 +691,20 @@ sj_metadata_musicbrainz5_get_property (GObject *object, guint property_id,
   case PROP_DEVICE:
     g_value_set_string (value, priv->cdrom);
     break;
+  case PROP_PROXY_USE_AUTHENTICATION:
+    g_value_set_boolean (value, priv->proxy_use_authentication);
+    break;
   case PROP_PROXY_HOST:
-    g_value_set_string (value, priv->http_proxy);
+    g_value_set_string (value, priv->proxy_host);
     break;
   case PROP_PROXY_PORT:
-    g_value_set_int (value, priv->http_proxy_port);
+    g_value_set_int (value, priv->proxy_port);
+    break;
+  case PROP_PROXY_USERNAME:
+    g_value_set_string (value, priv->proxy_username);
+    break;
+  case PROP_PROXY_PASSWORD:
+    g_value_set_string (value, priv->proxy_password);
     break;
   default:
     G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -738,17 +724,28 @@ sj_metadata_musicbrainz5_set_property (GObject *object, guint property_id,
       g_free (priv->cdrom);
     priv->cdrom = g_value_dup_string (value);
     break;
+  case PROP_PROXY_USE_AUTHENTICATION:
+    priv->proxy_use_authentication = g_value_get_boolean (value);
+    setup_http_proxy (priv);
+    break;
   case PROP_PROXY_HOST:
-    if (priv->http_proxy) {
-      g_free (priv->http_proxy);
-    }
-    priv->http_proxy = g_value_dup_string (value);
-    /* TODO: check this unsets the proxy if NULL, or should we pass "" ? */
-    mb5_query_set_proxyhost (priv->mb, priv->http_proxy);
+    g_free (priv->proxy_host);
+    priv->proxy_host = g_value_dup_string (value);
+    setup_http_proxy (priv);
     break;
   case PROP_PROXY_PORT:
-    priv->http_proxy_port = g_value_get_int (value);
-    mb5_query_set_proxyport (priv->mb, priv->http_proxy_port);
+    priv->proxy_port = g_value_get_int (value);
+    setup_http_proxy (priv);
+    break;
+  case PROP_PROXY_USERNAME:
+    g_free (priv->proxy_username);
+    priv->proxy_username = g_value_dup_string (value);
+    setup_http_proxy (priv);
+    break;
+  case PROP_PROXY_PASSWORD:
+    g_free (priv->proxy_password);
+    priv->proxy_password = g_value_dup_string (value);
+    setup_http_proxy (priv);
     break;
   default:
     G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -767,10 +764,13 @@ sj_metadata_musicbrainz5_finalize (GObject *object)
     priv->mb = NULL;
   }
   if (priv->disc != NULL) {
-      discid_free (priv->disc);
-      priv->disc = NULL;
+    discid_free (priv->disc);
+    priv->disc = NULL;
   }
   g_free (priv->cdrom);
+  g_free (priv->proxy_host);
+  g_free (priv->proxy_username);
+  g_free (priv->proxy_password);
 
   G_OBJECT_CLASS (sj_metadata_musicbrainz5_parent_class)->finalize (object);
 }
@@ -786,9 +786,18 @@ sj_metadata_musicbrainz5_class_init (SjMetadataMusicbrainz5Class *class)
   object_class->set_property = sj_metadata_musicbrainz5_set_property;
   object_class->finalize = sj_metadata_musicbrainz5_finalize;
 
-  g_object_class_override_property (object_class, PROP_DEVICE, "device");
-  g_object_class_override_property (object_class, PROP_PROXY_HOST, "proxy-host");
-  g_object_class_override_property (object_class, PROP_PROXY_PORT, "proxy-port");
+  g_object_class_override_property (object_class,
+                                    PROP_DEVICE, "device");
+  g_object_class_override_property (object_class,
+                                    PROP_PROXY_USE_AUTHENTICATION, "proxy-use-authentication");
+  g_object_class_override_property (object_class,
+                                    PROP_PROXY_HOST, "proxy-host");
+  g_object_class_override_property (object_class,
+                                    PROP_PROXY_PORT, "proxy-port");
+  g_object_class_override_property (object_class,
+                                    PROP_PROXY_USERNAME, "proxy-username");
+  g_object_class_override_property (object_class,
+                                    PROP_PROXY_PASSWORD, "proxy-password");
 }
 
 
diff --git a/libjuicer/sj-metadata.c b/libjuicer/sj-metadata.c
index 00fc75e..a24df0e 100644
--- a/libjuicer/sj-metadata.c
+++ b/libjuicer/sj-metadata.c
@@ -51,6 +51,11 @@ sj_metadata_base_init (gpointer g_iface)
                                                               
G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
 
     g_object_interface_install_property (g_iface,
+                                         g_param_spec_boolean ("proxy-use-authentication", 
"proxy-use-authentication",
+                                                               "Whether the http proxy requires 
authentication", FALSE,
+                                                               G_PARAM_READABLE|G_PARAM_WRITABLE|
+                                                               
G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
+    g_object_interface_install_property (g_iface,
                                          g_param_spec_string ("proxy-host", "proxy-host", NULL, NULL,
                                                               G_PARAM_READABLE|G_PARAM_WRITABLE|
                                                               
G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
@@ -61,6 +66,16 @@ sj_metadata_base_init (gpointer g_iface)
                                                            G_PARAM_READABLE|G_PARAM_WRITABLE|
                                                            
G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
 
+    g_object_interface_install_property (g_iface,
+                                         g_param_spec_string ("proxy-username", "proxy-username", NULL, NULL,
+                                                              G_PARAM_READABLE|G_PARAM_WRITABLE|
+                                                              
G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
+
+    g_object_interface_install_property (g_iface,
+                                         g_param_spec_string ("proxy-password", "proxy-password", NULL, NULL,
+                                                              G_PARAM_READABLE|G_PARAM_WRITABLE|
+                                                              
G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
+
     initialized = TRUE;
   }
 }
@@ -95,18 +110,6 @@ sj_metadata_set_cdrom (SjMetadata *metadata, const char* device)
   g_object_set (metadata, "device", device, NULL);
 }
 
-void
-sj_metadata_set_proxy (SjMetadata *metadata, const char* proxy)
-{
-  g_object_set (metadata, "proxy-host", proxy, NULL);
-}
-
-void
-sj_metadata_set_proxy_port (SjMetadata *metadata, const int proxy_port)
-{
-  g_object_set (metadata, "proxy-port", proxy_port, NULL);
-}
-
 GList *
 sj_metadata_list_albums (SjMetadata *metadata, char **url, GError **error)
 {
diff --git a/libjuicer/sj-metadata.h b/libjuicer/sj-metadata.h
index 7ed0e01..5b79dd6 100644
--- a/libjuicer/sj-metadata.h
+++ b/libjuicer/sj-metadata.h
@@ -44,8 +44,6 @@ struct _SjMetadataClass
 
 GType sj_metadata_get_type (void);
 void sj_metadata_set_cdrom (SjMetadata *metadata, const char* device);
-void sj_metadata_set_proxy (SjMetadata *metadata, const char* proxy);
-void sj_metadata_set_proxy_port (SjMetadata *metadata, const int proxy_port);
 GList * sj_metadata_list_albums (SjMetadata *metadata, char **url, GError **error);
 
 char * sj_metadata_helper_scan_disc_number (const char *album_title, int *disc_number);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 6f59d83..4312b44 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,8 +1,8 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
 [encoding: UTF-8]
+[type: gettext/gsettings]data/org.gnome.sound-juicer.gschema.xml
 data/sound-juicer.desktop.in.in
-data/sound-juicer.schemas.in
 [type: gettext/glade]data/sound-juicer.ui
 [type: gettext/glade]data/sound-juicer-menu.ui
 libjuicer/sj-error.c
@@ -13,7 +13,6 @@ libjuicer/sj-metadata-gvfs.c
 libjuicer/sj-structures.c
 libjuicer/sj-util.c
 src/egg-play-preview.c
-src/gconf-bridge.c
 src/sj-about.c
 src/sj-extracting.c
 src/sj-genres.c
diff --git a/sound-juicer.spec.in b/sound-juicer.spec.in
index 4c3e4ff..d2f7420 100644
--- a/sound-juicer.spec.in
+++ b/sound-juicer.spec.in
@@ -10,13 +10,11 @@ Requires:   libmusicbrainz >= 2.0.1
 Requires:      libgnomeui >= 2.0.0
 Requires:      glib2 >= 2.0.0
 Requires:      gstreamer >= 0.8.0
-Requires:      GConf2 >= 2.0.0
 Requires:      gstreamer-plugins-base >= 0.7.2
 BuildRequires: libmusicbrainz-devel >= 2.0.1
 BuildRequires: libgnomeui-devel >= 2.0.0
 BuildRequires: glib2-devel >= 2.0.0
 BuildRequires: gstreamer-devel >= 0.8.0
-BuildRequires: GConf2-devel >= 2.0.0
 BuildRequires:  scrollkeeper >= @SCROLLKEEPER_BUILD_REQUIRED@
 
 %description
@@ -31,9 +29,7 @@ GStreamer-based CD ripping tool. Saves audio CDs to Ogg Vorbis or FLAC.
 
 make
 
-export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1;
 %makeinstall
-unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
 
 # Clean out bad files
 rm -rf $RPM_BUILD_ROOT%{_localstatedir}/scrollkeeper
@@ -45,19 +41,10 @@ rm -rf $RPM_BUILD_ROOT/usr/share/icons/hicolor/icon-theme.cache
 %clean
 [ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
 
-%preun
-export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` 
-gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/sound-juicer.schemas > /dev/null
-
-%post
-export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` 
-gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/sound-juicer.schemas > /dev/null
-
 %files -f sound-juicer.lang
 %defattr(-, root, root)
 %doc AUTHORS COPYING ChangeLog INSTALL README NEWS
 %{_bindir}/sound-juicer
-%{_sysconfdir}/gconf/schemas/sound-juicer.schemas
 %{_datadir}/sound-juicer
 %{_datadir}/applications/sound-juicer.desktop
 %{_datadir}/icons/hicolor/16x16
diff --git a/src/Makefile.am b/src/Makefile.am
index dbb1734..37b2d9c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,8 +16,6 @@ sound_juicer_SOURCES = \
        sj-inhibit.c \
        sj-genres.h \
        sj-genres.c \
-       gconf-bridge.h \
-       gconf-bridge.c \
        egg-play-preview.c \
        egg-play-preview.h
 
diff --git a/src/sj-main.c b/src/sj-main.c
index 17b4ff5..f498065 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -34,13 +34,11 @@
 #include <gdk/gdkkeysyms.h>
 #include <gio/gio.h>
 #include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
 #include <brasero-medium-selection.h>
 #include <brasero-volume.h>
 #include <gst/gst.h>
 #include <gst/pbutils/encoding-profile.h>
 
-#include "gconf-bridge.h"
 #include "rb-gst-media-types.h"
 #include "sj-about.h"
 #include "sj-metadata.h"
@@ -70,7 +68,7 @@ GtkBuilder *builder;
 SjMetadataGetter *metadata;
 SjExtractor *extractor;
 
-GConfClient *gconf_client;
+GSettings *sj_settings;
 
 GtkWidget *main_window;
 static GtkWidget *message_area_eventbox;
@@ -103,7 +101,7 @@ static char *device = NULL, **uris = NULL;
 
 static guint debug_flags = 0;
 
-#define DEFAULT_PARANOIA 4
+#define DEFAULT_PARANOIA 15
 #define RAISE_WINDOW "raise-window"
 #define SOURCE_BUILDER "../data/sound-juicer.ui"
 #define INSTALLED_BUILDER DATADIR"/sound-juicer/sound-juicer.ui"
@@ -1069,128 +1067,113 @@ AlbumDetails* multiple_album_dialog(GList *albums)
 }
 
 /**
- * The GConf key for the base path changed
+ * The GSettings key for the base path changed
  */
-static void baseuri_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+static void baseuri_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
-  g_assert (strcmp (entry->key, GCONF_BASEURI) == 0);
+  gchar *value;
+  g_assert (strcmp (key, SJ_SETTINGS_BASEURI) == 0);
   if (base_uri) {
     g_object_unref (base_uri);
   }
-  if (entry->value == NULL) {
+  value = g_settings_get_string (settings, key);
+  if (sj_str_is_empty (value)) {
     base_uri = sj_get_default_music_directory ();
   } else {
-    base_uri = g_file_new_for_uri (gconf_value_get_string (entry->value));
+    GFileType file_type;
+    base_uri = g_file_new_for_uri (value);
+    file_type = g_file_query_file_type (base_uri, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL);
+    if (file_type != G_FILE_TYPE_DIRECTORY) {
+      g_object_unref (base_uri);
+      base_uri = sj_get_default_music_directory ();
+    }
   }
-  /* TODO: sanity check the URI somewhat */
+  g_free (value);
 }
 
 /**
- * The GConf key for the directory pattern changed
+ * The GSettings key for the directory pattern changed
  */
-static void path_pattern_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer 
user_data)
+static void path_pattern_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
-  g_assert (strcmp (entry->key, GCONF_PATH_PATTERN) == 0);
-
-  if (path_pattern)
+  g_assert (strcmp (key, SJ_SETTINGS_PATH_PATTERN) == 0);
+  g_free (path_pattern);
+  path_pattern = g_settings_get_string (settings, key);
+  if (sj_str_is_empty (path_pattern)) {
     g_free (path_pattern);
-
-  if (entry->value == NULL) {
-    /* TODO: this value and the value in sj-prefs need to be in one place */
-    path_pattern = g_strdup ("%aa/%at");
-  } else {
-    path_pattern = g_strdup (gconf_value_get_string (entry->value));
+    path_pattern = g_strdup (sj_get_default_path_pattern ());
   }
   /* TODO: sanity check the pattern */
 }
 
 /**
- * The GConf key for the filename pattern changed
+ * The GSettings key for the filename pattern changed
  */
-static void file_pattern_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer 
user_data)
+static void file_pattern_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
-  g_assert (strcmp (entry->key, GCONF_FILE_PATTERN) == 0);
-
-  if (file_pattern)
+  g_assert (strcmp (key, SJ_SETTINGS_FILE_PATTERN) == 0);
+  g_free (file_pattern);
+  file_pattern = g_settings_get_string (settings, key);
+  if (sj_str_is_empty (file_pattern)) {
     g_free (file_pattern);
-
-  if (entry->value == NULL) {
-    /* TODO: this value and the value in sj-prefs need to be in one place */
-    file_pattern = g_strdup ("%tN-%tt");
-  } else {
-    file_pattern = g_strdup (gconf_value_get_string (entry->value));
+    file_pattern = g_strdup (sj_get_default_file_pattern ());
   }
   /* TODO: sanity check the pattern */
 }
 
 /**
- * The GConf key for the paranoia mode has changed
+ * The GSettings key for the paranoia mode has changed
  */
-static void paranoia_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+static void paranoia_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
-  g_assert (strcmp (entry->key, GCONF_PARANOIA) == 0);
-  if (entry->value == NULL) {
-    sj_extractor_set_paranoia (extractor, DEFAULT_PARANOIA);
-  } else {
-    int value = gconf_value_get_int (entry->value);
-    if (value == 0 || value == 2 || value == 4 || value == 8 || value == 16 || value == 255) {
+  int value;
+  g_assert (strcmp (key, SJ_SETTINGS_PARANOIA) == 0);
+  value = g_settings_get_flags (settings, key);
+  if (value >= 0) {
+    if (value < 32) {
       sj_extractor_set_paranoia (extractor, value);
+    } else {
+      sj_extractor_set_paranoia (extractor, DEFAULT_PARANOIA);
     }
   }
 }
 
 /**
- * The GConf key for the strip characters option changed
+ * The GSettings key for the strip characters option changed
  */
-static void strip_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+static void strip_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
-  g_assert (strcmp (entry->key, GCONF_STRIP) == 0);
-  if (entry->value == NULL) {
-    strip_chars = FALSE;
-  } else {
-    strip_chars = gconf_value_get_bool (entry->value);
-  }
+  g_assert (strcmp (key, SJ_SETTINGS_STRIP) == 0);
+  strip_chars = g_settings_get_boolean (settings, key);
 }
 
 /**
- * The GConf key for the eject when finished option changed
+ * The GSettings key for the eject when finished option changed
  */
-static void eject_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+static void eject_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
-  g_assert (strcmp (entry->key, GCONF_EJECT) == 0);
-  if (entry->value == NULL) {
-    eject_finished = FALSE;
-  } else {
-    eject_finished = gconf_value_get_bool (entry->value);
-  }
+  g_assert (strcmp (key, SJ_SETTINGS_EJECT) == 0);
+  eject_finished = g_settings_get_boolean (settings, key);
 }
 
 /**
- * The GConf key for the open when finished option changed
+ * The GSettings key for the open when finished option changed
  */
-static void open_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+static void open_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
-  g_assert (strcmp (entry->key, GCONF_OPEN) == 0);
-  if (entry->value == NULL) {
-    open_finished = FALSE;
-  } else {
-    open_finished = gconf_value_get_bool (entry->value);
-  }
+  g_assert (strcmp (key, SJ_SETTINGS_OPEN) == 0);
+  open_finished = g_settings_get_boolean (settings, key);
 }
 
 /**
- * The GConf key for audio volume changes
+ * The GSettings key for audio volume changes
  */
-static void audio_volume_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer 
user_data)
+static void audio_volume_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
-  g_assert (strcmp (entry->key, GCONF_AUDIO_VOLUME) == 0);
+  g_assert (strcmp (key, SJ_SETTINGS_AUDIO_VOLUME) == 0);
 
   GtkWidget *volb = GET_WIDGET ("volume_button");
-  if (entry->value == NULL) {
-    gtk_scale_button_set_value (GTK_SCALE_BUTTON (volb), 1.0);
-  } else {
-    gtk_scale_button_set_value (GTK_SCALE_BUTTON (volb), gconf_value_get_float (entry->value));
-  }
+  gtk_scale_button_set_value (GTK_SCALE_BUTTON (volb), g_settings_get_double (settings, key));
 }
 
 static void
@@ -1505,15 +1488,17 @@ prefs_get_default_device (void)
 }
 
 /**
- * The GConf key for the device changed
+ * The GSettings key for the device changed
  */
-static void device_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+static void device_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
   const char *device;
+  char *value;
   gboolean ignore_no_media = GPOINTER_TO_INT (user_data);
-  g_assert (strcmp (entry->key, GCONF_DEVICE) == 0);
+  g_assert (strcmp (key, SJ_SETTINGS_DEVICE) == 0);
 
-  if (entry->value == NULL || !cd_drive_exists (gconf_value_get_string (entry->value))) {
+  value = g_settings_get_string (settings, key);
+  if (!cd_drive_exists (value)) {
     device = prefs_get_default_device();
     if (device == NULL) {
 #ifndef IGNORE_MISSING_CD
@@ -1531,20 +1516,21 @@ static void device_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *e
 #endif
     }
   } else {
-    device = gconf_value_get_string (entry->value);
+    device = value;
   }
   set_device (device, ignore_no_media);
+  g_free (value);
 }
 
-static void profile_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+static void profile_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
   GstEncodingProfile *profile;
-  const char *media_type;
+  char *media_type;
 
-  g_assert (strcmp (entry->key, GCONF_AUDIO_PROFILE_MEDIA_TYPE) == 0);
-  if (!entry->value) return;
-  media_type = gconf_value_get_string (entry->value);
+  g_assert (strcmp (key, SJ_SETTINGS_AUDIO_PROFILE) == 0);
+  media_type = g_settings_get_string (settings, key);
   profile = rb_gst_get_encoding_profile (media_type);
+  g_free (media_type);
   if (profile != NULL)
     g_object_set (extractor, "profile", profile, NULL);
 
@@ -1574,56 +1560,6 @@ static void profile_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *
 }
 
 /**
- * Configure the http proxy
- */
-static void
-http_proxy_setup (GConfClient *client)
-{
-  if (!gconf_client_get_bool (client, GCONF_HTTP_PROXY_ENABLE, NULL)) {
-    sj_metadata_getter_set_proxy (metadata, NULL);
-  } else {
-    char *host;
-    int port;
-
-    host = gconf_client_get_string (client, GCONF_HTTP_PROXY, NULL);
-    sj_metadata_getter_set_proxy (metadata, host);
-    g_free (host);
-    port = gconf_client_get_int (client, GCONF_HTTP_PROXY_PORT, NULL);
-    sj_metadata_getter_set_proxy_port (metadata, port);
-  }
-}
-
-/**
- * The GConf key for the HTTP proxy being enabled changed.
- */
-static void http_proxy_enable_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer 
user_data)
-{
-  g_assert (strcmp (entry->key, GCONF_HTTP_PROXY_ENABLE) == 0);
-  if (entry->value == NULL) return;
-  http_proxy_setup (client);
-}
-
-/**
- * The GConf key for the HTTP proxy changed.
- */
-static void http_proxy_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
-{
-  g_assert (strcmp (entry->key, GCONF_HTTP_PROXY) == 0);
-  if (entry->value == NULL) return;
-  http_proxy_setup (client);
-}
-
-/**
- * The GConf key for the HTTP proxy port changed.
- */
-static void http_proxy_port_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer 
user_data)
-{
-  g_assert (strcmp (entry->key, GCONF_HTTP_PROXY_PORT) == 0);
-  if (entry->value == NULL) return;
-  http_proxy_setup (client);
-}
-
-/**
  * Clicked on Reread in the UI (button/menu)
  */
 static void on_reread_activate (GSimpleAction *action, GVariant *parameter, gpointer data)
@@ -1952,28 +1888,6 @@ static void on_contents_activate(GSimpleAction *action, GVariant *parameter, gpo
   }
 }
 
-static void
-upgrade_gconf (void)
-{
-  char *s;
-  s = gconf_client_get_string (gconf_client, GCONF_BASEURI, NULL);
-  if (s != NULL) {
-    g_free (s);
-  } else {
-    GFile *gfile;
-    char *uri;
-    s = gconf_client_get_string (gconf_client, GCONF_BASEPATH, NULL);
-    if (s == NULL)
-      return;
-    gfile = g_file_new_for_path (s);
-    uri = g_file_get_uri (gfile);
-    g_free (s);
-    g_object_unref (gfile);
-    gconf_client_set_string (gconf_client, GCONF_BASEURI, uri, NULL);
-    g_free (uri);
-  }
-}
-
 /**
  * Performs various checks to ensure CD duplication is available.
  * If this is found TRUE is returned, otherwise FALSE is returned.
@@ -2049,29 +1963,28 @@ startup_cb (GApplication *app, gpointer user_data)
   metadata = sj_metadata_getter_new ();
   g_signal_connect (metadata, "metadata", G_CALLBACK (metadata_cb), NULL);
 
-  gconf_client = gconf_client_get_default ();
-  if (gconf_client == NULL) {
-    g_warning (_("Could not create GConf client.\n"));
-    exit (1);
-  }
-
-  upgrade_gconf ();
-
-  gconf_client_add_dir (gconf_client, GCONF_ROOT, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_DEVICE, device_changed_cb, NULL, NULL, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_EJECT, eject_changed_cb, NULL, NULL, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_OPEN, open_changed_cb, NULL, NULL, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_BASEURI, baseuri_changed_cb, NULL, NULL, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_STRIP, strip_changed_cb, NULL, NULL, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_AUDIO_PROFILE_MEDIA_TYPE, profile_changed_cb, NULL, NULL, 
NULL);
-  gconf_client_notify_add (gconf_client, GCONF_PARANOIA, paranoia_changed_cb, NULL, NULL, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_PATH_PATTERN, path_pattern_changed_cb, NULL, NULL, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_FILE_PATTERN, file_pattern_changed_cb, NULL, NULL, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_AUDIO_VOLUME, audio_volume_changed_cb, NULL, NULL, NULL);
-  gconf_client_add_dir (gconf_client, GCONF_PROXY_ROOT, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_HTTP_PROXY_ENABLE, http_proxy_enable_changed_cb, NULL, NULL, 
NULL);
-  gconf_client_notify_add (gconf_client, GCONF_HTTP_PROXY, http_proxy_changed_cb, NULL, NULL, NULL);
-  gconf_client_notify_add (gconf_client, GCONF_HTTP_PROXY_PORT, http_proxy_port_changed_cb, NULL, NULL, 
NULL);
+  sj_settings = g_settings_new ("org.gnome.sound-juicer");
+
+  g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_DEVICE,
+                    (GCallback)device_changed_cb, NULL);
+  g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_EJECT,
+                    (GCallback)eject_changed_cb, NULL);
+  g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_OPEN,
+                    (GCallback)open_changed_cb, NULL);
+  g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_BASEURI,
+                    (GCallback)baseuri_changed_cb, NULL);
+  g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_STRIP,
+                    (GCallback)strip_changed_cb, NULL);
+  g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_AUDIO_PROFILE,
+                    (GCallback)profile_changed_cb, NULL);
+  g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_PARANOIA,
+                    (GCallback)paranoia_changed_cb, NULL);
+  g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_PATH_PATTERN,
+                    (GCallback)path_pattern_changed_cb, NULL);
+  g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_FILE_PATTERN,
+                    (GCallback)file_pattern_changed_cb, NULL);
+  g_signal_connect (sj_settings, "changed::"SJ_SETTINGS_AUDIO_VOLUME,
+                    (GCallback)audio_volume_changed_cb, NULL);
 
   g_action_map_add_action_entries (G_ACTION_MAP (app),
                                    app_entries, G_N_ELEMENTS (app_entries),
@@ -2298,80 +2211,39 @@ startup_cb (GApplication *app, gpointer user_data)
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (track_listview));
   gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
 
-  {
-    GConfEntry *entry;
-    http_proxy_setup (gconf_client);
-
-    entry = gconf_client_get_entry (gconf_client, GCONF_BASEURI, NULL, TRUE, NULL);
-    baseuri_changed_cb (gconf_client, -1, entry, NULL);
-    gconf_entry_unref (entry);
-
-    entry = gconf_client_get_entry (gconf_client, GCONF_PATH_PATTERN, NULL, TRUE, NULL);
-    path_pattern_changed_cb (gconf_client, -1, entry, NULL);
-    gconf_entry_unref (entry);
-
-    entry = gconf_client_get_entry (gconf_client, GCONF_FILE_PATTERN, NULL, TRUE, NULL);
-    file_pattern_changed_cb (gconf_client, -1, entry, NULL);
-    gconf_entry_unref (entry);
-
-    entry = gconf_client_get_entry (gconf_client, GCONF_AUDIO_PROFILE_MEDIA_TYPE, NULL, TRUE, NULL);
-    profile_changed_cb (gconf_client, -1, entry, NULL);
-    gconf_entry_unref (entry);
-
-    entry = gconf_client_get_entry (gconf_client, GCONF_PARANOIA, NULL, TRUE, NULL);
-    paranoia_changed_cb (gconf_client, -1, entry, NULL);
-    gconf_entry_unref (entry);
-
-    entry = gconf_client_get_entry (gconf_client, GCONF_STRIP, NULL, TRUE, NULL);
-    strip_changed_cb (gconf_client, -1, entry, NULL);
-    gconf_entry_unref (entry);
-
-    entry = gconf_client_get_entry (gconf_client, GCONF_EJECT, NULL, TRUE, NULL);
-    eject_changed_cb (gconf_client, -1, entry, NULL);
-    gconf_entry_unref (entry);
-
-    entry = gconf_client_get_entry (gconf_client, GCONF_OPEN, NULL, TRUE, NULL);
-    open_changed_cb (gconf_client, -1, entry, NULL);
-    gconf_entry_unref (entry);
-
-    entry = gconf_client_get_entry (gconf_client, GCONF_AUDIO_VOLUME, NULL, TRUE, NULL);
-    audio_volume_changed_cb (gconf_client, -1, entry, NULL);
-    gconf_entry_unref (entry);
-
-    if (device == NULL && uris == NULL) {
-      entry = gconf_client_get_entry (gconf_client, GCONF_DEVICE, NULL, TRUE, NULL);
-      device_changed_cb (gconf_client, -1, entry, GINT_TO_POINTER (TRUE));
-      gconf_entry_unref (entry);
-    } else {
-      if (device) {
-#ifdef __sun
-        if (strstr(device, "/dev/dsk/") != NULL ) {
-          device = g_strdup_printf("/dev/rdsk/%s", device + strlen("/dev/dsk/"));
-        }
-#endif
-        set_device (device, TRUE);
+  baseuri_changed_cb (sj_settings, SJ_SETTINGS_BASEURI, NULL);
+  path_pattern_changed_cb (sj_settings, SJ_SETTINGS_PATH_PATTERN, NULL);
+  file_pattern_changed_cb (sj_settings, SJ_SETTINGS_FILE_PATTERN, NULL);
+  profile_changed_cb (sj_settings, SJ_SETTINGS_AUDIO_PROFILE, NULL);
+  paranoia_changed_cb (sj_settings, SJ_SETTINGS_PARANOIA, NULL);
+  strip_changed_cb (sj_settings, SJ_SETTINGS_STRIP, NULL);
+  eject_changed_cb (sj_settings, SJ_SETTINGS_EJECT, NULL);
+  open_changed_cb (sj_settings, SJ_SETTINGS_OPEN, NULL);
+  audio_volume_changed_cb (sj_settings, SJ_SETTINGS_AUDIO_VOLUME, NULL);
+  if (device == NULL && uris == NULL) {
+    /* FIXME: this should set the device gsettings key to a meaningful
+     * value if it's empty (which is the case until the user changes it in
+     * the prefs)
+     */
+    device_changed_cb (sj_settings, SJ_SETTINGS_DEVICE, NULL);
+  } else {
+    if (device)
+      set_device (device, TRUE);
+    else {
+      char *d;
+
+      /* Mash up the CDDA URIs into a device path */
+      if (g_str_has_prefix (uris[0], "cdda://")) {
+        gint len;
+        d = g_strdup_printf ("/dev/%s%c", uris[0] + strlen ("cdda://"), '\0');
+        /* Take last '/' out of path, or set_device thinks it is part of the device name */
+      len = strlen (d);
+      if (d[len - 1] == '/')
+          d [len - 1] = '\0';
+      set_device (d, TRUE);
+      g_free (d);
       } else {
-        char *d;
-
-        /* Mash up the CDDA URIs into a device path */
-        if (g_str_has_prefix (uris[0], "cdda://")) {
-          gint len;
-#ifdef __sun
-          d = g_strdup_printf ("/dev/rdsk/%s", uris[0] + strlen ("cdda://"));
-#else
-          d = g_strdup_printf ("/dev/%s%c", uris[0] + strlen ("cdda://"), '\0');
-#endif
-          /* Take last '/' out of path, or set_device thinks it is part of the device name */
-          len = strlen (d);
-          if (d[len - 1] == '/')
-              d [len - 1] = '\0';
-          set_device (d, TRUE);
-          g_free (d);
-        } else {
-          entry = gconf_client_get_entry (gconf_client, GCONF_DEVICE, NULL, TRUE, NULL);
-          device_changed_cb (gconf_client, -1, entry, GINT_TO_POINTER (TRUE));
-          gconf_entry_unref (entry);
-        }
+        device_changed_cb (sj_settings, SJ_SETTINGS_DEVICE, NULL);
       }
     }
   }
@@ -2385,8 +2257,6 @@ startup_cb (GApplication *app, gpointer user_data)
   set_action_enabled ("duplicate", FALSE);
   duplication_enabled = is_cd_duplication_available();
 
-  gconf_bridge_bind_window_size(gconf_bridge_get(), GCONF_WINDOW, GTK_WINDOW (main_window));
-
   gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (main_window));
   gtk_widget_show (main_window);
 }
@@ -2462,7 +2332,7 @@ int main (int argc, char **argv)
   g_object_unref (base_uri);
   g_object_unref (metadata);
   g_object_unref (extractor);
-  g_object_unref (gconf_client);
+  g_object_unref (sj_settings);
   brasero_media_library_stop ();
 
   return status;
diff --git a/src/sj-play.c b/src/sj-play.c
index d6790a0..d75c63b 100644
--- a/src/sj-play.c
+++ b/src/sj-play.c
@@ -531,7 +531,7 @@ on_volume_changed (GtkWidget * volb, gdouble value, gpointer data)
   vol = value;
   if (pipeline)
     g_object_set (G_OBJECT (pipeline), "volume", vol, NULL);
-  gconf_client_set_float (gconf_client, GCONF_AUDIO_VOLUME, vol, NULL);
+  g_settings_set_double (sj_settings, SJ_SETTINGS_AUDIO_VOLUME, vol);
 }
 
 static gboolean
diff --git a/src/sj-prefs.c b/src/sj-prefs.c
index 48d6da3..9b71ea4 100644
--- a/src/sj-prefs.c
+++ b/src/sj-prefs.c
@@ -28,12 +28,10 @@
 #include <string.h>
 #include <gst/pbutils/encoding-profile.h>
 #include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
 #include <brasero-drive-selection.h>
 
 #include "rb-gst-media-types.h"
 #include "sj-util.h"
-#include "gconf-bridge.h"
 #include "sj-extracting.h"
 #include "sj-prefs.h"
 
@@ -83,6 +81,18 @@ static const FilePattern file_patterns[] = {
   {NULL, NULL}
 };
 
+const gchar*
+sj_get_default_file_pattern (void)
+{
+  return file_patterns[0].pattern;
+}
+
+const gchar*
+sj_get_default_path_pattern (void)
+{
+  return path_patterns[0].pattern;
+}
+
 void prefs_profile_changed (GtkWidget *widget, gpointer user_data)
 {
   GtkTreeIter iter;
@@ -94,8 +104,7 @@ void prefs_profile_changed (GtkWidget *widget, gpointer user_data)
     char *media_type;
     gtk_tree_model_get (GTK_TREE_MODEL (model), &iter,
                         0, &media_type, -1);
-    gconf_client_set_string (gconf_client, GCONF_AUDIO_PROFILE_MEDIA_TYPE,
-                             media_type, NULL);
+    g_settings_set_string (sj_settings, SJ_SETTINGS_AUDIO_PROFILE, media_type);
     g_free (media_type);
   }
 }
@@ -133,11 +142,11 @@ G_MODULE_EXPORT void prefs_base_folder_changed (GtkWidget *chooser, gpointer use
 {
   char *new_uri, *current_uri;
 
-  current_uri = gconf_client_get_string (gconf_client, GCONF_BASEURI, NULL);
+  current_uri = g_settings_get_string (sj_settings, SJ_SETTINGS_BASEURI);
   new_uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (chooser));
 
   if (current_uri == NULL || strcmp(current_uri, new_uri) != 0) {
-      gconf_client_set_string (gconf_client, GCONF_BASEURI, new_uri, NULL);
+      g_settings_set_string (sj_settings, SJ_SETTINGS_BASEURI, new_uri);
   }
 
   g_free (new_uri);
@@ -154,7 +163,7 @@ void prefs_path_option_changed (GtkComboBox *combo, gpointer user_data)
 
   pattern = path_patterns[active].pattern;
   if (pattern) {
-    gconf_client_set_string (gconf_client, GCONF_PATH_PATTERN, pattern, NULL);
+    g_settings_set_string (sj_settings, SJ_SETTINGS_PATH_PATTERN, pattern);
   }
 }
 
@@ -168,7 +177,7 @@ G_MODULE_EXPORT void prefs_file_option_changed (GtkComboBox *combo, gpointer use
 
   pattern = file_patterns[active].pattern;
   if (pattern) {
-    gconf_client_set_string (gconf_client, GCONF_FILE_PATTERN, pattern, NULL);
+    g_settings_set_string (sj_settings, SJ_SETTINGS_FILE_PATTERN, pattern);
   }
 }
 
@@ -199,17 +208,16 @@ sj_audio_profile_chooser_set_active (GtkWidget *chooser, const char *profile)
   }
 }
 
-static void audio_profile_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer 
user_data)
+static void audio_profile_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
-  const char *value;
-  g_return_if_fail (strcmp (entry->key, GCONF_AUDIO_PROFILE_MEDIA_TYPE) == 0);
-  if (!entry->value) return;
-  value = gconf_value_get_string (entry->value);
-
+  char *value;
+  g_return_if_fail (strcmp (key, SJ_SETTINGS_AUDIO_PROFILE) == 0);
+  value = g_settings_get_string (settings, key);
   sj_audio_profile_chooser_set_active (audio_profile, value);
+  g_free (value);
 }
 
-static void baseuri_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+static void baseuri_changed_cb  (GSettings *settings, gchar *key, gpointer user_data)
 {
   /*
    * The conflict between separation of the prefs and the main window,
@@ -219,11 +227,9 @@ static void baseuri_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *
    * into sj-utils?
    */
   const char* base_uri, *current_uri;
-  g_return_if_fail (strcmp (entry->key, GCONF_BASEURI) == 0);
+  g_return_if_fail (strcmp (key, SJ_SETTINGS_BASEURI) == 0);
 
-  base_uri = NULL;
-  if (entry->value != NULL)
-    base_uri = gconf_value_get_string (entry->value);
+  base_uri = g_settings_get_string (settings, key);
 
   if (base_uri == NULL || base_uri[0] == '\0') {
     GFile *dir;
@@ -235,7 +241,6 @@ static void baseuri_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *
     g_free (dir_uri);
     g_object_unref (dir);
   } else {
-    g_return_if_fail (entry->value->type == GCONF_VALUE_STRING);
     current_uri = gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (basepath_fcb));
     if (current_uri == NULL || strcmp (current_uri, base_uri) != 0)
       gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (basepath_fcb), base_uri);
@@ -284,13 +289,13 @@ static void pattern_label_update (void)
   gst_encoding_profile_unref (profile);
 
   /* TODO: sucky. Replace with get-gconf-key-with-default mojo */
-  file_pattern = gconf_client_get_string (gconf_client, GCONF_FILE_PATTERN, NULL);
+  file_pattern = g_settings_get_string (sj_settings, SJ_SETTINGS_FILE_PATTERN);
   if (file_pattern == NULL) {
-    file_pattern = g_strdup(file_patterns[0].pattern);
+    file_pattern = g_strdup (sj_get_default_file_pattern ());
   }
-  path_pattern = gconf_client_get_string (gconf_client, GCONF_PATH_PATTERN, NULL);
+  path_pattern = g_settings_get_string (sj_settings, SJ_SETTINGS_PATH_PATTERN);
   if (path_pattern == NULL) {
-    path_pattern = g_strdup(path_patterns[0].pattern);
+    path_pattern = g_strdup (sj_get_default_path_pattern ());
   }
 
   file_value = filepath_parse_pattern (file_pattern, &sample_track);
@@ -316,18 +321,13 @@ static void pattern_label_update (void)
   g_free (format);
 }
 
-static void path_pattern_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer 
user_data)
+static void path_pattern_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
   char *value;
   int i = 0;
-  g_return_if_fail (strcmp (entry->key, GCONF_PATH_PATTERN) == 0);
+  g_return_if_fail (strcmp (key, SJ_SETTINGS_PATH_PATTERN) == 0);
 
-  if (entry->value == NULL) {
-    value = g_strdup (path_patterns[0].pattern);
-  } else if (entry->value->type == GCONF_VALUE_STRING) {
-    value = g_strdup (gconf_value_get_string (entry->value));
-  } else
-    return;
+  value = g_settings_get_string (settings, key);
   while (path_patterns[i].pattern && strcmp(path_patterns[i].pattern, value) != 0) {
     i++;
   }
@@ -336,19 +336,15 @@ static void path_pattern_changed_cb (GConfClient *client, guint cnxn_id, GConfEn
   pattern_label_update ();
 }
 
-static void file_pattern_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer 
user_data)
+static void file_pattern_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
   char *value;
   int i = 0;
 
-  g_return_if_fail (strcmp (entry->key, GCONF_FILE_PATTERN) == 0);
+  g_return_if_fail (strcmp (key, SJ_SETTINGS_FILE_PATTERN) == 0);
+
+  value = g_settings_get_string (settings, key);
 
-  if (entry->value == NULL) {
-    value = g_strdup (file_patterns[0].pattern);
-  } else if (entry->value->type == GCONF_VALUE_STRING) {
-    value = g_strdup (gconf_value_get_string (entry->value));
-  } else
-    return;
   while (file_patterns[i].pattern && strcmp(file_patterns[i].pattern, value) != 0) {
     i++;
   }
@@ -358,50 +354,51 @@ static void file_pattern_changed_cb (GConfClient *client, guint cnxn_id, GConfEn
 }
 
 /**
- * Default device changed (either GConf key or the widget)
+ * Default device changed (either GSettings key or the widget)
  */
-static void device_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+static void device_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
-  g_return_if_fail (strcmp (entry->key, GCONF_DEVICE) == 0);
-
-  if (entry->value == NULL)
-    return;
+  BraseroDrive *drive;
+  BraseroMediumMonitor *monitor;
+  char *value;
 
-  if (entry->value->type == GCONF_VALUE_STRING) {
-    BraseroDrive *drive;
-    BraseroMediumMonitor *monitor;
+  g_return_if_fail (strcmp (key, SJ_SETTINGS_DEVICE) == 0);
 
+  value = g_settings_get_string (settings, key);
+  if ((value != NULL) && (*value != '\0')) {
     monitor = brasero_medium_monitor_get_default ();
-    drive = brasero_medium_monitor_get_drive (monitor, gconf_value_get_string (entry->value));
+    drive = brasero_medium_monitor_get_drive (monitor, value);
     brasero_drive_selection_set_active (BRASERO_DRIVE_SELECTION (cd_option), drive);
     g_object_unref (drive);
     g_object_unref (monitor);
+  } else {
+    /* FIXME: see the FIXME in sj-main.c around one of the
+     * device_changed_cb calls for a way to fix this
+     */
+    g_warn_if_reached();
   }
+  g_free (value);
 }
 
 static void prefs_drive_changed (BraseroDriveSelection *selection, BraseroDrive *drive, gpointer user_data)
 {
   if (drive)
-    gconf_client_set_string (gconf_client, GCONF_DEVICE, brasero_drive_get_device (drive), NULL);
+    g_settings_set_string (sj_settings, SJ_SETTINGS_DEVICE, brasero_drive_get_device (drive));
   else
-    gconf_client_set_string (gconf_client, GCONF_DEVICE, NULL, NULL);
+    g_settings_set_string (sj_settings, SJ_SETTINGS_DEVICE, NULL);
 }
 
 /**
- * The GConf key for the strip characters option changed
+ * The GSettings key for the strip characters option changed
  */
-static void strip_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+static void strip_changed_cb (GSettings *settings, gchar *key, gpointer user_data)
 {
   /* NOTE that strip_changed_cb in sj-main.c will also be called, and will also update
      the global value strip_chars - but which function will get called first?
      Make sure strip_chars is up to date BEFORE calling pattern_label_update */
-  g_return_if_fail (strcmp (entry->key, GCONF_STRIP) == 0);
+  g_return_if_fail (strcmp (key, SJ_SETTINGS_STRIP) == 0);
 
-  if (entry->value == NULL) {
-    strip_chars = FALSE;
-  } else {
-    strip_chars = gconf_value_get_bool (entry->value);
-  }
+  strip_chars = g_settings_get_boolean (settings, key);
   pattern_label_update ();
 }
 
@@ -481,7 +478,6 @@ void show_preferences_dialog ()
     guint i;
     GtkSizeGroup *group;
     GtkWidget    *box;
-    GConfBridge *bridge = gconf_bridge_get ();
 
     prefs_dialog = GET_WIDGET ("prefs_dialog");
     box          = GET_WIDGET ("hack_hbox");
@@ -532,24 +528,30 @@ void show_preferences_dialog ()
 
     g_signal_connect (cd_option, "drive-changed", G_CALLBACK (prefs_drive_changed), NULL);
 
-    /* Connect to GConf to update the UI */
-    gconf_bridge_bind_property (bridge, GCONF_EJECT, G_OBJECT (check_eject), "active");
-    gconf_bridge_bind_property (bridge, GCONF_OPEN, G_OBJECT (check_open), "active");
-    gconf_bridge_bind_property (bridge, GCONF_STRIP, G_OBJECT (check_strip), "active");
-    gconf_client_notify_add (gconf_client, GCONF_DEVICE, device_changed_cb, NULL, NULL, NULL);
-    gconf_client_notify_add (gconf_client, GCONF_BASEURI, baseuri_changed_cb, NULL, NULL, NULL);
-    gconf_client_notify_add (gconf_client, GCONF_AUDIO_PROFILE_MEDIA_TYPE, audio_profile_changed_cb, NULL, 
NULL, NULL);
-    gconf_client_notify_add (gconf_client, GCONF_PATH_PATTERN, path_pattern_changed_cb, NULL, NULL, NULL);
-    gconf_client_notify_add (gconf_client, GCONF_FILE_PATTERN, file_pattern_changed_cb, NULL, NULL, NULL);
-    gconf_client_notify_add (gconf_client, GCONF_STRIP, strip_changed_cb, NULL, NULL, NULL);
+    /* Connect to GSettings to update the UI */
+    g_settings_bind (sj_settings, SJ_SETTINGS_EJECT, G_OBJECT (check_eject), "active", 
G_SETTINGS_BIND_DEFAULT);
+    g_settings_bind (sj_settings, SJ_SETTINGS_OPEN, G_OBJECT (check_open), "active", 
G_SETTINGS_BIND_DEFAULT);
+    g_settings_bind (sj_settings, SJ_SETTINGS_STRIP, G_OBJECT (check_strip), "active", 
G_SETTINGS_BIND_DEFAULT);
+    g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_DEVICE,
+                      (GCallback)device_changed_cb, NULL);
+    g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_BASEURI,
+                      (GCallback)baseuri_changed_cb, NULL);
+    g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_AUDIO_PROFILE,
+                      (GCallback)audio_profile_changed_cb, NULL);
+    g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_PATH_PATTERN,
+                      (GCallback)path_pattern_changed_cb, NULL);
+    g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_FILE_PATTERN,
+                      (GCallback)file_pattern_changed_cb, NULL);
+    g_signal_connect (G_OBJECT (sj_settings), "changed::"SJ_SETTINGS_STRIP,
+                      (GCallback)strip_changed_cb, NULL);
 
     g_signal_connect (extractor, "notify::profile", pattern_label_update, NULL);
 
-    baseuri_changed_cb (gconf_client, -1, gconf_client_get_entry (gconf_client, GCONF_BASEURI, NULL, TRUE, 
NULL), NULL);
-    audio_profile_changed_cb (gconf_client, -1, gconf_client_get_entry (gconf_client, 
GCONF_AUDIO_PROFILE_MEDIA_TYPE, NULL, TRUE, NULL), NULL);
-    file_pattern_changed_cb (gconf_client, -1, gconf_client_get_entry (gconf_client, GCONF_FILE_PATTERN, 
NULL, TRUE, NULL), NULL);
-    path_pattern_changed_cb (gconf_client, -1, gconf_client_get_entry (gconf_client, GCONF_PATH_PATTERN, 
NULL, TRUE, NULL), NULL);
-    device_changed_cb (gconf_client, -1, gconf_client_get_entry (gconf_client, GCONF_DEVICE, NULL, TRUE, 
NULL), NULL);
+    baseuri_changed_cb (sj_settings, SJ_SETTINGS_BASEURI, NULL);
+    audio_profile_changed_cb (sj_settings, SJ_SETTINGS_AUDIO_PROFILE, NULL);
+    file_pattern_changed_cb (sj_settings, SJ_SETTINGS_FILE_PATTERN, NULL);
+    path_pattern_changed_cb (sj_settings, SJ_SETTINGS_PATH_PATTERN, NULL);
+    device_changed_cb (sj_settings, SJ_SETTINGS_DEVICE, NULL);
 
     g_signal_connect (GTK_DIALOG (prefs_dialog), "response", G_CALLBACK (on_response), NULL);
 
diff --git a/src/sj-prefs.h b/src/sj-prefs.h
index 78d1dc4..046dcf6 100644
--- a/src/sj-prefs.h
+++ b/src/sj-prefs.h
@@ -27,6 +27,8 @@ void show_preferences_dialog (void);
 gboolean cd_drive_exists (const char *device);
 void show_help (GtkWindow *parent);
 
+const gchar* sj_get_default_file_pattern (void);
+const gchar* sj_get_default_path_pattern (void);
 void prefs_profile_changed (GtkWidget *widget, gpointer user_data);
 G_MODULE_EXPORT void prefs_base_folder_changed (GtkWidget *chooser, gpointer user_data);
 void prefs_path_option_changed (GtkComboBox *combo, gpointer user_data);
diff --git a/src/sound-juicer.h b/src/sound-juicer.h
index 7425622..93751a8 100644
--- a/src/sound-juicer.h
+++ b/src/sound-juicer.h
@@ -24,15 +24,14 @@
 
 #include <glib/gi18n.h>
 #include <brasero-medium-selection.h>
-#include <gconf/gconf-client.h>
 #include <gio/gio.h>
 #include <gtk/gtk.h>
 #include "sj-extractor.h"
 
 /**
- * A GConf client
+ * A GSettings object
  */
-extern GConfClient *gconf_client;
+extern GSettings *sj_settings;
 
 /**
  * The main window
@@ -140,27 +139,20 @@ extern GtkCellRenderer *toggle_renderer, *title_renderer, *artist_renderer, *com
 void sj_debug (SjDebugDomain domain, const gchar* format, ...);
 
 /**
- * GConf key names
- */
-#define GCONF_ROOT "/apps/sound-juicer"
-#define GCONF_DEVICE GCONF_ROOT "/device"
-#define GCONF_EJECT GCONF_ROOT "/eject"
-#define GCONF_OPEN GCONF_ROOT "/open_completed"
-#define GCONF_BASEPATH GCONF_ROOT "/base_path"
-#define GCONF_BASEURI GCONF_ROOT "/base_uri"
-#define GCONF_FILE_PATTERN GCONF_ROOT "/file_pattern"
-#define GCONF_PATH_PATTERN GCONF_ROOT "/path_pattern"
-#define GCONF_AUDIO_PROFILE GCONF_ROOT "/audio_profile"
-#define GCONF_AUDIO_PROFILE_MEDIA_TYPE GCONF_ROOT "/audio_profile_media_type"
-#define GCONF_PARANOIA GCONF_ROOT "/paranoia"
-#define GCONF_STRIP GCONF_ROOT "/strip-special"
-#define GCONF_WINDOW GCONF_ROOT "/window"
-#define GCONF_AUDIO_VOLUME GCONF_ROOT "/volume"
-
-#define GCONF_PROXY_ROOT "/system/http_proxy"
-#define GCONF_HTTP_PROXY_ENABLE GCONF_PROXY_ROOT "/use_http_proxy"
-#define GCONF_HTTP_PROXY GCONF_PROXY_ROOT "/host"
-#define GCONF_HTTP_PROXY_PORT GCONF_PROXY_ROOT "/port"
+ * GSettings key names
+ */
+#define SJ_SETTINGS_DEVICE "device"
+#define SJ_SETTINGS_EJECT "eject"
+#define SJ_SETTINGS_OPEN "open-completed"
+#define SJ_SETTINGS_BASEPATH "base-path"
+#define SJ_SETTINGS_BASEURI "base-uri"
+#define SJ_SETTINGS_FILE_PATTERN "file-pattern"
+#define SJ_SETTINGS_PATH_PATTERN "path-pattern"
+#define SJ_SETTINGS_AUDIO_PROFILE "audio-profile"
+#define SJ_SETTINGS_PARANOIA "paranoia"
+#define SJ_SETTINGS_STRIP "strip-special"
+#define SJ_SETTINGS_WINDOW "window"
+#define SJ_SETTINGS_AUDIO_VOLUME "volume"
 
 /* TODO: need to add a SjWindow object or something */
 void sj_main_set_title (const char* detail);
diff --git a/tests/mb-test.c b/tests/mb-test.c
index dc3031d..b4a1ec3 100644
--- a/tests/mb-test.c
+++ b/tests/mb-test.c
@@ -1,14 +1,11 @@
 #include "config.h"
 #include <brasero-medium-monitor.h>
 #include <glib.h>
-#include <gconf/gconf-client.h>
 #include <stdlib.h>
 #include "sj-structures.h"
 #include "sj-metadata.h"
 #include "sj-metadata-getter.h"
 
-#define GCONF_ROOT "/apps/sound-juicer"
-
 static const char *
 source_to_str (MetadataSource source)
 {
@@ -93,25 +90,17 @@ int main (int argc, char** argv)
 {
   SjMetadataGetter *metadata;
   GMainLoop *loop;
-  GConfClient *gconf_client;
   GError *error = NULL;
   BraseroMediumMonitor *monitor;
 
   g_type_init ();
 
-  gconf_client = gconf_client_get_default ();
-  if (gconf_client == NULL) {
-    g_warning ("Could not create GConf client.\n");
-    exit (1);
-  }
-
   /* Make sure probing of the various media have settled before going on */
   monitor = brasero_medium_monitor_get_default ();
   while (brasero_medium_monitor_is_probing (monitor))
       g_usleep (G_USEC_PER_SEC/10);
   g_object_unref (G_OBJECT (monitor));
 
-  gconf_client_add_dir (gconf_client, GCONF_ROOT, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
   
   metadata = sj_metadata_getter_new ();
 


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