* src/prefs_common.c
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Mon, 9 Jun 2003 15:16:07 +0000 (15:16 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Mon, 9 Jun 2003 15:16:07 +0000 (15:16 +0000)
fix bug #163 "Icon switching doesnt work properly" by
preventing early freeing of prefs_common.pixmap_theme_path.

ChangeLog.claws
configure.ac
src/prefs_common.c

index d3a7903a9c0a0c48e407ad9f20eef3905701fa19..5ff16e13645422eba2202601444ca6a5b40a52cc 100644 (file)
@@ -1,3 +1,9 @@
+2003-06-09 [alfons]    0.9.0claws25
+
+       * src/prefs_common.c
+               fix bug #163 "Icon switching doesnt work properly" by 
+               preventing early freeing of prefs_common.pixmap_theme_path.
+
 2003-06-09 [christoph] 0.9.0claws24
 
        * src/gtk/gtkaspell.c
index ad40c92ff72426f2fcacb44c264a292fcf449f5c..c198e67c49cd6091327d4427225d737e51762528 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws24
+EXTRA_VERSION=claws25
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 0879664d00b02efe870c709ff6a9450dab6d0358..b40ee09b8171ec5c13c00aafb0478bbe93bf33a2 100644 (file)
@@ -4231,6 +4231,7 @@ static void prefs_common_apply(void)
 {
        gchar *entry_pixmap_theme_str;
        gboolean update_pixmap_theme;
+       gchar *backup_theme_path;
        
        entry_pixmap_theme_str = gtk_entry_get_text(GTK_ENTRY(interface.entry_pixmap_theme));
        if (entry_pixmap_theme_str && 
@@ -4238,16 +4239,25 @@ static void prefs_common_apply(void)
                update_pixmap_theme = TRUE;
        else
                update_pixmap_theme = FALSE;
-       
+
+       /*!< FIXME: prefs_set_data_from_dialog() clears and frees all strings, 
+        * but prefs_common.pixmap_theme_path is stored in the StockPixmapData
+        * in stock_pixmap.c::pixmaps[].icon_path, and used when reflecting
+        * the pixmap changes. Work around by saving the old one and freeing 
+        * it later. */
+       backup_theme_path = prefs_common.pixmap_theme_path;
+       prefs_common.pixmap_theme_path = g_strdup(backup_theme_path);
        prefs_set_data_from_dialog(param);
        sock_set_io_timeout(prefs_common.io_timeout_secs);
        
-       if (update_pixmap_theme)
-       {
+       if (update_pixmap_theme) {
                main_window_reflect_prefs_all_real(TRUE);
                compose_reflect_prefs_pixmap_theme();
        } else
                main_window_reflect_prefs_all_real(FALSE);
+
+       /*!< FIXME: Now it's safe to delete the backup path */
+       g_free(backup_theme_path);
        
        prefs_common_save_config();