tracker r2183 - in branches/indexer-split: . src/tracker-indexer tests/tracker-indexer
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2183 - in branches/indexer-split: . src/tracker-indexer tests/tracker-indexer
- Date: Thu, 28 Aug 2008 13:22:56 +0000 (UTC)
Author: pvanhoof
Date: Thu Aug 28 13:22:56 2008
New Revision: 2183
URL: http://svn.gnome.org/viewvc/tracker?rev=2183&view=rev
Log:
2008-08-28 Philip Van Hoof <philip codeminded be>
src/tracker-indexer/tracker-metadata-utils.c
src/tracker-indexer/tracker-metadata-utils.h
src/tracker-indexer/Makefile.am
tests/tracker-indexer/Makefile.am
configure.ac: Use Hildon's thumbnailer if available. Similar things
should be done for other thumbnailers too.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/configure.ac
branches/indexer-split/src/tracker-indexer/Makefile.am
branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c
branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.h
branches/indexer-split/tests/tracker-indexer/Makefile.am
Modified: branches/indexer-split/configure.ac
==============================================================================
--- branches/indexer-split/configure.ac (original)
+++ branches/indexer-split/configure.ac Thu Aug 28 13:22:56 2008
@@ -916,14 +916,17 @@
# Check for Hildon-thumbnail
##################################################################
-AC_ARG_ENABLE(hildon-thumbnail,
- AS_HELP_STRING([--disable-hildon-thumbnail], [Disable Hildon thumbnail]),,
- [enable_hildon_thumbnail=yes])
+PKG_CHECK_MODULES(HILDON_THUMBNAIL,
+ hildon-thumbnail,
+ [has_hildon_thumbnail=yes],
+ [has_hildon_thumbnail=no])
-if test "x$enable_hildon_thumbnail" = "xyes"; then
+if test "x$has_hildon_thumbnail" = "xyes"; then
AC_CHECK_PROG(HAVE_HILDON_THUMBNAIL,hildon-thumb-gdk-pixbuf,"yes","no",)
have_hildon_thumbnail="$HAVE_HILDON_THUMBNAIL"
else
+ HILDON_THUMBNAIL_CFLAGS=""
+ HILDON_THUMBNAIL_LIBS=""
have_hildon_thumbnail="no (disabled)"
fi
@@ -933,6 +936,9 @@
AC_DEFINE(HAVE_HILDON_THUMBNAIL, 1, [Define if we have hildon-thumbnail])
fi
+AC_SUBST(HILDON_THUMBNAIL_CFLAGS)
+AC_SUBST(HILDON_THUMBNAIL_LIBS)
+
AC_CONFIG_LINKS(tests/tracker-indexer/tracker-metadata.c:src/tracker-indexer/tracker-metadata.c
tests/tracker-indexer/tracker-metadata.h:src/tracker-indexer/tracker-metadata.h
tests/tracker-indexer/tracker-metadata-utils.c:src/tracker-indexer/tracker-metadata-utils.c
Modified: branches/indexer-split/src/tracker-indexer/Makefile.am
==============================================================================
--- branches/indexer-split/src/tracker-indexer/Makefile.am (original)
+++ branches/indexer-split/src/tracker-indexer/Makefile.am Thu Aug 28 13:22:56 2008
@@ -10,7 +10,8 @@
-I$(top_srcdir)/src \
$(DBUS_CFLAGS) \
$(PANGO_CFLAGS) \
- $(GMODULE_CFLAGS)
+ $(GMODULE_CFLAGS) \
+ $(HILDON_THUMBNAIL_CFLAGS)
libexec_PROGRAMS = tracker-indexer
@@ -42,6 +43,7 @@
$(PANGO_LIBS) \
$(GIO_LIBS) \
$(GLIB2_LIBS) \
+ $(HILDON_THUMBNAIL_LIBS) \
-lz \
-lm
Modified: branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c Thu Aug 28 13:22:56 2008
@@ -26,6 +26,14 @@
#include <gio/gio.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_HILDON_THUMBNAIL
+#include <hildon-thumbnail-factory.h>
+#endif
+
#include "tracker-metadata-utils.h"
#define METADATA_FILE_NAME_DELIMITED "File:NameDelimited"
@@ -49,6 +57,7 @@
} ProcessContext;
static ProcessContext *metadata_context = NULL;
+static void tracker_metadata_utils_get_thumbnail (const gchar *path, const gchar *mime);
static void
destroy_process_context (ProcessContext *context)
@@ -514,11 +523,15 @@
return text;
}
-gchar *
+static void
tracker_metadata_utils_get_thumbnail (const gchar *path,
const gchar *mime)
{
+#ifdef HAVE_HILDON_THUMBNAIL
+ hildon_thumbnail_factory_load (path, mime, 128, 128, NULL, NULL);
+#else
ProcessContext *context;
+
GString *thumbnail;
gchar *argv[5];
@@ -553,10 +566,13 @@
if (!thumbnail->str || !*thumbnail->str) {
g_string_free (thumbnail, TRUE);
- return NULL;
+ return;
}
g_debug ("Got thumbnail '%s' for '%s'", thumbnail->str, path);
- return g_string_free (thumbnail, FALSE);
+ g_string_free (thumbnail, TRUE);
+
+#endif
+
}
Modified: branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.h
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.h (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.h Thu Aug 28 13:22:56 2008
@@ -48,8 +48,6 @@
TrackerMetadata * tracker_metadata_utils_get_data (const gchar *path);
gchar * tracker_metadata_utils_get_text (const gchar *path);
-gchar * tracker_metadata_utils_get_thumbnail (const gchar *path,
- const gchar *mime);
GSList * tracker_metadata_utils_calculate_merge (TrackerMetadata *old_metadata,
TrackerMetadata *new_metadata);
Modified: branches/indexer-split/tests/tracker-indexer/Makefile.am
==============================================================================
--- branches/indexer-split/tests/tracker-indexer/Makefile.am (original)
+++ branches/indexer-split/tests/tracker-indexer/Makefile.am Thu Aug 28 13:22:56 2008
@@ -13,7 +13,8 @@
-I$(top_srcdir)/tests/common \
$(GMODULE_CFLAGS) \
$(GTHREAD_CFLAGS) \
- $(GLIB2_CFLAGS)
+ $(GLIB2_CFLAGS) \
+ $(HILDON_THUMBNAIL_CFLAGS)
tracker_metadata_utils_SOURCES = \
@@ -28,5 +29,6 @@
$(GMODULE_LIBS) \
$(GTHREAD_LIBS) \
$(GIO_LIBS) \
- $(GLIB2_LIBS)
+ $(GLIB2_LIBS) \
+ $(HILDON_THUMBNAIL_LIBS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]