tracker r1503 - in branches/xesam-support: . src/libtracker-common src/libtracker-db src/tracker-indexer src/trackerd
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1503 - in branches/xesam-support: . src/libtracker-common src/libtracker-db src/tracker-indexer src/trackerd
- Date: Tue, 27 May 2008 16:46:21 +0000 (UTC)
Author: pvanhoof
Date: Tue May 27 16:46:21 2008
New Revision: 1503
URL: http://svn.gnome.org/viewvc/tracker?rev=1503&view=rev
Log:
2008-05-27 Philip Van Hoof <pvanhoof gnome org>
* Merged xesam-support with indexer-split
svn merge -r 1495:1502 ../indexer-split
Added:
branches/xesam-support/src/libtracker-common/tracker-field-data.c
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-field-data.c
branches/xesam-support/src/libtracker-common/tracker-field-data.h
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-field-data.h
branches/xesam-support/src/libtracker-common/tracker-field.c
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-field.c
branches/xesam-support/src/libtracker-common/tracker-field.h
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-field.h
branches/xesam-support/src/libtracker-common/tracker-hal.c
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-hal.c
branches/xesam-support/src/libtracker-common/tracker-hal.h
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-hal.h
branches/xesam-support/src/libtracker-common/tracker-ontology.c
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-ontology.c
branches/xesam-support/src/libtracker-common/tracker-ontology.h
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-ontology.h
branches/xesam-support/src/libtracker-common/tracker-parser.c
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-parser.c
branches/xesam-support/src/libtracker-common/tracker-parser.h
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-parser.h
branches/xesam-support/src/libtracker-common/tracker-service.c
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-service.c
branches/xesam-support/src/libtracker-common/tracker-service.h
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-common/tracker-service.h
branches/xesam-support/src/libtracker-db/tracker-db-manager.c
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-db/tracker-db-manager.c
branches/xesam-support/src/libtracker-db/tracker-db-manager.h
- copied unchanged from r1502, /branches/indexer-split/src/libtracker-db/tracker-db-manager.h
Removed:
branches/xesam-support/src/tracker-indexer/tracker-field.c
branches/xesam-support/src/tracker-indexer/tracker-field.h
branches/xesam-support/src/tracker-indexer/tracker-ontology.c
branches/xesam-support/src/tracker-indexer/tracker-ontology.h
branches/xesam-support/src/tracker-indexer/tracker-service.c
branches/xesam-support/src/tracker-indexer/tracker-service.h
branches/xesam-support/src/trackerd/tracker-db-manager.c
branches/xesam-support/src/trackerd/tracker-db-manager.h
branches/xesam-support/src/trackerd/tracker-field-data.c
branches/xesam-support/src/trackerd/tracker-field-data.h
branches/xesam-support/src/trackerd/tracker-field.c
branches/xesam-support/src/trackerd/tracker-field.h
branches/xesam-support/src/trackerd/tracker-hal.c
branches/xesam-support/src/trackerd/tracker-hal.h
branches/xesam-support/src/trackerd/tracker-ontology.c
branches/xesam-support/src/trackerd/tracker-ontology.h
branches/xesam-support/src/trackerd/tracker-parser.c
branches/xesam-support/src/trackerd/tracker-parser.h
branches/xesam-support/src/trackerd/tracker-service.c
branches/xesam-support/src/trackerd/tracker-service.h
Modified:
branches/xesam-support/ChangeLog
branches/xesam-support/src/libtracker-common/Makefile.am
branches/xesam-support/src/libtracker-db/Makefile.am
branches/xesam-support/src/libtracker-db/tracker-db-interface.c
branches/xesam-support/src/libtracker-db/tracker-db-interface.h
branches/xesam-support/src/tracker-indexer/Makefile.am
branches/xesam-support/src/tracker-indexer/tracker-indexer.c
branches/xesam-support/src/trackerd/Makefile.am
branches/xesam-support/src/trackerd/tracker-db-email.c
branches/xesam-support/src/trackerd/tracker-db-sqlite.c
branches/xesam-support/src/trackerd/tracker-db-sqlite.h
branches/xesam-support/src/trackerd/tracker-db.c
branches/xesam-support/src/trackerd/tracker-dbus-files.c
branches/xesam-support/src/trackerd/tracker-dbus-metadata.c
branches/xesam-support/src/trackerd/tracker-dbus-search.c
branches/xesam-support/src/trackerd/tracker-dbus-xesam.c
branches/xesam-support/src/trackerd/tracker-indexer.c
branches/xesam-support/src/trackerd/tracker-main.c
branches/xesam-support/src/trackerd/tracker-main.h
branches/xesam-support/src/trackerd/tracker-metadata.c
branches/xesam-support/src/trackerd/tracker-process-files.c
branches/xesam-support/src/trackerd/tracker-query-tree.c
branches/xesam-support/src/trackerd/tracker-xesam-ontology.c
branches/xesam-support/src/trackerd/tracker-xesam-ontology.h
branches/xesam-support/src/trackerd/tracker-xesam-query.c
Modified: branches/xesam-support/src/libtracker-common/Makefile.am
==============================================================================
--- branches/xesam-support/src/libtracker-common/Makefile.am (original)
+++ branches/xesam-support/src/libtracker-common/Makefile.am Tue May 27 16:46:21 2008
@@ -1,8 +1,10 @@
INCLUDES = \
- $(GLIB2_CFLAGS) \
-DSHAREDIR=\""$(datadir)"\" \
-DG_LOG_DOMAIN=\"Tracker\" \
- -I$(top_srcdir)/src
+ -I$(top_srcdir)/src \
+ $(GLIB2_CFLAGS) \
+ $(PANGO_CFLAGS) \
+ $(HAL_CFLAGS)
noinst_LTLIBRARIES = libtracker-common.la
@@ -12,26 +14,48 @@
os_sources = tracker-os-dependant-unix.c
endif
-libtracker_common_la_SOURCES = \
- $(os_sources) \
- tracker-configuration.c \
- tracker-configuration.h \
- tracker-config.c \
- tracker-config.h \
- tracker-file-utils.c \
- tracker-file-utils.h \
- tracker-language.c \
- tracker-language.h \
- tracker-log.c \
- tracker-log.h \
- tracker-nfs-lock.c \
- tracker-nfs-lock.h \
- tracker-os-dependant.h \
- tracker-type-utils.c \
- tracker-type-utils.h \
- tracker-utils.c \
+if HAVE_HAL
+hal_sources = \
+ tracker-hal.c \
+ tracker-hal.h
+endif
+
+libtracker_common_la_SOURCES = \
+ $(os_sources) \
+ $(hal_sources) \
+ tracker-configuration.c \
+ tracker-configuration.h \
+ tracker-config.c \
+ tracker-config.h \
+ tracker-field.c \
+ tracker-field.h \
+ tracker-field-data.c \
+ tracker-field-data.h \
+ tracker-file-utils.c \
+ tracker-file-utils.h \
+ tracker-hal.c \
+ tracker-hal.h \
+ tracker-language.c \
+ tracker-language.h \
+ tracker-log.c \
+ tracker-log.h \
+ tracker-nfs-lock.c \
+ tracker-nfs-lock.h \
+ tracker-ontology.c \
+ tracker-ontology.h \
+ tracker-os-dependant.h \
+ tracker-parser.c \
+ tracker-parser.h \
+ tracker-service.c \
+ tracker-service.h \
+ tracker-type-utils.c \
+ tracker-type-utils.h \
+ tracker-utils.c \
tracker-utils.h
libtracker_common_la_LDFLAGS = -version-info 0:0:0
-libtracker_common_la_LIBADD = $(GLIB2_LIBS)
+libtracker_common_la_LIBADD = \
+ $(GLIB2_LIBS) \
+ $(PANGO_LIBS) \
+ $(HAL_LIBS)
Modified: branches/xesam-support/src/libtracker-db/Makefile.am
==============================================================================
--- branches/xesam-support/src/libtracker-db/Makefile.am (original)
+++ branches/xesam-support/src/libtracker-db/Makefile.am Tue May 27 16:46:21 2008
@@ -1,8 +1,11 @@
INCLUDES = \
-g \
- $(GLIB2_CFLAGS) \
+ -DSHAREDIR=\""$(datadir)"\" \
-DG_LOG_DOMAIN=\"Tracker\" \
- -I$(top_srcdir)/src
+ -I$(top_srcdir)/src \
+ $(GLIB2_CFLAGS) \
+ $(SQLITE3_CFLAGS) \
+ $(QDBM_CFLAGS)
noinst_LTLIBRARIES = libtracker-db.la
@@ -14,11 +17,12 @@
tracker-db-interface.c \
tracker-db-interface.h \
tracker-db-interface-sqlite.c \
- tracker-db-interface-sqlite.h
+ tracker-db-interface-sqlite.h \
+ tracker-db-manager.c \
+ tracker-db-manager.h
libtracker_db_la_LDFLAGS = -version-info 0:0:0
libtracker_db_la_LIBADD = \
$(GLIB2_LIBS) \
- $(GMIME_LIBS) \
$(SQLITE3_LIBS) \
$(QDBM_LIBS)
Modified: branches/xesam-support/src/libtracker-db/tracker-db-interface.c
==============================================================================
--- branches/xesam-support/src/libtracker-db/tracker-db-interface.c (original)
+++ branches/xesam-support/src/libtracker-db/tracker-db-interface.c Tue May 27 16:46:21 2008
@@ -1,4 +1,5 @@
-/* Tracker - DB abstraction
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
* Copyright (C) 2008 Nokia
*
* This library is free software; you can redistribute it and/or
Modified: branches/xesam-support/src/libtracker-db/tracker-db-interface.h
==============================================================================
--- branches/xesam-support/src/libtracker-db/tracker-db-interface.h (original)
+++ branches/xesam-support/src/libtracker-db/tracker-db-interface.h Tue May 27 16:46:21 2008
@@ -1,4 +1,5 @@
-/* Tracker - DB abstraction
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
* Copyright (C) 2008 Nokia
*
* This library is free software; you can redistribute it and/or
Modified: branches/xesam-support/src/tracker-indexer/Makefile.am
==============================================================================
--- branches/xesam-support/src/tracker-indexer/Makefile.am (original)
+++ branches/xesam-support/src/tracker-indexer/Makefile.am Tue May 27 16:46:21 2008
@@ -7,65 +7,20 @@
-DINDEXER_MODULES_DIR=\""$(libdir)"/tracker/indexer-modules\" \
$(GLIB2_CFLAGS) \
$(GMODULE_CFLAGS) \
- $(GMIME_CFLAGS) \
- $(HAL_CFLAGS) \
- $(SQLITE3_CFLAGS) \
- $(QDBM_CFLAGS) \
- $(UNAC_CFLAGS) \
-I$(top_srcdir)/src
-# if HAVE_INOTIFY
-# watch_sources = \
-# linux-inotify-syscalls.h \
-# tracker-inotify.c
-# else
-# if HAVE_FAM
-# watch_sources = tracker-fam.c
-# else
-# if OS_WIN32
-# watch_sources = tracker-win-fs-changes.c
-# else
-# watch_sources = tracker-poll.c
-# endif
-# endif
-# endif
-
-# if OS_WIN32
-# win_sources = tracker-os-dependant-win.c
-# else
-# unix_sources = tracker-os-dependant-unix.c
-# endif
-
-# if HAVE_HAL
-# hal_sources = \
-# tracker-hal.c \
-# tracker-hal.h
-# endif
-
bin_PROGRAMS = tracker-indexer
tracker_indexer_SOURCES = \
main.c \
- tracker-field.c \
- tracker-field.h \
tracker-indexer.c \
tracker-indexer.h \
tracker-indexer-module.c \
- tracker-indexer-module.h \
- tracker-ontology.c \
- tracker-ontology.h \
- tracker-service.c \
- tracker-service.h
+ tracker-indexer-module.h
tracker_indexer_LDADD = \
$(GLIB2_LIBS) \
$(GMODULE_LIBS) \
- $(FAM_LIBS) \
- $(GMIME_LIBS) \
- $(HAL_LIBS) \
- $(SQLITE3_LIBS) \
- $(QDBM_LIBS) \
- $(UNAC_LIBS) \
$(GTHREAD_LIBS) \
-lz \
-lm \
Modified: branches/xesam-support/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- branches/xesam-support/src/tracker-indexer/tracker-indexer.c (original)
+++ branches/xesam-support/src/tracker-indexer/tracker-indexer.c Tue May 27 16:46:21 2008
@@ -49,6 +49,7 @@
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-db/tracker-db-interface-sqlite.h>
+
#include <qdbm/depot.h>
#include "tracker-indexer.h"
Modified: branches/xesam-support/src/trackerd/Makefile.am
==============================================================================
--- branches/xesam-support/src/trackerd/Makefile.am (original)
+++ branches/xesam-support/src/trackerd/Makefile.am Tue May 27 16:46:21 2008
@@ -5,17 +5,16 @@
-DLOCALEDIR=\""$(localedir)"\" \
-DMAIL_MODULES_DIR=\""$(libdir)"/tracker/mail-modules\" \
-DG_LOG_DOMAIN=\"Tracker\" \
+ -I$(top_srcdir)/src \
$(GLIB2_CFLAGS) \
$(GMODULE_CFLAGS) \
$(PANGO_CFLAGS) \
$(GMIME_CFLAGS) \
- $(HAL_CFLAGS) \
$(FAM_CFLAGS) \
$(DBUS_CFLAGS) \
$(SQLITE3_CFLAGS) \
$(QDBM_CFLAGS) \
- $(UNAC_CFLAGS) \
- -I$(top_srcdir)/src
+ $(UNAC_CFLAGS)
if HAVE_INOTIFY
watch_sources = \
@@ -33,12 +32,6 @@
endif
endif
-if HAVE_HAL
-hal_sources = \
- tracker-hal.c \
- tracker-hal.h
-endif
-
mail_modulesdir = $(libdir)/tracker/mail-modules
mail_modules_LTLIBRARIES = \
libemail-evolution.la \
@@ -71,7 +64,6 @@
$(watch_sources) \
$(win_sources) \
$(unix_sources) \
- $(hal_sources) \
tracker-apps.c \
tracker-apps.h \
tracker-cache.c \
@@ -82,8 +74,6 @@
tracker-db-email.h \
tracker-db-sqlite.c \
tracker-db-sqlite.h \
- tracker-db-manager.c \
- tracker-db-manager.h \
tracker-dbus.c \
tracker-dbus.h \
tracker-dbus-daemon.c \
@@ -102,10 +92,6 @@
tracker-email.h \
tracker-email-utils.c \
tracker-email-utils.h \
- tracker-field.c \
- tracker-field.h \
- tracker-field-data.c \
- tracker-field-data.h \
tracker-indexer.c \
tracker-indexer.h \
tracker-index-stage.c \
@@ -115,10 +101,6 @@
tracker-marshal-main.c \
tracker-metadata.c \
tracker-metadata.h \
- tracker-ontology.c \
- tracker-ontology.h \
- tracker-parser.c \
- tracker-parser.h \
tracker-process-files.c \
tracker-process-files.h \
tracker-query-tree.c \
@@ -127,8 +109,6 @@
tracker-rdf-query.h \
tracker-utils.c \
tracker-utils.h \
- tracker-service.c \
- tracker-service.h \
tracker-ioprio.c \
tracker-ioprio.h \
tracker-watch.h \
@@ -156,7 +136,6 @@
$(DBUS_LIBS) \
$(PANGO_LIBS) \
$(GMIME_LIBS) \
- $(HAL_LIBS) \
$(SQLITE3_LIBS) \
$(QDBM_LIBS) \
$(UNAC_LIBS) \
Modified: branches/xesam-support/src/trackerd/tracker-db-email.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-email.c (original)
+++ branches/xesam-support/src/trackerd/tracker-db-email.c Tue May 27 16:46:21 2008
@@ -25,10 +25,10 @@
#include <glib/gstdio.h>
#include <libtracker-common/tracker-log.h>
+#include <libtracker-common/tracker-parser.h>
#include <libtracker-common/tracker-type-utils.h>
#include "tracker-db-email.h"
-#include "tracker-parser.h"
#define MAX_ADDRESSES 255
Modified: branches/xesam-support/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-sqlite.c (original)
+++ branches/xesam-support/src/trackerd/tracker-db-sqlite.c Tue May 27 16:46:21 2008
@@ -31,24 +31,23 @@
#include <libtracker-common/tracker-log.h>
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-utils.h>
#include <libtracker-common/tracker-nfs-lock.h>
#include <libtracker-db/tracker-db-interface-sqlite.h>
+#include <libtracker-db/tracker-db-manager.h>
#include "tracker-db-sqlite.h"
-#include "tracker-db-manager.h"
#include "tracker-indexer.h"
#include "tracker-cache.h"
#include "tracker-metadata.h"
#include "tracker-main.h"
#include "tracker-utils.h"
#include "tracker-watch.h"
-#include "tracker-ontology.h"
#include "tracker-query-tree.h"
#include "tracker-xesam.h"
-#include "tracker-main.h"
#include "tracker-xesam-ontology.h"
#define MAX_INDEX_TEXT_LENGTH 1048576
@@ -396,7 +395,7 @@
static void
load_generic_sql_file (TrackerDBInterface *iface, const gchar *sql_file, const gchar *delimiter) {
- char *filename, *query;
+ gchar *filename, *query;
filename = tracker_db_manager_get_sql_file (sql_file);
@@ -858,13 +857,13 @@
* If the file doesnt exist, creates a new file of size 0
*/
static TrackerDBInterface *
-open_db_interface (TrackerDatabase database)
+open_db_interface (TrackerDB db)
{
TrackerDBInterface *iface;
- const gchar *dbname;
+ const gchar *dbname;
- dbname = tracker_db_manager_get_file (database);
+ dbname = tracker_db_manager_get_file (db);
/* We pass a GThreadPool here, it should be the same pool for all opened
* SQLite databases */
@@ -873,14 +872,13 @@
set_params (iface,
- tracker_db_manager_get_cache_size (database),
- tracker_db_manager_get_page_size (database),
- tracker_db_manager_get_add_functions (database));
- return iface;
+ tracker_db_manager_get_cache_size (db),
+ tracker_db_manager_get_page_size (db),
+ tracker_db_manager_get_add_functions (db));
+ return iface;
}
-
DBConnection *
tracker_db_connect_common (void)
{
@@ -900,17 +898,19 @@
}
void
-tracker_db_attach_db (DBConnection *db_con, TrackerDatabase database)
+tracker_db_attach_db (DBConnection *db_con,
+ TrackerDB db)
{
- if (database != TRACKER_DB_COMMON && database != TRACKER_DB_CACHE) {
+ if (db != TRACKER_DB_COMMON &&
+ db != TRACKER_DB_CACHE) {
g_critical ("Attaching invalid database, expected common or cache database");
return;
}
tracker_db_exec_no_reply (db_con->db,
"ATTACH '%s' as %s",
- tracker_db_manager_get_file (database),
- tracker_db_manager_get_name (database));
+ tracker_db_manager_get_file (db),
+ tracker_db_manager_get_name (db));
}
static inline void
@@ -963,11 +963,9 @@
tracker_db_attach_db (db_con, TRACKER_DB_CACHE);
return db_con;
-
}
-
/* convenience function for process files thread */
DBConnection *
tracker_db_connect_xesam ()
Modified: branches/xesam-support/src/trackerd/tracker-db-sqlite.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-sqlite.h (original)
+++ branches/xesam-support/src/trackerd/tracker-db-sqlite.h Tue May 27 16:46:21 2008
@@ -23,11 +23,13 @@
#include <glib.h>
+#include <libtracker-common/tracker-field.h>
+#include <libtracker-common/tracker-field-data.h>
+#include <libtracker-common/tracker-ontology.h>
+
#include <libtracker-db/tracker-db-interface.h>
#include <libtracker-db/tracker-db-file-info.h>
-#include "tracker-field-data.h"
-#include "tracker-ontology.h"
#include "tracker-indexer.h"
#include "tracker-utils.h"
Modified: branches/xesam-support/src/trackerd/tracker-db.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db.c (original)
+++ branches/xesam-support/src/trackerd/tracker-db.c Tue May 27 16:46:21 2008
@@ -30,12 +30,12 @@
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-type-utils.h>
+#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-os-dependant.h>
#include "tracker-db.h"
#include "tracker-email.h"
#include "tracker-metadata.h"
-#include "tracker-ontology.h"
#include "tracker-process-files.h"
extern Tracker *tracker;
Modified: branches/xesam-support/src/trackerd/tracker-dbus-files.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-dbus-files.c (original)
+++ branches/xesam-support/src/trackerd/tracker-dbus-files.c Tue May 27 16:46:21 2008
@@ -27,13 +27,13 @@
#include <libtracker-common/tracker-log.h>
#include <libtracker-common/tracker-utils.h>
#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-type-utils.h>
#include "tracker-dbus.h"
#include "tracker-dbus-files.h"
#include "tracker-db.h"
#include "tracker-metadata.h"
-#include "tracker-ontology.h"
#include "tracker-marshal.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_DBUS_FILES, TrackerDBusFilesPriv))
Modified: branches/xesam-support/src/trackerd/tracker-dbus-metadata.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-dbus-metadata.c (original)
+++ branches/xesam-support/src/trackerd/tracker-dbus-metadata.c Tue May 27 16:46:21 2008
@@ -25,12 +25,12 @@
#include <string.h>
#include <libtracker-common/tracker-log.h>
+#include <libtracker-common/tracker-field-data.h>
#include <libtracker-common/tracker-utils.h>
#include "tracker-dbus.h"
#include "tracker-dbus-metadata.h"
#include "tracker-db.h"
-#include "tracker-field-data.h"
#include "tracker-marshal.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_DBUS_METADATA, TrackerDBusMetadataPriv))
Modified: branches/xesam-support/src/trackerd/tracker-dbus-search.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-dbus-search.c (original)
+++ branches/xesam-support/src/trackerd/tracker-dbus-search.c Tue May 27 16:46:21 2008
@@ -26,15 +26,15 @@
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-language.h>
#include <libtracker-common/tracker-log.h>
+#include <libtracker-common/tracker-ontology.h>
+#include <libtracker-common/tracker-parser.h>
#include <libtracker-common/tracker-utils.h>
#include "tracker-dbus.h"
#include "tracker-dbus-search.h"
-#include "tracker-parser.h"
#include "tracker-rdf-query.h"
#include "tracker-query-tree.h"
#include "tracker-indexer.h"
-#include "tracker-ontology.h"
#include "tracker-marshal.h"
#define DEFAULT_SEARCH_MAX_HITS 1024
Modified: branches/xesam-support/src/trackerd/tracker-dbus-xesam.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-dbus-xesam.c (original)
+++ branches/xesam-support/src/trackerd/tracker-dbus-xesam.c Tue May 27 16:46:21 2008
@@ -25,6 +25,7 @@
#include <libtracker-common/tracker-log.h>
#include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-utils.h>
#include "tracker-dbus.h"
@@ -34,7 +35,6 @@
#include "tracker-rdf-query.h"
#include "tracker-query-tree.h"
#include "tracker-indexer.h"
-#include "tracker-ontology.h"
#include "tracker-marshal.h"
enum {
Modified: branches/xesam-support/src/trackerd/tracker-indexer.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-indexer.c (original)
+++ branches/xesam-support/src/trackerd/tracker-indexer.c Tue May 27 16:46:21 2008
@@ -17,7 +17,6 @@
* Boston, MA 02110-1301, USA.
*/
-
/* Needed before including math.h for lrintf() */
#define _ISOC9X_SOURCE 1
#define _ISOC99_SOURCE 1
@@ -52,19 +51,20 @@
#include <libtracker-common/tracker-log.h>
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-hal.h>
+#include <libtracker-common/tracker-ontology.h>
+
+#include <libtracker-db/tracker-db-manager.h>
#include "tracker-query-tree.h"
#include "tracker-indexer.h"
#include "tracker-cache.h"
#include "tracker-dbus.h"
#include "tracker-dbus-daemon.h"
-#include "tracker-hal.h"
#include "tracker-process-files.h"
#include "tracker-query-tree.h"
#include "tracker-main.h"
-#include "tracker-ontology.h"
#include "tracker-status.h"
-#include "tracker-db-manager.h"
extern Tracker *tracker;
Modified: branches/xesam-support/src/trackerd/tracker-main.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-main.c (original)
+++ branches/xesam-support/src/trackerd/tracker-main.c Tue May 27 16:46:21 2008
@@ -43,17 +43,18 @@
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-language.h>
#include <libtracker-common/tracker-log.h>
+#include <libtracker-common/tracker-hal.h>
+#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-nfs-lock.h>
+#include <libtracker-db/tracker-db-manager.h>
+
#include "tracker-email.h"
#include "tracker-cache.h"
#include "tracker-dbus.h"
-#include "tracker-db-manager.h"
-#include "tracker-hal.h"
#include "tracker-indexer.h"
#include "tracker-process-files.h"
-#include "tracker-ontology.h"
#include "tracker-status.h"
#include "tracker-watch.h"
#include "tracker-xesam.h"
Modified: branches/xesam-support/src/trackerd/tracker-main.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-main.h (original)
+++ branches/xesam-support/src/trackerd/tracker-main.h Tue May 27 16:46:21 2008
@@ -31,12 +31,13 @@
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-language.h>
+#include <libtracker-common/tracker-parser.h>
+#include <libtracker-common/tracker-hal.h>
+
#include <libtracker-db/tracker-db-action.h>
-#include "tracker-parser.h"
#include "tracker-indexer.h"
#include "tracker-index-stage.h"
-#include "tracker-hal.h"
/* default performance options */
#define MAX_PROCESS_QUEUE_SIZE 100
Modified: branches/xesam-support/src/trackerd/tracker-metadata.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-metadata.c (original)
+++ branches/xesam-support/src/trackerd/tracker-metadata.c Tue May 27 16:46:21 2008
@@ -33,15 +33,13 @@
#include <libtracker-common/tracker-log.h>
#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-ontology.h>
#include <libtracker-common/tracker-os-dependant.h>
#include "tracker-metadata.h"
#include "tracker-utils.h"
-#include "tracker-ontology.h"
#include "tracker-main.h"
-extern Tracker *tracker;
-
char *
tracker_metadata_get_text_file (const char *uri, const char *mime)
{
Modified: branches/xesam-support/src/trackerd/tracker-process-files.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-process-files.c (original)
+++ branches/xesam-support/src/trackerd/tracker-process-files.c Tue May 27 16:46:21 2008
@@ -32,8 +32,10 @@
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-log.h>
-#include <libtracker-common/tracker-os-dependant.h>
#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-hal.h>
+#include <libtracker-common/tracker-os-dependant.h>
+#include <libtracker-common/tracker-service.h>
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-utils.h>
@@ -45,10 +47,8 @@
#include "tracker-dbus-daemon.h"
#include "tracker-cache.h"
#include "tracker-email.h"
-#include "tracker-hal.h"
#include "tracker-indexer.h"
#include "tracker-watch.h"
-#include "tracker-service.h"
#include "tracker-status.h"
#include "tracker-process-files.h"
Modified: branches/xesam-support/src/trackerd/tracker-query-tree.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-query-tree.c (original)
+++ branches/xesam-support/src/trackerd/tracker-query-tree.c Tue May 27 16:46:21 2008
@@ -33,11 +33,11 @@
#include <glib-object.h>
#include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-parser.h>
+#include <libtracker-common/tracker-ontology.h>
#include "tracker-query-tree.h"
-#include "tracker-parser.h"
#include "tracker-utils.h"
-#include "tracker-ontology.h"
#define TRACKER_QUERY_TREE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_QUERY_TREE, TrackerQueryTreePrivate))
Modified: branches/xesam-support/src/trackerd/tracker-xesam-ontology.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam-ontology.c (original)
+++ branches/xesam-support/src/trackerd/tracker-xesam-ontology.c Tue May 27 16:46:21 2008
@@ -24,7 +24,7 @@
#include <glib.h>
-//#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-field.h>
#include "tracker-xesam-ontology.h"
@@ -55,11 +55,9 @@
/* Field descriptions */
static GHashTable *metadata_table;
-
-
static void
xesam_ontology_mime_prefix_foreach (gpointer data,
- gpointer user_data)
+ gpointer user_data)
{
ServiceMimePrefixes *mime_prefix;
@@ -71,7 +69,7 @@
gpointer
xesam_ontology_hash_lookup_by_str (GHashTable *hash_table,
- const gchar *str)
+ const gchar *str)
{
gpointer *data;
gchar *str_lower;
@@ -84,8 +82,8 @@
}
gpointer
-xesam_ontology_hash_lookup_by_id (GHashTable *hash_table,
- gint id)
+xesam_ontology_hash_lookup_by_id (GHashTable *hash_table,
+ gint id)
{
gpointer *data;
gchar *str;
@@ -100,10 +98,13 @@
void
tracker_xesam_ontology_init (void)
{
-
- g_return_if_fail (service_id_table == NULL
- && service_table == NULL
- && mime_service == NULL);
+ if (service_id_table ||
+ service_table ||
+ mime_service ||
+ service_directory_table ||
+ metadata_table) {
+ return;
+ }
service_id_table = g_hash_table_new_full (g_str_hash,
g_str_equal,
@@ -127,7 +128,7 @@
metadata_table = g_hash_table_new_full (g_str_hash,
g_str_equal,
- NULL, //Pointer to the object name
+ NULL,
g_object_unref);
}
@@ -150,8 +151,8 @@
void
tracker_xesam_ontology_add_service_type (TrackerService *service,
- GSList *mimes,
- GSList *mime_prefixes)
+ GSList *mimes,
+ GSList *mime_prefixes)
{
GSList *mime, *prefix;
@@ -300,26 +301,6 @@
return tracker_service_get_id (service);
}
-/*
-gint
-tracker_xesam_ontology_get_id_of_parent_type (const gchar *service_str)
-{
- TrackerService *service;
- const gchar *parent = NULL;
-
- service = xesam_ontology_hash_lookup_by_str (service_table, service_str);
-
- if (service) {
- parent = tracker_service_get_parent (service);
- }
-
- if (!parent) {
- return -1;
- }
-
- return tracker_xesam_ontology_get_id_for_service_type (parent);
-}
-*/
TrackerDBType
tracker_xesam_ontology_get_db_for_service_type (const gchar *service_str)
@@ -374,37 +355,9 @@
return tracker_service_get_has_metadata (service);
}
-/* gboolean */
-/* tracker_xesam_ontology_service_type_has_thumbnails (const gchar *service_str) */
-/* { */
-/* TrackerService *service; */
-
-/* service = xesam_ontology_hash_lookup_by_str (service_table, service_str); */
-
-/* if (!service) { */
-/* return FALSE; */
-/* } */
-
-/* return tracker_service_get_has_thumbs (service); */
-/* } */
-
-/* gboolean */
-/* tracker_xesam_ontology_service_type_has_text (const char *service_str) */
-/* { */
-/* TrackerService *service; */
-
-/* service = xesam_ontology_hash_lookup_by_str (service_table, service_str); */
-
-/* if (!service) { */
-/* return FALSE; */
-/* } */
-
-/* return tracker_service_get_has_full_text (service); */
-/* } */
-
gint
tracker_xesam_ontology_metadata_key_in_service (const gchar *service_str,
- const gchar *meta_name)
+ const gchar *meta_name)
{
TrackerService *service;
gint i;
@@ -485,17 +438,11 @@
void
tracker_xesam_ontology_add_dir_to_service_type (const gchar *service,
- const gchar *path)
+ const gchar *path)
{
g_return_if_fail (service != NULL);
g_return_if_fail (path != NULL);
- /*
- if (!tracker_file_is_valid (path)) {
- g_debug ("Path:'%s' not valid, not adding it for service:'%s'", path, service);
- return;
- }
- */
g_debug ("Adding path:'%s' for service:'%s'", path, service);
service_directory_list = g_slist_prepend (service_directory_list,
@@ -508,7 +455,7 @@
void
tracker_xesam_ontology_remove_dir_to_service_type (const gchar *service,
- const gchar *path)
+ const gchar *path)
{
GSList *found;
@@ -556,7 +503,8 @@
void
tracker_xesam_ontology_add_field (TrackerField *field)
{
- g_return_if_fail (field != NULL && tracker_field_get_name (field) != NULL);
+ g_return_if_fail (TRACKER_IS_FIELD (field));
+ g_return_if_fail (tracker_field_get_name (field) != NULL);
g_hash_table_insert (metadata_table,
g_utf8_strdown (tracker_field_get_name (field), -1),
@@ -564,21 +512,17 @@
}
-static inline gboolean
-is_equal (const char *s1, const char *s2)
-{
- return (strcasecmp (s1, s2) == 0);
-}
-
gchar *
-tracker_xesam_ontology_get_field_column_in_services (const TrackerField *field,
- const gchar *service_type)
+tracker_xesam_ontology_get_field_column_in_services (TrackerField *field,
+ const gchar *service_type)
{
const gchar *field_name;
- const gchar *meta_name = tracker_field_get_name (field);
+ const gchar *meta_name;
+ gint key_field;
- int key_field = tracker_xesam_ontology_metadata_key_in_service (service_type,
- meta_name);
+ meta_name = tracker_field_get_name (field);
+ key_field = tracker_xesam_ontology_metadata_key_in_service (service_type,
+ meta_name);
if (key_field > 0) {
return g_strdup_printf ("KeyMetadata%d", key_field);
@@ -592,29 +536,18 @@
} else {
return NULL;
}
-/*
-
- if (is_equal (meta_name, "File:Path")) return g_strdup ("Path");
- if (is_equal (meta_name, "File:Name")) return g_strdup ("Name");
- if (is_equal (meta_name, "File:Mime")) return g_strdup ("Mime");
- if (is_equal (meta_name, "File:Size")) return g_strdup ("Size");
- if (is_equal (meta_name, "File:Rank")) return g_strdup ("Rank");
- if (is_equal (meta_name, "File:Modified")) return g_strdup ("IndexTime");
-
- return NULL;
-*/
}
gchar *
-tracker_xesam_ontology_get_display_field (const TrackerField *field)
+tracker_xesam_ontology_get_display_field (TrackerField *field)
{
TrackerFieldType type;
type = tracker_field_get_data_type (field);
- if (type == TRACKER_FIELD_TYPE_INDEX
- || type == TRACKER_FIELD_TYPE_STRING
- || type == TRACKER_FIELD_TYPE_DOUBLE) {
+ if (type == TRACKER_FIELD_TYPE_INDEX ||
+ type == TRACKER_FIELD_TYPE_STRING ||
+ type == TRACKER_FIELD_TYPE_DOUBLE) {
return g_strdup ("MetaDataDisplay");
}
@@ -622,9 +555,12 @@
}
gboolean
-tracker_xesam_ontology_field_is_child_of (const gchar *child, const gchar *parent) {
-
- const TrackerField *def_child, *def_parent;
+tracker_xesam_ontology_field_is_child_of (const gchar *child,
+ const gchar *parent)
+{
+ TrackerField *def_child;
+ TrackerField *def_parent;
+ const GSList *tmp;
def_child = tracker_xesam_ontology_get_field_def (child);
@@ -632,15 +568,12 @@
return FALSE;
}
-
def_parent = tracker_xesam_ontology_get_field_def (parent);
if (!def_parent) {
return FALSE;
}
- const GSList *tmp;
-
for (tmp = tracker_field_get_child_ids (def_parent); tmp; tmp = tmp->next) {
if (!tmp->data) return FALSE;
@@ -651,11 +584,9 @@
}
return FALSE;
-
}
-
-const TrackerField *
+TrackerField *
tracker_xesam_ontology_get_field_def (const gchar *name)
{
return xesam_ontology_hash_lookup_by_str (metadata_table, name);
@@ -664,7 +595,7 @@
const gchar *
tracker_xesam_ontology_get_field_id (const gchar *name)
{
- const TrackerField *field;
+ TrackerField *field;
field = tracker_xesam_ontology_get_field_def (name);
Modified: branches/xesam-support/src/trackerd/tracker-xesam-ontology.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam-ontology.h (original)
+++ branches/xesam-support/src/trackerd/tracker-xesam-ontology.h Tue May 27 16:46:21 2008
@@ -24,57 +24,44 @@
#include <glib-object.h>
-#include "tracker-service.h"
-#include "tracker-field.h"
+#include <libtracker-common/tracker-field.h>
+#include <libtracker-common/tracker-service.h>
G_BEGIN_DECLS
-void tracker_xesam_ontology_init (void);
-void tracker_xesam_ontology_shutdown (void);
-void tracker_xesam_ontology_add_service_type (TrackerService *service,
- GSList *mimes,
- GSList *mime_prefixes);
-TrackerService * tracker_xesam_ontology_get_service_type_by_name (const gchar *service_str);
-gchar * tracker_xesam_ontology_get_service_type_by_id (gint id);
-/* gchar * tracker_xesam_ontology_get_service_type_for_mime (const gchar *mime); */
-gint tracker_xesam_ontology_get_id_for_service_type (const gchar *service_str);
-gchar * tracker_xesam_ontology_get_parent_service (const gchar *service_str);
-gchar * tracker_xesam_ontology_get_parent_service_by_id (gint id);
-gint tracker_xesam_ontology_get_parent_id_for_service_id (gint id);
-TrackerDBType tracker_xesam_ontology_get_db_for_service_type (const gchar *service_str);
-/* gboolean tracker_xesam_ontology_service_type_has_embedded (const gchar *service_str); */
-gboolean tracker_xesam_ontology_is_valid_service_type (const gchar *service_str);
-/* gboolean tracker_xesam_ontology_service_type_has_metadata (const gchar *service_str); */
-/* gboolean tracker_xesam_ontology_service_type_has_thumbnails (const gchar *service_str); */
-/* gboolean tracker_xesam_ontology_service_type_has_text (const gchar *service_str); */
-/* gint tracker_xesam_ontology_metadata_key_in_service (const gchar *service_str, */
-/* const gchar *meta_name); */
-gboolean tracker_xesam_ontology_show_service_directories (const gchar *service_str);
-gboolean tracker_xesam_ontology_show_service_files (const gchar *service_str);
-
-
+void tracker_xesam_ontology_init (void);
+void tracker_xesam_ontology_shutdown (void);
+void tracker_xesam_ontology_add_service_type (TrackerService *service,
+ GSList *mimes,
+ GSList *mime_prefixes);
+TrackerService *tracker_xesam_ontology_get_service_type_by_name (const gchar *service_str);
+gchar * tracker_xesam_ontology_get_service_type_by_id (gint id);
+gint tracker_xesam_ontology_get_id_for_service_type (const gchar *service_str);
+gchar * tracker_xesam_ontology_get_parent_service (const gchar *service_str);
+gchar * tracker_xesam_ontology_get_parent_service_by_id (gint id);
+gint tracker_xesam_ontology_get_parent_id_for_service_id (gint id);
+TrackerDBType tracker_xesam_ontology_get_db_for_service_type (const gchar *service_str);
+gboolean tracker_xesam_ontology_is_valid_service_type (const gchar *service_str);
+gboolean tracker_xesam_ontology_show_service_directories (const gchar *service_str);
+gboolean tracker_xesam_ontology_show_service_files (const gchar *service_str);
/* Service directories */
-GSList * tracker_xesam_ontology_get_dirs_for_service_type (const gchar *service);
-void tracker_xesam_ontology_add_dir_to_service_type (const gchar *service,
- const gchar *path);
-void tracker_xesam_ontology_remove_dir_to_service_type (const gchar *service,
- const gchar *path);
-gchar * tracker_xesam_ontology_get_service_type_for_dir (const gchar *path);
-
-
-
+GSList * tracker_xesam_ontology_get_dirs_for_service_type (const gchar *service);
+void tracker_xesam_ontology_add_dir_to_service_type (const gchar *service,
+ const gchar *path);
+void tracker_xesam_ontology_remove_dir_to_service_type (const gchar *service,
+ const gchar *path);
+gchar * tracker_xesam_ontology_get_service_type_for_dir (const gchar *path);
/* Field handling */
-void tracker_xesam_ontology_add_field (TrackerField *field);
-gchar * tracker_xesam_ontology_get_field_column_in_services (const TrackerField *field,
- const gchar *service_type);
-gchar * tracker_xesam_ontology_get_display_field (const TrackerField *field);
-gboolean tracker_xesam_ontology_field_is_child_of (const gchar *child,
- const gchar *parent);
-const TrackerField *tracker_xesam_ontology_get_field_def (const gchar *name);
-const gchar * tracker_xesam_ontology_get_field_id (const gchar *name);
-
+void tracker_xesam_ontology_add_field (TrackerField *field);
+gchar * tracker_xesam_ontology_get_field_column_in_services (TrackerField *field,
+ const gchar *service_type);
+gchar * tracker_xesam_ontology_get_display_field (TrackerField *field);
+gboolean tracker_xesam_ontology_field_is_child_of (const gchar *child,
+ const gchar *parent);
+TrackerField * tracker_xesam_ontology_get_field_def (const gchar *name);
+const gchar * tracker_xesam_ontology_get_field_id (const gchar *name);
G_END_DECLS
Modified: branches/xesam-support/src/trackerd/tracker-xesam-query.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam-query.c (original)
+++ branches/xesam-support/src/trackerd/tracker-xesam-query.c Tue May 27 16:46:21 2008
@@ -22,12 +22,11 @@
#include <string.h>
#include <libtracker-common/tracker-log.h>
+#include <libtracker-common/tracker-field-data.h>
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-utils.h>
#include "tracker-xesam-query.h"
-#include "tracker-field-data.h"
-
/* XESAM Query Condition
<query>
@@ -44,7 +43,6 @@
</Condition>
*/
-
/* main elements */
#define ELEMENT_XESAM_QUERY "query"
#define ELEMENT_XESAM_USER_QUERY "userQuery"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]