# HG changeset patch # User yaz # Date 1159083612 25200 # Node ID 6b9e1c2b2b32b0817fcd56e3fc7baaecafc46a5b # Parent a406c1e2da12a84317e1e8551f9deb9a7e7e8735 [svn] - fix for gconf_value_get_string() does not accept null string. diff -r a406c1e2da12 -r 6b9e1c2b2b32 ChangeLog --- 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 + 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 revision [2449] Do not try write NULL into a gconf key, convert it to "" first. diff -r a406c1e2da12 -r 6b9e1c2b2b32 audacious/prefswin.c --- 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); } diff -r a406c1e2da12 -r 6b9e1c2b2b32 configure.ac --- 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] )