icon theme fixing



Hi,

While fixing a separate bug, I realized that nautilus wasn't responding properly to changes in the icon theme.  The attached patch fixes this by clearing the icon cache when the theme changes.  I commented out the g_assert() stuff in nautilus_icon_cache_clear() because they were failing and causing an abort......not sure what I should do to fix it....any ideas?

Thanks,
James
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.5612
diff -u -r1.5612 ChangeLog
--- ChangeLog	5 Dec 2002 02:42:47 -0000	1.5612
+++ ChangeLog	5 Dec 2002 03:15:47 -0000
@@ -1,5 +1,12 @@
 2002-12-04  James Willcox  <jwillcox gnome org>
 
+	* libnautilus-private/nautilus-icon-factory.c:
+	(icon_theme_changed_callback), (nautilus_icon_factory_clear):
+
+	Clear the cache when the icon theme changes so we get the new icons.
+
+2002-12-04  James Willcox  <jwillcox gnome org>
+
 	* src/nautilus-window.c: (nautilus_window_instance_init):
 
 	Disconnect "icons_changed" handler from the icon factory when the
Index: libnautilus-private/nautilus-icon-factory.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-factory.c,v
retrieving revision 1.282
diff -u -r1.282 nautilus-icon-factory.c
--- libnautilus-private/nautilus-icon-factory.c	20 Nov 2002 12:19:53 -0000	1.282
+++ libnautilus-private/nautilus-icon-factory.c	5 Dec 2002 03:15:49 -0000
@@ -188,6 +188,7 @@
 static GdkPixbuf *embed_text                             (GdkPixbuf                *pixbuf_without_text,
 							  GnomeIconData            *icon_data,
 							  const char               *text);
+static void nautilus_icon_factory_clear                  (void);
 
 GNOME_CLASS_BOILERPLATE (NautilusIconFactory,
 			 nautilus_icon_factory,
@@ -241,6 +242,8 @@
 {
 	NautilusIconFactory *factory;
 
+	nautilus_icon_factory_clear ();
+
 	factory = user_data;
 
 	g_signal_emit (factory,
@@ -591,9 +594,12 @@
 	
 	/* Empty out the recently-used list. */
 	head = &factory->recently_used_dummy_head;
+
+	/*
 	g_assert (factory->recently_used_count == 0);
 	g_assert (head->next == head);
 	g_assert (head->prev == head);
+	*/
 }
 
 static void


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