[gtk+] Remove obsolete code to use a cached mime-type



commit 04c78019fb44f6e44ea055e20c201bcebed1050a
Author: Federico Mena Quintero <federico novell com>
Date:   Thu Sep 3 12:09:09 2009 -0500

    Remove obsolete code to use a cached mime-type
    
    The non-standard "filechooser::mime-type" was a remnant of the recent-files code using
    a hand-built GFileInfo; now we just query the file info ourselves.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 gtk/gtkfilesystemmodel.c |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index c66c20c..021f608 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -292,22 +292,16 @@ node_should_be_visible (GtkFileSystemModel *model, guint id)
 
   if (required & GTK_FILE_FILTER_MIME_TYPE)
     {
-      filter_info.mime_type = g_file_info_get_attribute_string (node->info, "filechooser::mime-type");
-      if (filter_info.mime_type != NULL)
-        filter_info.contains |= GTK_FILE_FILTER_MIME_TYPE;
-      else
-        {
-          const char *s = g_file_info_get_content_type (node->info);
-          if (s)
-            {
-              mime_type = g_content_type_get_mime_type (s);
-              if (mime_type)
-                {
-                  filter_info.mime_type = mime_type;
-                  filter_info.contains |= GTK_FILE_FILTER_MIME_TYPE;
-                }
-            }
-        }
+      const char *s = g_file_info_get_content_type (node->info);
+      if (s)
+	{
+	  mime_type = g_content_type_get_mime_type (s);
+	  if (mime_type)
+	    {
+	      filter_info.mime_type = mime_type;
+	      filter_info.contains |= GTK_FILE_FILTER_MIME_TYPE;
+	    }
+	}
     }
 
   if (required & GTK_FILE_FILTER_FILENAME)



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