[maemo-commits] [maemo-commits] r15955 - in projects/haf/branches/hildon-thumbnail/daemonize: . daemon
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Sep 2 17:55:34 EEST 2008
- Previous message: [maemo-commits] r15954 - in projects/haf/branches/hildon-thumbnail/daemonize: . daemon daemon/plugins
- Next message: [maemo-commits] r15956 - projects/haf/branches/hildon-thumbnail/daemonize/daemon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: pvanhoof Date: 2008-09-02 17:55:33 +0300 (Tue, 02 Sep 2008) New Revision: 15955 Modified: projects/haf/branches/hildon-thumbnail/daemonize/config.h.in projects/haf/branches/hildon-thumbnail/daemonize/configure.ac projects/haf/branches/hildon-thumbnail/daemonize/daemon/Makefile.am projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.c Log: Support for GIO Modified: projects/haf/branches/hildon-thumbnail/daemonize/config.h.in =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/config.h.in 2008-09-02 14:47:35 UTC (rev 15954) +++ projects/haf/branches/hildon-thumbnail/daemonize/config.h.in 2008-09-02 14:55:33 UTC (rev 15955) @@ -3,6 +3,9 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H +/* GIO available in glib */ +#undef HAVE_GIO + /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H Modified: projects/haf/branches/hildon-thumbnail/daemonize/configure.ac =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/configure.ac 2008-09-02 14:47:35 UTC (rev 15954) +++ projects/haf/branches/hildon-thumbnail/daemonize/configure.ac 2008-09-02 14:55:33 UTC (rev 15955) @@ -60,11 +60,21 @@ # N -GLIB_CHECK="gio-2.0 glib-2.0 >= 2.4.0 gthread-2.0" +PKG_CHECK_MODULES(GIO, gio-2.0, [have_gio=yes], [have_gio=no]) + +if test x$have_gio == "xyes"; then +AC_DEFINE(HAVE_GIO, 1, [GIO available in glib]) +fi + +AC_SUBST(GIO_CFLAGS) +AC_SUBST(GIO_LIBS) + +GLIB_CHECK="glib-2.0 >= 2.4.0 gthread-2.0" PKG_CHECK_MODULES(GLIB, $GLIB_CHECK) AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_CFLAGS) + GNOMEVFS_CHECK="gnome-vfs-2.0 >= 2.4.0" PKG_CHECK_MODULES(GNOMEVFS, $GNOMEVFS_CHECK) AC_SUBST(GNOMEVFS_LIBS) Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/Makefile.am =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/daemon/Makefile.am 2008-09-02 14:47:35 UTC (rev 15954) +++ projects/haf/branches/hildon-thumbnail/daemonize/daemon/Makefile.am 2008-09-02 14:55:33 UTC (rev 15955) @@ -4,6 +4,8 @@ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(GMODULE_CFLAGS) \ + $(GIO_CFLAGS) \ + $(GNOMEVFS_CFLAGS) \ -DPLUGINS_DIR=\""$(libdir)/hildon-thumbnailer/plugins"\" @@ -25,7 +27,9 @@ hildon_thumbnailerd_LDADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ - $(GMODULE_LIBS) + $(GMODULE_LIBS) \ + $(GIO_LIBS) \ + $(GNOMEVFS_LIBS) # Services org.freedesktop.thumbnailer_servicedir = $(DBUS_SERVICES_DIR) Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.c =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.c 2008-09-02 14:47:35 UTC (rev 15954) +++ projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.c 2008-09-02 14:55:33 UTC (rev 15955) @@ -1,6 +1,12 @@ #include <glib.h> +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_GIO #include <gio/gio.h> +#endif #include <dbus/dbus-glib-bindings.h> @@ -105,10 +111,12 @@ static gchar * get_mime_type (const gchar *path) { + gchar *content_type; + +#ifdef HAVE_GIO GFileInfo *info; GFile *file; GError *error = NULL; - gchar *content_type; file = g_file_new_for_path (path); info = g_file_query_info (file, @@ -131,6 +139,9 @@ if (!content_type) { return g_strdup ("unknown"); } +#else + content_type = gnome_vfs_get_mime_type_from_uri (path); +#endif return content_type; }
- Previous message: [maemo-commits] r15954 - in projects/haf/branches/hildon-thumbnail/daemonize: . daemon daemon/plugins
- Next message: [maemo-commits] r15956 - projects/haf/branches/hildon-thumbnail/daemonize/daemon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]