Commit 8ee6ecbe authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Fix content type handling

svn path=/trunk/; revision=21318
parent d69788f0
2008-09-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilechooserdefault.c: Actually use mime types, not content
types, for mimetype-based filtering, so it may work on win32.
2008-09-07 Matthias Clasen <mclasen@redhat.com> 2008-09-07 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilechooserdefault.c (search_selected_foreach_get_file_cb): * gtk/gtkfilechooserdefault.c (search_selected_foreach_get_file_cb):
......
...@@ -5913,7 +5913,7 @@ get_is_file_filtered (GtkFileChooserDefault *impl, ...@@ -5913,7 +5913,7 @@ get_is_file_filtered (GtkFileChooserDefault *impl,
needed = gtk_file_filter_get_needed (impl->current_filter); needed = gtk_file_filter_get_needed (impl->current_filter);
filter_info.display_name = g_file_info_get_display_name (file_info); filter_info.display_name = g_file_info_get_display_name (file_info);
filter_info.mime_type = g_file_info_get_content_type (file_info); filter_info.mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (file_info));
if (needed & GTK_FILE_FILTER_FILENAME) if (needed & GTK_FILE_FILTER_FILENAME)
{ {
...@@ -5935,10 +5935,9 @@ get_is_file_filtered (GtkFileChooserDefault *impl, ...@@ -5935,10 +5935,9 @@ get_is_file_filtered (GtkFileChooserDefault *impl,
result = gtk_file_filter_filter (impl->current_filter, &filter_info); result = gtk_file_filter_filter (impl->current_filter, &filter_info);
if (filter_info.filename) g_free ((gchar *)filter_info.filename);
g_free ((gchar *)filter_info.filename); g_free ((gchar *)filter_info.uri);
if (filter_info.uri) g_free ((gchar *)filter_info.mime_type);
g_free ((gchar *)filter_info.uri);
return !result; return !result;
} }
...@@ -8593,7 +8592,7 @@ search_hit_get_info_cb (GCancellable *cancellable, ...@@ -8593,7 +8592,7 @@ search_hit_get_info_cb (GCancellable *cancellable,
} }
display_name = g_strdup (g_file_info_get_display_name (info)); display_name = g_strdup (g_file_info_get_display_name (info));
mime_type = g_strdup (g_file_info_get_content_type (info)); mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (info));
is_folder = (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY); is_folder = (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY);
pixbuf = _gtk_file_info_render_icon (info, GTK_WIDGET (request->impl), pixbuf = _gtk_file_info_render_icon (info, GTK_WIDGET (request->impl),
request->impl->icon_size); request->impl->icon_size);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment