changeset 1758:6b9e1c2b2b32 trunk

[svn] - fix for gconf_value_get_string() does not accept null string.
author yaz
date Sun, 24 Sep 2006 00:40:12 -0700
parents a406c1e2da12
children c525c2b6a3d8
files ChangeLog audacious/prefswin.c configure.ac
diffstat 3 files changed, 24 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Sep 23 13:53:46 2006 -0700
+++ b/ChangeLog	Sun Sep 24 00:40:12 2006 -0700
@@ -1,3 +1,10 @@
+2006-09-23 20:53:46 +0000  Tony Vroon <chainsaw@gentoo.org>
+  revision [2451]
+  Revert botched workaround, the actual 3 NULL writes will have to be addressed.
+  trunk/libaudacious/configdb_gconf.c |    2 --
+  1 file changed, 2 deletions(-)
+
+
 2006-09-23 20:50:17 +0000  Tony Vroon <chainsaw@gentoo.org>
   revision [2449]
   Do not try write NULL into a gconf key, convert it to "" first.
--- a/audacious/prefswin.c	Sat Sep 23 13:53:46 2006 -0700
+++ b/audacious/prefswin.c	Sun Sep 24 00:40:12 2006 -0700
@@ -1979,16 +1979,22 @@
 on_chardet_fallback_realize(GtkEntry *entry, gpointer data)
 {
     ConfigDb *db;
-    gchar *ret;
+    gchar *ret = NULL;
 
     db = bmp_cfg_db_open();
 
     if (bmp_cfg_db_get_string(db, NULL, "chardet_fallback", &ret) != FALSE) {
         if(cfg.chardet_fallback)
             g_free(cfg.chardet_fallback);
-        cfg.chardet_fallback = ret;
+
+        if(ret && strncasecmp(ret, "None", sizeof("None"))) {
+            cfg.chardet_fallback = ret;
+        } else {
+            cfg.chardet_fallback = g_strdup("");
+        }
         gtk_entry_set_text(entry, cfg.chardet_fallback);
     }
+
     bmp_cfg_db_close(db);
 }
 
@@ -1996,16 +2002,19 @@
 on_chardet_fallback_changed(GtkEntry *entry, gpointer data)
 {
     ConfigDb *db;
-    gchar *ret;
-
-    ret = g_strdup(gtk_entry_get_text(entry));
 
     if(cfg.chardet_fallback)
         g_free(cfg.chardet_fallback);
-    cfg.chardet_fallback = ret;
+
+    cfg.chardet_fallback = g_strdup(gtk_entry_get_text(entry));
 
     db = bmp_cfg_db_open();
-    bmp_cfg_db_set_string(db, NULL, "chardet_fallback", cfg.chardet_fallback);
+
+    if(!strncasecmp(cfg.chardet_fallback, "", sizeof("")))
+        bmp_cfg_db_set_string(db, NULL, "chardet_fallback", "None");
+    else
+        bmp_cfg_db_set_string(db, NULL, "chardet_fallback", cfg.chardet_fallback);
+
     bmp_cfg_db_close(db);
 }
 
--- a/configure.ac	Sat Sep 23 13:53:46 2006 -0700
+++ b/configure.ac	Sun Sep 24 00:40:12 2006 -0700
@@ -176,7 +176,7 @@
 dnl chardet support
 dnl ========================
 AC_ARG_ENABLE(chardet,
-	[  --enable-chardet	 enable character set detection support (default=no)],
+	[  --enable-chardet	  enable character set detection support (default=no)],
 			enable_chardet=$enableval, enable_chardet=no)
 if test "x$enable_chardet" = xyes; then
     AC_DEFINE(USE_CHARDET, 1, [Define if character set detection enabled] )