Commit afb46bc3 authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho

removed local xdgmime copy as Matthias suggested in bug #520874, comment

2008-06-10  Carlos Garnacho  <carlos@imendio.com>

        * configure.in:
        * gtk/Makefile.am:
        * gtk/xdgmime: removed local xdgmime copy as Matthias suggested in bug
        #520874, comment #8. It's no longer used directly by GTK+.

svn path=/trunk/; revision=20343
parent 640d6877
2008-06-10 Carlos Garnacho <carlos@imendio.com>
* configure.in:
* gtk/Makefile.am:
* gtk/xdgmime: removed local xdgmime copy as Matthias suggested in bug
#520874, comment #8. It's no longer used directly by GTK+.
2008-06-10 Carlos Garnacho <carlos@imendio.com>
Bug 520874 - Should use gio directly.
......
......@@ -2004,7 +2004,6 @@ gtk/gtkversion.h
gtk/gtk-win32.rc
gtk/theme-bits/Makefile
gtk/tests/Makefile
gtk/xdgmime/Makefile
modules/Makefile
modules/other/Makefile
modules/other/gail/Makefile
......
# Makefile.am for gtk+/gtk
include $(top_srcdir)/Makefile.decl
xdgmimedir =
if OS_UNIX
xdgmimedir += xdgmime
if USE_QUARTZ
GTK_PRINT_PREVIEW_COMMAND="open -a /Applications/Preview.app %f"
else
GTK_PRINT_PREVIEW_COMMAND="evince --unlink-tempfile --preview --print-settings %s %f"
endif
endif
SUBDIRS = theme-bits $(xdgmimedir) . tests
DIST_SUBDIRS=theme-bits xdgmime tests
SUBDIRS = theme-bits . tests
DIST_SUBDIRS=theme-bits tests
if HAVE_CUPS
GTK_PRINT_BACKENDS=file,cups
......@@ -116,10 +111,6 @@ libadd = \
$(GTK_DEP_LIBS)
deps =
if OS_UNIX
libadd += xdgmime/libxdgmime.la
endif
# libtool stuff: set version and export symbols for resolving
# since automake doesn't support conditionalized libsomething_la_LDFLAGS
# we use the general approach here
......
2008-06-03 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.2 ===
2008-05-29 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.1 ===
2008-04-16 Matthias Clasen <mclasen@redhat.com>
* Sync xdgmime to the copy in gio.
2008-04-16 Matthias Clasen <mclasen@redhat.com>
Partically revert the last commit after realizing that
xdg_mime_media_type_equal doesn't have to init at all.
* xdgmime.h:
* xdgmime.c: Get rid of _xdg_mime_media_type_equal
* xdgmimecache.c: Use xdg_mime_media_type_equal
2008-04-16 Matthias Clasen <mclasen@redhat.com>
Avoid possible memory corruption in xdgmime, fd.o bug 12512,
reported by Joe Shaw and Federico Mena Quintero.
* xdgmime.c(_xdg_mime_media_type_equal): Implement.
(xdg_mime_media_type_equal): Turn into a wrapper around the
_-prefixed version.
* xdgmimecache.c: Use the _-prefixed versions of
comparison functions throughout.
2008-02-16 Matthias Clasen <mclasen@redhat.com>
* === Released 2.13.0 ===
2007-10-16 Matthias Clasen <mclasen@redhat.com>
* === Released 2.12.1 ===
2007-09-13 Matthias Clasen <mclasen@redhat.com>
* === Released 2.12.0 ===
2007-07-25 Alexander Larsson <alexl@redhat.com>
* xdgmimealias.h:
* xdgmimecache.h:
* xdgmimeparent.h:
Mark more internal symbols for prefixing
2007-07-21 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.6 ===
2007-07-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.5 ===
2007-06-19 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.4 ===
2007-06-15 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.3 ===
2007-06-06 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.2 ===
2007-06-04 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.1 ===
2007-05-24 Matthias Clasen <mclasen@redhat.com>
* === Released 2.11.0 ===
2007-04-09 Matthias Clasen <mclasen@redhat.com>
* xdgmimeglob.c (_xdg_glob_hash_insert_text): Duplicate the
mime_type when storing it in a hash node, to avoid leaks.
Update all callers.
2007-01-07 Matthias Clasen <mclasen@redhat.com>
* xdgmimecache.c (cache_glob_node_lookup_suffix): Don't return ""
as match. (fd.o #9544, Yevgen Muntyan)
2007-01-07 Matthias Clasen <mclasen@redhat.com>
* xdgmimecache.c (_xdg_mime_cache_list_mime_parents): Fix
several problems with this function. (fd.o #9560, Yevgen Muntyan)
2006-08-17 Matthias Clasen <mclasen@redhat.com>
* === Released 2.10.2 ===
2006-07-23 Matthias Clasen <mclasen@redhat.com>
* === Released 2.10.1 ===
2006-07-20 Matthias Clasen <mclasen@redhat.com>
Fix a thinko that leads to constantly reloading
the mime data if a mime.cache is present. Patch
by Yevgen Muntyan, bugs.freedesktop.org #7495
* xdgmime.c (xdg_check_dir): Look for mime.cache first.
(xdg_check_file): Report existance of the file separately.
2006-07-20 Matthias Clasen <mclasen@redhat.com>
* xdgmime.c (xdg_mime_shutdown): Unref the caches.
Patch by Yevgen Muntyan, bugs.freedesktop.org #7496
* xdgmimemagic.c:
* xdgmime.c:
* xdgmime.h: Add xdg_init-free versions of some
functions and use them internally, so that we don't
reload caches and clobber data structures in the
middle of an operation. Patch by Joe Shaw,
bugs.freedesktop.org #6824
2006-07-19 Matthias Clasen <mclasen@redhat.com>
* xdgmimeglob.c (_xdg_glob_hash_node_lookup_file_name):
Don't return NULL as a mimetype, ever, patch
by Yevgen Muntyan, bugs.freedesktop.org #5241
2006-07-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.10.0 ===
2006-06-21 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.4 ===
2006-06-12 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.3 ===
2006-06-05 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.2 ===
2006-05-16 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.1 ====
2006-05-04 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.0 ===
2006-04-03 Matthias Clasen <mclasen@redhat.com>
* xdgmime.[hc]: Move xdg_mime_type_unknown to .rodata.
2006-03-06 Matthias Clasen <mclasen@redhat.com>
* xdgmimemagic.c: Remove superfluous extern errno
declaration. (#333605, Tommi Komulainen)
2006-02-27 Matthias Clasen <mclasen@redhat.com>
* xdgmime.h (xdg_mime_dump): Don't export xdg_mime_dump.
2005-12-01 Matthias Clasen <mclasen@redhat.com>
* Merge upstream changes to handle duplicate glob
patterns.
2005-11-04 Matthias Clasen <mclasen@redhat.com>
* xdgmime.c (xdg_mime_list_mime_parents): Prevent
a segfault.
2005-10-18 Matthias Clasen <mclasen@redhat.com>
* xdgmimecache.c: Make magic comparisons work correctly
in the cache.
2005-10-17 Matthias Clasen <mclasen@redhat.com>
* xdgmime.c (xdg_mime_get_mime_type_for_file): Remove
a debugging printf.
2005-09-01 Matthias Clasen <mclasen@redhat.com>
* xdgmime.h:
* xdgmime.c (xdg_mime_get_mime_type_for_file): Take
a struct statbuf * as argument.
* test-mime.c (main): Adjust.
2005-08-24 Matthias Clasen <mclasen@redhat.com>
* === Released 2.8.2 ===
* === Released 2.8.1 ===
2005-08-13 Matthias Clasen <mclasen@redhat.com>
* === Released 2.8.0 ===
2005-08-07 Matthias Clasen <mclasen@redhat.com>
* Rename caches to _caches, so it doesn't
get exported. Also don't export n_caches.
2005-08-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.5 ===
2005-07-22 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.4 ===
2005-07-15 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.3 ===
2005-07-08 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.2 ===
2005-07-01 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.1 ===
2005-06-20 Matthias Clasen <mclasen@redhat.com>
* xdgmimecache.c: Handle missing MAP_FAILED. (#308449, Georg
Schwarz)
2005-06-20 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.0 ===
2005-06-10 Federico Mena Quintero <federico@ximian.com>
* xdgmime.c (xdg_mime_init_from_directory): Pass the correct size
to realloc(). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=3506.
2005-06-09 Matthias Clasen <mclasen@redhat.com>
* xdgmimemagic.c: Don't declare errno, including errno.h
is enough. (#304164, Joerg Sonnenberger)
2005-05-20 Matthias Clasen <mclasen@redhat.com>
* xdgmimecache.c (GET_UINT32): Don't rely on C99
types. (#304924, John Ehresman)
2005-04-29 Matthias Clasen <mclasen@redhat.com>
* Sync to upstream.
2005-04-08 Matthias Clasen <mclasen@redhat.com>
* xdgmimecache.c (cache_magic_matchlet_compare_to_data)
(cache_magic_matchlet_compare): Use cache->buffer, not
cache.
Tue Apr 5 16:00:04 2005 Manish Singh <yosh@gimp.org>
* Makefile.am: add xdgmimecache.[ch].
2005-03-28 Matthias Clasen <mclasen@redhat.com>
* xdgmimeglob.c: Sync to latest upstream,
including fixes for matching against multiple
extensions (eg .tar.gz) and for suffix
patterns which don't start with a dot.
Sat Mar 19 23:52:33 2005 Manish Singh <yosh@gimp.org>
* xdgmimeglob.c (_xdg_glob_hash_insert_text): cast away the constness
in the call to free().
2005-03-20 Matthias Clasen <mclasen@redhat.com>
* xdgmimeglob.c (_xdg_glob_hash_insert_text): Don't
leak node->mime_type if we are reusing an existing
node. (#170774, Kjartan Maraas)
2005-01-08 Matthias Clasen <mclasen@redhat.com>
* === Released 2.6.1 ===
2004-12-16 Matthias Clasen <mclasen@redhat.com>
* === Released 2.6.0 ===
2004-12-13 Marco Pesenti Gritti <marco@gnome.org>
* xdgmimeglob.c: (_xdg_glob_hash_lookup_file_name):
Resync with upstream again
Fri Dec 10 13:58:38 2004 Manish Singh <yosh@gimp.org>
* xdgmime.h: wrap new API in XDG_ENTRY().
2004-12-09 Marco Pesenti Gritti <marco@gnome.org>
* xdgmime.c: (xdg_mime_unalias_mime_type),
(xdg_mime_mime_type_equal), (xdg_mime_mime_type_subclass),
(xdg_mime_get_mime_parents):
* xdgmime.h:
* xdgmimealias.c: (_xdg_mime_alias_list_lookup):
* xdgmimeglob.c: (_xdg_glob_hash_node_lookup_file_name):
* xdgmimeint.c: (_xdg_ucs4_to_lower):
* xdgmimeint.h:
* xdgmimemagic.c: (_xdg_mime_magic_read_from_file):
* xdgmimeparent.c: (_xdg_mime_parent_list_lookup):
Resync with upstream
2004-12-09 Matthias Clasen <mclasen@redhat.com>
* xdgmimealias.c (_xdg_mime_alias_read_from_file):
* xdgmimeparent.c (_xdg_mime_parent_read_from_file): Make
repeated calls accumulate the results, don't call qsort()
on empty arrays. (#160838, Mariano Suárez-Alvarez)
2004-12-02 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.6 ===
2004-11-29 Matthias Clasen <mclasen@redhat.com>
* xdgmimeparent.c (_xdg_mime_parent_list_lookup):
* xdgmimealias.c (_xdg_mime_alias_list_lookup): Protect
against stupid bsearch() implementations. (#159737,
Morten Welinder)
2004-11-24 Matthias Clasen <mclasen@redhat.com>
* xdgmimeparent.c (_xdg_mime_parent_read_from_file):
Initialize the parent field of the newly allocate list
entry. (#159330, Alex Larsson)
Fri Nov 19 15:10:32 2004 Manish Singh <yosh@gimp.org>
* xdgmime.c: Don't put /* within a comment.
2004-11-09 Matthias Clasen <mclasen@redhat.com>
* xdgmime.h: Prefix all symbols.
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>
* === Released 2.5.4 ===
2004-09-19 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.3 ===
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.2 ===
Wed Aug 11 20:44:35 2004 Matthias Clasen <maclas@gmx.de>
* xdgmime.h (xdg_mime_shutdown): Add the XDG_PREFIX to
this function as well.
2004-08-01 Matthias Clasen <mclasen@redhat.com>
* === Released 2.5.1 ===
Tue Jul 20 22:24:35 2004 Matthias Clasen <maclas@gmx.de>
* xdgmimeglob.h: Remove trailing commas from
enumerations. (#148035)
Sun Jul 18 20:17:41 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* === Released 2.5.0 ==
Thu May 27 15:23:17 2004 Jonathan Blandford <jrb@gnome.org>
* Sync from upstream
Fri Apr 30 00:19:11 2004 Matthias Clasen <maclas@gmx.de>
* xdgmimemagic.c (_xdg_mime_magic_read_a_number): Make sure
the static string is long enough. (#136323, Morten Welinder)
2004-03-12 Morten Welinder <terra@gnome.org>
* *.c: Make sure to include <config.h> (#137001)
Wed Mar 10 22:48:15 2004 Jonathan Blandford <jrb@gnome.org>
* Sync from upstream
Sun Feb 8 19:05:16 2004 Manish Singh <yosh@gimp.org>
* xdgmimeint.h: declare _xdg_utf8_skip as extern to prevent multiple
definitions.
Wed Jan 21 09:33:13 2004 Jonathan Blandford <jrb@gnome.org>
* libgnomevfs/xdgmimeglob.c:
* libgnomevfs/xdgmimemagic.c: Sync from upstream
Tue Jan 20 13:07:04 2004 Jonathan Blandford <jrb@gnome.org>
* xdgmime.c: resync with upstream sources.
Fri Oct 24 16:54:57 2003 Owen Taylor <otaylor@redhat.com>
* Makefile.am (libxdgmime_la_SOURCES): Add .h files to
SOURCES.
Fri Oct 24 16:02:32 2003 Owen Taylor <otaylor@redhat.com>
* *.[ch]: Relicense to be dual AFL/LGPL (and thus also
GPL) rather than AFL/GPL. Also update AFL version to 1.2.
Tue Jul 22 15:37:45 2003 Jonathan Blandford <jrb@gnome.org>
* xdgmime/xdgmime.c (xdg_mime_init): use XDG_DATA_HOME instead of
XDG_CONFIG_HOME.
include $(top_srcdir)/Makefile.decl
INCLUDES = -DXDG_PREFIX=_gtk_xdg
noinst_LTLIBRARIES = libxdgmime.la
libxdgmime_la_SOURCES = \
xdgmime.c \
xdgmime.h \
xdgmimealias.c \
xdgmimealias.h \
xdgmimecache.c \
xdgmimecache.h \
xdgmimeglob.c \
xdgmimeglob.h \
xdgmimeint.c \
xdgmimeint.h \
xdgmimemagic.c \
xdgmimemagic.h \
xdgmimeparent.c \
xdgmimeparent.h
noinst_PROGRAMS = test-mime
test_mime_LDADD = libxdgmime.la
test_mime_SOURCES = test-mime.c
/*
* Copyright (C) 2003,2004 Red Hat, Inc.
* Copyright (C) 2003,2004 Jonathan Blandford <jrb@alum.mit.edu>
*
* Licensed under the Academic Free License version 2.0
* Or under the following terms:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "xdgmime.h"
#include "xdgmimeglob.h"
#include <string.h>
#include <stdio.h>
static void
test_individual_glob (const char *glob,
XdgGlobType expected_type)
{
XdgGlobType test_type;
test_type = _xdg_glob_determine_type (glob);
if (test_type != expected_type)
{
printf ("Test Failed: %s is of type %s, but %s is expected\n",
glob,
((test_type == XDG_GLOB_LITERAL)?"XDG_GLOB_LITERAL":
((test_type == XDG_GLOB_SIMPLE)?"XDG_GLOB_SIMPLE":"XDG_GLOB_FULL")),
((expected_type == XDG_GLOB_LITERAL)?"XDG_GLOB_LITERAL":
((expected_type == XDG_GLOB_SIMPLE)?"XDG_GLOB_SIMPLE":"XDG_GLOB_COMPLEX")));
}
}
static void
test_glob_type (void)
{
test_individual_glob ("*.gif", XDG_GLOB_SIMPLE);
test_individual_glob ("Foo*.gif", XDG_GLOB_FULL);
test_individual_glob ("*[4].gif", XDG_GLOB_FULL);
test_individual_glob ("Makefile", XDG_GLOB_LITERAL);
test_individual_glob ("sldkfjvlsdf\\\\slkdjf", XDG_GLOB_FULL);
test_individual_glob ("tree.[ch]", XDG_GLOB_FULL);
}
static void
test_alias (const char *mime_a,
const char *mime_b,
int expected)
{
int actual;
actual = xdg_mime_mime_type_equal (mime_a, mime_b);
if (actual != expected)
{
printf ("Test Failed: %s is %s to %s\n",
mime_a, actual ? "equal" : "not equal", mime_b);
}
}
static void
test_aliasing (void)
{
test_alias ("application/wordperfect", "application/vnd.wordperfect", 1);
test_alias ("application/x-gnome-app-info", "application/x-desktop", 1);
test_alias ("application/x-wordperfect", "application/vnd.wordperfect", 1);
test_alias ("application/x-wordperfect", "audio/x-midi", 0);
test_alias ("/", "vnd/vnd", 0);
test_alias ("application/octet-stream", "text/plain", 0);
test_alias ("text/plain", "text/*", 0);
}
static void
test_subclass (const char *mime_a,
const char *mime_b,
int expected)
{
int actual;
actual = xdg_mime_mime_type_subclass (mime_a, mime_b);
if (actual != expected)
{
printf ("Test Failed: %s is %s of %s\n",
mime_a, actual ? "subclass" : "not subclass", mime_b);
}
}
static void
test_subclassing (void)
{
test_subclass ("application/rtf", "text/plain", 1);
test_subclass ("message/news", "text/plain", 1);
test_subclass ("message/news", "message/*", 1);
test_subclass ("message/news", "text/*", 1);
test_subclass ("message/news", "application/octet-stream", 1);
test_subclass ("application/rtf", "application/octet-stream", 1);
test_subclass ("application/x-gnome-app-info", "text/plain", 1);
test_subclass ("image/x-djvu", "image/vnd.djvu", 1);
test_subclass ("image/vnd.djvu", "image/x-djvu", 1);
test_subclass ("image/vnd.djvu", "text/plain", 0);
test_subclass ("image/vnd.djvu", "text/*", 0);
test_subclass ("text/*", "text/plain", 0);
}
int
main (int argc, char *argv[])
{
const char *result;
const char *file_name;
int i;
test_glob_type ();
test_aliasing ();
test_subclassing ();
for (i = 1; i < argc; i++)
{
file_name = argv[i];
result = xdg_mime_get_mime_type_for_file (file_name, NULL);
printf ("File \"%s\" has a mime-type of %s\n", file_name, result);
}
#if 0
xdg_mime_dump ();
#endif
return 0;
}
/* -*- mode: C; c-file-style: "gnu" -*- */
/* xdgmime.c: XDG Mime Spec mime resolver. Based on version 0.11 of the spec.
*
* More info can be found at http://www.freedesktop.org/standards/
*
* Copyright (C) 2003,2004 Red Hat, Inc.
* Copyright (C) 2003,2004 Jonathan Blandford <jrb@alum.mit.edu>
*
* Licensed under the Academic Free License version 2.0
* Or under the following terms:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "xdgmime.h"
#include "xdgmimeint.h"
#include "xdgmimeglob.h"
#include "xdgmimemagic.h"
#include "xdgmimealias.h"
#include "xdgmimeparent.h"
#include "xdgmimecache.h"
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <assert.h>
typedef struct XdgDirTimeList XdgDirTimeList;
typedef struct XdgCallbackList XdgCallbackList;
static int need_reread = TRUE;
static time_t last_stat_time = 0;
static XdgGlobHash *global_hash = NULL;
static XdgMimeMagic *global_magic = NULL;
static XdgAliasList *alias_list = NULL;
static XdgParentList *parent_list = NULL;
static XdgDirTimeList *dir_time_list = NULL