tracker r2797 - in trunk: . docs/reference/libtracker-common src/tracker-extract src/tracker-indexer src/trackerd tests/tracker-extract
- From: mr svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2797 - in trunk: . docs/reference/libtracker-common src/tracker-extract src/tracker-indexer src/trackerd tests/tracker-extract
- Date: Thu, 15 Jan 2009 15:23:51 +0000 (UTC)
Author: mr
Date: Thu Jan 15 15:23:51 2009
New Revision: 2797
URL: http://svn.gnome.org/viewvc/tracker?rev=2797&view=rev
Log:
* docs/reference/libtracker-common/libtracker-common-docs.sgml:
* docs/reference/libtracker-common/libtracker-common.types:
Removed tracker-data-field.[ch] now that it is in libtracker-data,
fixes documentation build.
* src/tracker-extract/tracker-xmp.c: Small code clean up and fixed
3 warnings from missing include.
* src/tracker-indexer/Makefile.am:
* src/trackerd/Makefile.am: Don't link with
libtracker-evolution-plugin if we don't have support for it
enabled.
* tests/tracker-extract/Makefile.am: Don't try to build gstreamer
test cases if we don't have gstreamer support enabled.
Modified:
trunk/ChangeLog
trunk/docs/reference/libtracker-common/libtracker-common-docs.sgml
trunk/docs/reference/libtracker-common/libtracker-common.types
trunk/src/tracker-extract/tracker-escape.c
trunk/src/tracker-extract/tracker-escape.h
trunk/src/tracker-extract/tracker-xmp.c
trunk/src/tracker-indexer/Makefile.am
trunk/src/trackerd/Makefile.am
trunk/tests/tracker-extract/Makefile.am
Modified: trunk/docs/reference/libtracker-common/libtracker-common-docs.sgml
==============================================================================
--- trunk/docs/reference/libtracker-common/libtracker-common-docs.sgml (original)
+++ trunk/docs/reference/libtracker-common/libtracker-common-docs.sgml Thu Jan 15 15:23:51 2009
@@ -14,7 +14,6 @@
<!ENTITY tracker-hal SYSTEM "xml/tracker-hal.xml">
<!ENTITY tracker-file-utils SYSTEM "xml/tracker-file-utils.xml">
<!ENTITY tracker-field SYSTEM "xml/tracker-field.xml">
-<!ENTITY tracker-field-data SYSTEM "xml/tracker-field-data.xml">
<!ENTITY tracker-dbus SYSTEM "xml/tracker-dbus.xml">
<!ENTITY tracker-config SYSTEM "xml/tracker-config.xml">
<!ENTITY version SYSTEM "version.xml">
@@ -52,7 +51,6 @@
&tracker-ontology;
&tracker-service;
&tracker-field;
- &tracker-field-data;
</chapter>
<chapter>
Modified: trunk/docs/reference/libtracker-common/libtracker-common.types
==============================================================================
--- trunk/docs/reference/libtracker-common/libtracker-common.types (original)
+++ trunk/docs/reference/libtracker-common/libtracker-common.types Thu Jan 15 15:23:51 2009
@@ -2,7 +2,6 @@
tracker_config_get_type
tracker_field_get_type
-tracker_field_data_get_type
tracker_hal_get_type
tracker_language_get_type
tracker_service_get_type
Modified: trunk/src/tracker-extract/tracker-escape.c
==============================================================================
--- trunk/src/tracker-extract/tracker-escape.c (original)
+++ trunk/src/tracker-extract/tracker-escape.c Thu Jan 15 15:23:51 2009
@@ -19,10 +19,13 @@
*/
#include "config.h"
-#include "tracker-escape.h"
-#include <glib.h>
+
#include <string.h>
+#include <glib.h>
+
+#include "tracker-escape.h"
+
gchar *
tracker_escape_metadata (const gchar *str)
{
Modified: trunk/src/tracker-extract/tracker-escape.h
==============================================================================
--- trunk/src/tracker-extract/tracker-escape.h (original)
+++ trunk/src/tracker-extract/tracker-escape.h Thu Jan 15 15:23:51 2009
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2008, Nokia
*
@@ -24,9 +25,9 @@
G_BEGIN_DECLS
-gchar * tracker_escape_metadata (const gchar *str);
-gchar * tracker_escape_metadata_printf (const gchar *format,
- ...);
+gchar *tracker_escape_metadata (const gchar *str);
+gchar *tracker_escape_metadata_printf (const gchar *format,
+ ...);
G_END_DECLS
Modified: trunk/src/tracker-extract/tracker-xmp.c
==============================================================================
--- trunk/src/tracker-extract/tracker-xmp.c (original)
+++ trunk/src/tracker-extract/tracker-xmp.c Thu Jan 15 15:23:51 2009
@@ -18,42 +18,46 @@
* Boston, MA 02110-1301, USA.
*/
+#include "config.h"
+
#include <locale.h>
#include <string.h>
+
#include <glib.h>
-#include "config.h"
#include "tracker-xmp.h"
+#include "tracker-escape.h"
#ifdef HAVE_EXEMPI
#include <exempi/xmp.h>
#include <exempi/xmpconsts.h>
-static void tracker_xmp_iter (XmpPtr xmp,
+static void tracker_xmp_iter (XmpPtr xmp,
XmpIteratorPtr iter,
GHashTable *metadata,
- gboolean append);
-
-static void tracker_xmp_iter_simple (GHashTable *metadata,
- const gchar *schema,
- const gchar *path,
- const gchar *value,
- gboolean append);
-
+ gboolean append);
+static void tracker_xmp_iter_simple (GHashTable *metadata,
+ const gchar *schema,
+ const gchar *path,
+ const gchar *value,
+ gboolean append);
static void
-tracker_append_string_to_hash_table (GHashTable *metadata, const gchar *key, const gchar *value, gboolean append)
+tracker_append_string_to_hash_table (GHashTable *metadata,
+ const gchar *key,
+ const gchar *value,
+ gboolean append)
{
gchar *new_value;
if (append) {
gchar *orig;
- if (g_hash_table_lookup_extended (metadata, key, NULL, (gpointer)&orig )) {
+
+ if (g_hash_table_lookup_extended (metadata, key, NULL, (gpointer) &orig)) {
gchar *escaped;
escaped = tracker_escape_metadata (value);
-
new_value = g_strconcat (orig, "|", escaped, NULL);
g_free (escaped);
@@ -71,53 +75,76 @@
/* We have an array, now recursively iterate over it's children. Set 'append' to true so that all values of the array are added
under one entry. */
static void
-tracker_xmp_iter_array (XmpPtr xmp, GHashTable *metadata, const gchar *schema, const gchar *path)
+tracker_xmp_iter_array (XmpPtr xmp,
+ GHashTable *metadata,
+ const gchar *schema,
+ const gchar *path)
{
- XmpIteratorPtr iter = xmp_iterator_new (xmp, schema, path, XMP_ITER_JUSTCHILDREN);
- tracker_xmp_iter (xmp, iter, metadata, TRUE);
- xmp_iterator_free (iter);
+ XmpIteratorPtr iter;
+
+ iter = xmp_iterator_new (xmp, schema, path, XMP_ITER_JUSTCHILDREN);
+ tracker_xmp_iter (xmp, iter, metadata, TRUE);
+ xmp_iterator_free (iter);
}
/* We have an array, now recursively iterate over it's children. Set 'append' to false so that only one item is used. */
static void
-tracker_xmp_iter_alt_text (XmpPtr xmp, GHashTable *metadata, const gchar *schema, const gchar *path)
+tracker_xmp_iter_alt_text (XmpPtr xmp,
+ GHashTable *metadata,
+ const gchar *schema,
+ const gchar *path)
{
- XmpIteratorPtr iter = xmp_iterator_new (xmp, schema, path, XMP_ITER_JUSTCHILDREN);
- tracker_xmp_iter (xmp, iter, metadata, FALSE);
- xmp_iterator_free (iter);
+ XmpIteratorPtr iter;
+
+ iter = xmp_iterator_new (xmp, schema, path, XMP_ITER_JUSTCHILDREN);
+ tracker_xmp_iter (xmp, iter, metadata, FALSE);
+ xmp_iterator_free (iter);
}
/* We have a simple element, but need to iterate over the qualifiers */
static void
-tracker_xmp_iter_simple_qual (XmpPtr xmp, GHashTable *metadata,
- const gchar *schema, const gchar *path, const gchar *value, gboolean append)
+tracker_xmp_iter_simple_qual (XmpPtr xmp,
+ GHashTable *metadata,
+ const gchar *schema,
+ const gchar *path,
+ const gchar *value,
+ gboolean append)
{
- XmpIteratorPtr iter = xmp_iterator_new (xmp, schema, path, XMP_ITER_JUSTCHILDREN | XMP_ITER_JUSTLEAFNAME);
+ XmpIteratorPtr iter;
+ XmpStringPtr the_path;
+ XmpStringPtr the_prop;
+ gchar *locale;
+ gchar *sep;
+ gboolean ignore_element = FALSE;
- XmpStringPtr the_path = xmp_string_new ();
- XmpStringPtr the_prop = xmp_string_new ();
+ iter = xmp_iterator_new (xmp, schema, path, XMP_ITER_JUSTCHILDREN | XMP_ITER_JUSTLEAFNAME);
+
+ the_path = xmp_string_new ();
+ the_prop = xmp_string_new ();
+
+ locale = setlocale (LC_ALL, NULL);
+ sep = strchr (locale,'.');
- gchar *locale = setlocale (LC_ALL, NULL);
- gchar *sep = strchr (locale,'.');
if (sep) {
locale[sep - locale] = '\0';
}
+
sep = strchr (locale, '_');
if (sep) {
locale[sep - locale] = '-';
}
- gboolean ignore_element = FALSE;
-
while (xmp_iterator_next (iter, NULL, the_path, the_prop, NULL)) {
const gchar *qual_path = xmp_string_cstr (the_path);
const gchar *qual_value = xmp_string_cstr (the_prop);
if (strcmp (qual_path, "xml:lang") == 0) {
- /* is this a language we should ignore? */
- if (strcmp (qual_value, "x-default") != 0 && strcmp (qual_value, "x-repair") != 0 && strcmp (qual_value, locale) != 0) {
+ /* Is this a language we should ignore? */
+ if (strcmp (qual_value, "x-default") != 0 &&
+ strcmp (qual_value, "x-repair") != 0 &&
+ strcmp (qual_value, locale) != 0) {
ignore_element = TRUE;
break;
}
@@ -134,14 +161,22 @@
xmp_iterator_free (iter);
}
-
-/* We have a simple element. Add any metadata we know about to the hash table */
+/* We have a simple element. Add any metadata we know about to the
+ * hash table.
+ */
static void
-tracker_xmp_iter_simple (GHashTable *metadata,
- const gchar *schema, const gchar *path, const gchar *value, gboolean append)
+tracker_xmp_iter_simple (GHashTable *metadata,
+ const gchar *schema,
+ const gchar *path,
+ const gchar *value,
+ gboolean append)
{
- gchar *name = g_strdup (strchr (path, ':') + 1);
- const gchar *index = strrchr (name, '[');
+ gchar *name;
+ const gchar *index;
+
+ name = g_strdup (strchr (path, ':') + 1);
+ index = strrchr (name, '[');
+
if (index) {
name[index-name] = '\0';
}
@@ -283,20 +318,24 @@
}
}
-
g_free (name);
}
-/* Iterate over the XMP, dispatching to the appropriate element type (simple, simple w/qualifiers, or an array) handler */
+/* Iterate over the XMP, dispatching to the appropriate element type
+ * (simple, simple w/qualifiers, or an array) handler.
+ */
void
-tracker_xmp_iter (XmpPtr xmp, XmpIteratorPtr iter, GHashTable *metadata, gboolean append)
+tracker_xmp_iter (XmpPtr xmp,
+ XmpIteratorPtr iter,
+ GHashTable *metadata,
+ gboolean append)
{
XmpStringPtr the_schema = xmp_string_new ();
XmpStringPtr the_path = xmp_string_new ();
XmpStringPtr the_prop = xmp_string_new ();
-
uint32_t opt;
+
while (xmp_iterator_next (iter, the_schema, the_path, the_prop, &opt)) {
const gchar *schema = xmp_string_cstr (the_schema);
const gchar *path = xmp_string_cstr (the_path);
@@ -329,20 +368,25 @@
#endif /* HAVE_EXEMPI */
-
void
-tracker_read_xmp (const gchar *buffer, size_t len, GHashTable *metadata)
+tracker_read_xmp (const gchar *buffer,
+ size_t len,
+ GHashTable *metadata)
{
#ifdef HAVE_EXEMPI
+ XmpPtr xmp;
+
xmp_init ();
- XmpPtr xmp = xmp_new_empty ();
+ xmp = xmp_new_empty ();
xmp_parse (xmp, buffer, len);
+
if (xmp != NULL) {
- XmpIteratorPtr iter = xmp_iterator_new (xmp, NULL, NULL, XMP_ITER_PROPERTIES);
+ XmpIteratorPtr iter;
+
+ iter = xmp_iterator_new (xmp, NULL, NULL, XMP_ITER_PROPERTIES);
tracker_xmp_iter (xmp, iter, metadata, FALSE);
xmp_iterator_free (iter);
-
xmp_free (xmp);
}
Modified: trunk/src/tracker-indexer/Makefile.am
==============================================================================
--- trunk/src/tracker-indexer/Makefile.am (original)
+++ trunk/src/tracker-indexer/Makefile.am Thu Jan 15 15:23:51 2009
@@ -50,13 +50,18 @@
tracker-removable-device.c \
tracker-removable-device.h
+if HAVE_EVOLUTION_PLUGIN
+plugin_libs = \
+ $(top_builddir)/src/plugins/evolution/libtracker-evolution-indexer.la
+endif
+
tracker_indexer_LDADD = \
+ $(plugin_libs) \
libtracker-module.la \
$(top_builddir)/src/libtracker-data/libtracker-data.la \
$(top_builddir)/src/libtracker-db/libtracker-db.la \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
$(top_builddir)/src/libstemmer/libstemmer.la \
- $(top_builddir)/src/plugins/evolution/libtracker-evolution-indexer.la \
$(trackerd_win_libs) \
$(DBUS_LIBS) \
$(GMODULE_LIBS) \
Modified: trunk/src/trackerd/Makefile.am
==============================================================================
--- trunk/src/trackerd/Makefile.am (original)
+++ trunk/src/trackerd/Makefile.am Thu Jan 15 15:23:51 2009
@@ -72,12 +72,17 @@
trackerd_win_libs = -lws2_32 -lkernel32
endif
+if HAVE_EVOLUTION_PLUGIN
+plugin_libs = \
+ $(top_builddir)/src/plugins/evolution/libtracker-evolution.la
+endif
+
trackerd_LDADD = \
+ $(plugin_libs) \
$(top_builddir)/src/libtracker-data/libtracker-data.la \
$(top_builddir)/src/libtracker-db/libtracker-db.la \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
$(top_builddir)/src/libstemmer/libstemmer.la \
- $(top_builddir)/src/plugins/evolution/libtracker-evolution.la \
$(inotify_libs) \
$(GMIME_LIBS) \
$(FAM_LIBS) \
Modified: trunk/tests/tracker-extract/Makefile.am
==============================================================================
--- trunk/tests/tracker-extract/Makefile.am (original)
+++ trunk/tests/tracker-extract/Makefile.am Thu Jan 15 15:23:51 2009
@@ -9,8 +9,12 @@
TEST_PROGS += \
- test-tracker-extract-mp3 \
+ test-tracker-extract-mp3
+
+if HAVE_GSTREAMER
+TEST_PROGS += \
test-tracker-extract-gstreamer
+endif
INCLUDES = \
-DG_LOG_DOMAIN=\"Tracker\" \
@@ -35,6 +39,8 @@
$(GTHREAD_LIBS) \
$(GLIB2_LIBS)
+if HAVE_GSTREAMER
+
test_tracker_extract_gstreamer_SOURCES = \
tracker-extract-gstreamer-test.c \
$(TEST_UTILS_SOURCES)
@@ -45,4 +51,6 @@
$(GMODULE_LIBS) \
$(GTHREAD_LIBS) \
$(GLIB2_LIBS) \
- $(GSTREAMER_LIBS)
\ No newline at end of file
+ $(GSTREAMER_LIBS)
+
+endif
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]