gnome-utils r8523 - trunk/gsearchtool



Author: dcransto
Date: Wed Mar 25 03:00:30 2009
New Revision: 8523
URL: http://svn.gnome.org/viewvc/gnome-utils?rev=8523&view=rev

Log:
2009-03-24  Dennis Cranston  <dennis_cranston yahoo com>

        * gsearchtool-support.c (get_file_pixbuf): Use a better key
        for the icon hash table, g_icon_to_string().



Modified:
   trunk/gsearchtool/ChangeLog
   trunk/gsearchtool/gsearchtool-support.c

Modified: trunk/gsearchtool/gsearchtool-support.c
==============================================================================
--- trunk/gsearchtool/gsearchtool-support.c	(original)
+++ trunk/gsearchtool/gsearchtool-support.c	Wed Mar 25 03:00:30 2009
@@ -1162,14 +1162,12 @@
 {
 	GdkPixbuf * pixbuf;
 	GIcon * icon = NULL;
-	const gchar * content_type = NULL;
 	const gchar * thumbnail_path = NULL;
 
 	if (file_info == NULL) {
 		return NULL;
 	}
 
-	content_type = g_file_info_get_content_type (file_info);
 	icon = g_file_info_get_icon (file_info);
 
 	if (gsearch->show_thumbnails == TRUE) {
@@ -1180,12 +1178,16 @@
 		pixbuf = gsearchtool_get_thumbnail_image (thumbnail_path);
 	}
 	else {
-		pixbuf = (GdkPixbuf *) g_hash_table_lookup (gsearch->search_results_filename_hash_table, content_type);
+		gchar * icon_string;
+
+		icon_string = g_icon_to_string (icon);		
+		pixbuf = (GdkPixbuf *) g_hash_table_lookup (gsearch->search_results_filename_hash_table, icon_string);
 
 		if (pixbuf == NULL) {
 			pixbuf = get_themed_icon_pixbuf (G_THEMED_ICON (icon), ICON_SIZE, gtk_icon_theme_get_default ());
-			g_hash_table_insert (gsearch->search_results_filename_hash_table, g_strdup (content_type), pixbuf);	
+			g_hash_table_insert (gsearch->search_results_filename_hash_table, g_strdup (icon_string), pixbuf);
 		}
+		g_free (icon_string);
 	}
 	return pixbuf;
 }



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