Clear the cache when the icon theme changes so we get the new icons.

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.
This commit is contained in:
James Willcox 2002-12-05 19:19:31 +00:00 committed by James Willcox
parent 5d647db52b
commit 585340cc59
2 changed files with 25 additions and 3 deletions

View file

@ -1,3 +1,10 @@
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-05 Glynn Foster <glynn.foster@sun.com>
* libnautilus/nautilus-clipboard-ui.xml: Add missing mnemonics.

View file

@ -188,6 +188,7 @@ static CacheIcon *get_icon_from_cache (const char
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 @@ icon_theme_changed_callback (GnomeIconTheme *icon_theme,
{
NautilusIconFactory *factory;
nautilus_icon_factory_clear ();
factory = user_data;
g_signal_emit (factory,
@ -591,9 +594,19 @@ nautilus_icon_factory_clear (void)
/* 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);
/* fallback_icon hangs around, but we don't know if it
* was ever inserted in the list
*/
g_assert (factory->recently_used_count == 0 ||
factory->recently_used_count == 1);
if (factory->recently_used_count == 1) {
/* make sure this one is the fallback_icon */
g_assert (head->next == head->prev);
g_assert (&factory->fallback_icon->recently_used_node == head->next);
}
}
static void
@ -630,6 +643,7 @@ thumbnail_limit_changed_callback (gpointer user_data)
* signal to mean only "thumbnails might have changed" if this ends up being slow
* for some reason.
*/
nautilus_icon_factory_clear ();
g_signal_emit (global_icon_factory,
signals[ICONS_CHANGED], 0);
}
@ -643,6 +657,7 @@ mime_type_data_changed_callback (GnomeVFSMIMEMonitor *monitor, gpointer user_dat
/* We don't know which data changed, so we have to assume that
* any or all icons might have changed.
*/
nautilus_icon_factory_clear ();
g_signal_emit (get_icon_factory (),
signals[ICONS_CHANGED], 0);
}