gvfs r1448 - in trunk: . daemon



Author: alexl
Date: Fri Feb 29 09:21:39 2008
New Revision: 1448
URL: http://svn.gnome.org/viewvc/gvfs?rev=1448&view=rev

Log:
2008-02-29  Alexander Larsson  <alexl redhat com>

        * daemon/gvfsdaemonutils.c:
        (gvfs_file_info_populate_content_types):
	Use g_content_type_get_icon() for the icon mapping.
	Use folder, not folder-remote for icon. I don't
	think we should use folder-remote for things like
	shares, not normal folders.




Modified:
   trunk/ChangeLog
   trunk/daemon/gvfsdaemonutils.c

Modified: trunk/daemon/gvfsdaemonutils.c
==============================================================================
--- trunk/daemon/gvfsdaemonutils.c	(original)
+++ trunk/daemon/gvfsdaemonutils.c	Fri Feb 29 09:21:39 2008
@@ -267,43 +267,13 @@
   g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, mimetype);
       
   if (type == G_FILE_TYPE_DIRECTORY)
-    /* FIXME: or just folder? */
-    icon = g_themed_icon_new ("folder-remote");
+    icon = g_themed_icon_new ("folder");
   else if (mimetype)
-    {
-      char *mimetype_icon, *generic_mimetype_icon, *type_icon;
-      const char *p;
-      char *icon_names[3];
-      int i;
-      
-      mimetype_icon = g_strdup (mimetype);
-      g_strdelimit (mimetype_icon, "/", '-');
-      
-      p = strchr (mimetype, '/');
-      if (p == NULL)
-	p = mimetype + strlen (mimetype);
-      
-      generic_mimetype_icon = g_malloc (p - mimetype + strlen ("-x-generic") + 1);
-      memcpy (generic_mimetype_icon, mimetype, p - mimetype);
-      memcpy (generic_mimetype_icon + (p - mimetype), "-x-generic", strlen ("-x-generic"));
-      generic_mimetype_icon[(p - mimetype) + strlen ("-x-generic")] = 0;
-      
-      type_icon = "text-x-generic";
-      
-      i = 0;
-      icon_names[i++] = mimetype_icon;
-      icon_names[i++] = generic_mimetype_icon;
-      if (strcmp (generic_mimetype_icon, type_icon) != 0 &&
-	  strcmp (mimetype_icon, type_icon) != 0) 
-	icon_names[i++] = type_icon;
-
-      icon = g_themed_icon_new_from_names (icon_names, i);
-      
-      g_free (mimetype_icon);
-      g_free (generic_mimetype_icon);
-      
-    }
+    icon = g_content_type_get_icon (mimetype);
 
+  if (icon == NULL)
+    icon = g_themed_icon_new ("text-x-generic");
+  
   g_file_info_set_icon (info, icon);
   g_object_unref (icon);
 



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