2008-05-18 [colin] 3.4.0cvs49
authorColin Leroy <colin@colino.net>
Sun, 18 May 2008 09:43:30 +0000 (09:43 +0000)
committerColin Leroy <colin@colino.net>
Sun, 18 May 2008 09:43:30 +0000 (09:43 +0000)
* src/stock_pixmap.c
Fix bug with non-updating icons after theme change:
If fetching pixbuf for a given icon after a theme
change, the next pixmap fetch would return the old
cached one, as the theme change was forgotten at
this time. (and vice-versa). This was mostly
visible on open folder icons

ChangeLog
PATCHSETS
configure.ac
src/stock_pixmap.c

index 1ddc44b..489fde0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-05-18 [colin]     3.4.0cvs49
+
+       * src/stock_pixmap.c
+               Fix bug with non-updating icons after theme change:
+               If fetching pixbuf for a given icon after a theme
+               change, the next pixmap fetch would return the old
+               cached one, as the theme change was forgotten at 
+               this time. (and vice-versa). This was mostly 
+               visible on open folder icons
+
 2008-05-17 [colin]     3.4.0cvs48
 
        * src/prefs_summaries.c
index 6dc2b54..38effc3 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 tools/thunderbird-filters-convertor.pl;  ) > 3.4.0cvs46.patchset
 ( cvs diff -u -r 1.179.2.219 -r 1.179.2.220 src/imap.c;  ) > 3.4.0cvs47.patchset
 ( cvs diff -u -r 1.1.2.52 -r 1.1.2.53 src/prefs_summaries.c;  cvs diff -u -r 1.395.2.367 -r 1.395.2.368 src/summaryview.c;  ) > 3.4.0cvs48.patchset
+( cvs diff -u -r 1.25.2.54 -r 1.25.2.55 src/stock_pixmap.c;  ) > 3.4.0cvs49.patchset
index de155f3..80cb9b0 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=48
+EXTRA_VERSION=49
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 4d91718..390e6db 100644 (file)
@@ -410,6 +410,7 @@ gint stock_pixbuf_gdk(GtkWidget *window, StockPixmap icon, GdkPixbuf **pixbuf)
        StockPixmapData *pix_d;
        static const char *extension[]={".png", ".xpm", NULL};
        int i = 0;
+       gboolean theme_changed = FALSE;
 
        if (pixbuf)
                *pixbuf = NULL;
@@ -418,9 +419,15 @@ gint stock_pixbuf_gdk(GtkWidget *window, StockPixmap icon, GdkPixbuf **pixbuf)
 
        pix_d = &pixmaps[icon];
 
-       if (!pix_d->pixbuf || (strcmp2(pix_d->icon_path, prefs_common.pixmap_theme_path) != 0)) {
+       theme_changed = (strcmp2(pix_d->icon_path, prefs_common.pixmap_theme_path) != 0);
+       if (!pix_d->pixbuf || theme_changed) {
                GdkPixbuf *pix = NULL;
-       
+               
+               if (theme_changed && pix_d->pixmap) {
+                       g_object_unref(pix_d->pixmap);
+                       pix_d->pixmap = NULL;
+               }
+
                if (strcmp(prefs_common.pixmap_theme_path, DEFAULT_PIXMAP_THEME) != 0) {
                        if (is_dir_exist(prefs_common.pixmap_theme_path)) {
                                char *icon_file_name; 
@@ -479,6 +486,7 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
        StockPixmapData *pix_d;
        static const char *extension[]={".png", ".xpm", NULL};
        int i = 0;
+       gboolean theme_changed = FALSE;
 
        if (pixmap) *pixmap = NULL;
        if (mask)   *mask   = NULL;
@@ -488,9 +496,15 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
 
        pix_d = &pixmaps[icon];
 
-       if (!pix_d->pixmap || (strcmp2(pix_d->icon_path, prefs_common.pixmap_theme_path) != 0)) {
+       theme_changed = (strcmp2(pix_d->icon_path, prefs_common.pixmap_theme_path) != 0);
+       if (!pix_d->pixmap || theme_changed) {
                GdkPixmap *pix = NULL;
-       
+
+               if (theme_changed && pix_d->pixbuf) {
+                       g_object_unref(pix_d->pixbuf);
+                       pix_d->pixbuf = NULL;
+               }
+
                if (strcmp(prefs_common.pixmap_theme_path, DEFAULT_PIXMAP_THEME) != 0) {
                        if ( is_dir_exist(prefs_common.pixmap_theme_path) ) {
                                char *icon_file_name;