Use xdg_mime_mime_type_subclass() to match mime types. This also gives use

2004-11-08  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilefilter.c (gtk_file_filter_filter): Use
	xdg_mime_mime_type_subclass() to match mime types. This
	also gives use wildcard matching. (#143760, #141224,
	Tommi Komulainen, David A Knight)
This commit is contained in:
Matthias Clasen 2004-11-08 21:25:27 +00:00 committed by Matthias Clasen
parent f5fff322db
commit c4183ed568
7 changed files with 32 additions and 3 deletions

View File

@ -1,5 +1,10 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilefilter.c (gtk_file_filter_filter): Use
xdg_mime_mime_type_subclass() to match mime types. This
also gives use wildcard matching. (#143760, #141224,
Tommi Komulainen, David A Knight)
* gtk/gtkaction.c (_gtk_action_sync_menu_visible): Use
gtk_widget_{hide,show} instead of g_object_set (..."visible"...).

View File

@ -1,5 +1,10 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilefilter.c (gtk_file_filter_filter): Use
xdg_mime_mime_type_subclass() to match mime types. This
also gives use wildcard matching. (#143760, #141224,
Tommi Komulainen, David A Knight)
* gtk/gtkaction.c (_gtk_action_sync_menu_visible): Use
gtk_widget_{hide,show} instead of g_object_set (..."visible"...).

View File

@ -1,5 +1,10 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilefilter.c (gtk_file_filter_filter): Use
xdg_mime_mime_type_subclass() to match mime types. This
also gives use wildcard matching. (#143760, #141224,
Tommi Komulainen, David A Knight)
* gtk/gtkaction.c (_gtk_action_sync_menu_visible): Use
gtk_widget_{hide,show} instead of g_object_set (..."visible"...).

View File

@ -1,5 +1,10 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilefilter.c (gtk_file_filter_filter): Use
xdg_mime_mime_type_subclass() to match mime types. This
also gives use wildcard matching. (#143760, #141224,
Tommi Komulainen, David A Knight)
* gtk/gtkaction.c (_gtk_action_sync_menu_visible): Use
gtk_widget_{hide,show} instead of g_object_set (..."visible"...).

View File

@ -26,6 +26,9 @@
#include "gtkobject.h"
#include "gtkprivate.h"
#define XDG_PREFIX _gtk_xdg
#include "xdgmime/xdgmime.h"
typedef struct _GtkFileFilterClass GtkFileFilterClass;
typedef struct _FilterRule FilterRule;
@ -403,7 +406,7 @@ gtk_file_filter_filter (GtkFileFilter *filter,
{
case FILTER_RULE_MIME_TYPE:
if (filter_info->mime_type != NULL
&& strcmp (rule->u.mime_type, filter_info->mime_type) == 0)
&& xdg_mime_mime_type_subclass (filter_info->mime_type, rule->u.mime_type))
return TRUE;
break;
case FILTER_RULE_PATTERN:

View File

@ -1,5 +1,8 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com>
* xdgmime.c (xdg_mime_mime_type_subclass): Enable matching
of supertypes as text/*.
* Sync from upstream
2004-10-27 Matthias Clasen <mclasen@redhat.com>

View File

@ -573,7 +573,7 @@ xdg_mime_media_type_equal (const char *mime_a,
return 0;
}
#if 0
#if 1
static int
xdg_mime_is_super_type (const char *mime)
{
@ -605,7 +605,10 @@ xdg_mime_mime_type_subclass (const char *mime,
if (strcmp (umime, ubase) == 0)
return 1;
#if 0
/* We really want to handle text/* in GtkFileFilter, so we just
* turn on the supertype matching
*/
#if 1
/* Handle supertypes */
if (xdg_mime_is_super_type (ubase) &&
xdg_mime_media_type_equal (umime, ubase))