Index: xfce-icontheme.c =================================================================== RCS file: /var/cvs/xfce/xfce4/libxfcegui4/libxfcegui4/xfce-icontheme.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- xfce-icontheme.c 27 Aug 2004 03:17:25 -0000 1.6 +++ xfce-icontheme.c 28 Aug 2004 04:05:33 -0000 1.7 @@ -210,6 +210,7 @@ } while((file = g_dir_read_name(dir))) { gboolean is_icon_file = FALSE; + for(k = 0; icon_ext[k]; k++) { if(g_str_has_suffix(file, icon_ext[k])) { is_icon_file = TRUE; @@ -291,9 +292,13 @@ for(l = priv->dirs_watch; l; l = l->next) g_free(l->data); g_list_free(priv->dirs_watch); + priv->dirs_watch = NULL; } - if(priv->dirs_mtimes) + + if(priv->dirs_mtimes) { g_list_free(priv->dirs_mtimes); + priv->dirs_mtimes = NULL; + } } static void @@ -303,7 +308,7 @@ XfceIconTheme *icon_theme = user_data; invalidate_theme(icon_theme); - g_signal_emit(G_OBJECT(icon_theme), XFCEIC_SIG_CHANGED, 0); + g_signal_emit(G_OBJECT(icon_theme), icon_theme_signals[XFCEIC_SIG_CHANGED], 0); } GType @@ -379,19 +384,13 @@ g_object_set_data(G_OBJECT(priv->gscreen), "xfce-icon-theme", NULL); - g_hash_table_foreach(priv->icons, icon_lists_free_ht, NULL); - g_hash_table_destroy(priv->icons); + invalidate_theme(icon_theme); - if(priv->dirs_watch) { - for(l = priv->dirs_watch; l; l = l->next) + if(priv->search_paths) { + for(l = priv->search_paths; l; l = l->next) g_free(l->data); - g_list_free(priv->dirs_watch); - } - if(priv->dirs_mtimes) - g_list_free(priv->dirs_mtimes); - - if(priv->search_paths) g_list_free(priv->search_paths); + } if(priv->custom_categories) { for(l = priv->custom_categories; l; l = l->next) { @@ -417,7 +416,7 @@ icon_theme = g_object_get_data(G_OBJECT(screen), "xfce-icon-theme"); if(!icon_theme) { - gchar **paths, *kde_icon_dir = NULL; + gchar **paths, *kde_icon_dir = NULL, *homeicons; const gchar *kdedir = g_getenv("KDEDIR"); gint i, datadir_len = strlen(DATADIR); gboolean need_datadir = TRUE; @@ -425,6 +424,10 @@ icon_theme = g_object_new(XFCE_TYPE_ICON_THEME, NULL); icon_theme->priv->gscreen = screen; + homeicons = g_strconcat(xfce_get_homedir(), "/.icons/", NULL); + icon_theme->priv->search_paths = g_list_append(icon_theme->priv->search_paths, homeicons); + g_free(homeicons); + paths = xfce_resource_lookup_all(XFCE_RESOURCE_DATA, "icons/"); for(i = 0; paths[i]; i++) { icon_theme->priv->search_paths = g_list_append(icon_theme->priv->search_paths, paths[i]); @@ -443,7 +446,7 @@ /* FIXME: not sure if we need this next line or not */ /*gtk_icon_theme_prepend_search_path(icon_theme, DATADIR "/xfce4/icons");*/ if(kdedir && *kdedir && strcmp(kdedir, "/usr") && strcmp(kdedir, PREFIX)) { - kde_icon_dir = g_strconcat(kdedir, "/share/icons", NULL); + kde_icon_dir = g_strconcat(kdedir, "/share/icons/", NULL); icon_theme->priv->search_paths = g_list_append(icon_theme->priv->search_paths, kde_icon_dir); g_free(kde_icon_dir); } @@ -453,7 +456,8 @@ G_CALLBACK(icon_theme_changed_cb), icon_theme); g_object_set_data(G_OBJECT(screen), "xfce-icon-theme", icon_theme); - } + } else + g_object_ref(G_OBJECT(icon_theme)); return icon_theme; } @@ -476,6 +480,7 @@ if(st.st_mtime > GPOINTER_TO_UINT(g_list_nth_data(priv->dirs_mtimes, i))) { invalidate_theme(icon_theme); setup_icons(icon_theme); + break; } } else { invalidate_theme(icon_theme);