tracker r1829 - in branches/indexer-split: . src/tracker-indexer
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1829 - in branches/indexer-split: . src/tracker-indexer
- Date: Wed, 2 Jul 2008 14:53:56 +0000 (UTC)
Author: carlosg
Date: Wed Jul 2 14:53:56 2008
New Revision: 1829
URL: http://svn.gnome.org/viewvc/tracker?rev=1829&view=rev
Log:
2008-07-02 Carlos Garnacho <carlos imendio com>
* src/tracker-indexer/tracker-indexer.c:
* src/tracker-indexer/tracker-main.c: Get TrackerModuleConfig to get
available modules, directories to scan, etc...
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/tracker-indexer/tracker-indexer.c
branches/indexer-split/src/tracker-indexer/tracker-main.c
Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer.c (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer.c Wed Jul 2 14:53:56 2008
@@ -56,6 +56,7 @@
#include <libtracker-common/tracker-language.h>
#include <libtracker-common/tracker-parser.h>
#include <libtracker-common/tracker-ontology.h>
+#include <libtracker-common/tracker-module-config.h>
#include <libtracker-db/tracker-db-manager.h>
#include <libtracker-db/tracker-db-interface-sqlite.h>
@@ -83,7 +84,7 @@
GQueue *file_process_queue;
GQueue *modules_queue;
- GSList *module_names;
+ GList *module_names;
GHashTable *indexer_modules;
gchar *db_dir;
@@ -357,7 +358,7 @@
{
TrackerIndexerPrivate *priv;
gchar *index_file;
- GSList *m;
+ GList *m;
priv = TRACKER_INDEXER_GET_PRIVATE (indexer);
@@ -373,7 +374,7 @@
"tracker",
NULL);
- priv->module_names = tracker_config_get_index_modules (priv->config);
+ priv->module_names = tracker_module_config_get_modules ();
priv->indexer_modules = g_hash_table_new_full (g_str_hash,
g_str_equal,
@@ -383,6 +384,10 @@
for (m = priv->module_names; m; m = m->next) {
GModule *module;
+ if (!tracker_module_config_get_enabled (m->data)) {
+ continue;
+ }
+
module = tracker_indexer_module_load (m->data);
if (module) {
@@ -390,7 +395,7 @@
m->data, module);
}
}
-
+
index_file = g_build_filename (priv->db_dir, "file-index.db", NULL);
priv->index = tracker_index_new (index_file,
@@ -620,7 +625,7 @@
{
TrackerIndexerPrivate *priv;
GModule *module;
- gchar **dirs;
+ GList *dirs, *d;
gint i;
priv = TRACKER_INDEXER_GET_PRIVATE (indexer);
@@ -633,19 +638,17 @@
g_message ("Starting module:'%s'", module_name);
- dirs = tracker_indexer_module_get_directories (module);
+ dirs = tracker_module_config_get_monitor_recurse_directories (module_name);
g_return_if_fail (dirs != NULL);
- for (i = 0; dirs[i]; i++) {
+ for (d = dirs; d; d = d->next) {
PathInfo *info;
- info = path_info_new (module, dirs[i]);
+ info = path_info_new (module, d->data);
tracker_indexer_add_directory (indexer, info);
-
- g_free (dirs[i]);
}
- g_free (dirs);
+ g_list_free (dirs);
}
static gboolean
@@ -783,7 +786,7 @@
tracker_indexer_process_all (TrackerIndexer *indexer)
{
TrackerIndexerPrivate *priv;
- GSList *m;
+ GList *m;
priv = TRACKER_INDEXER_GET_PRIVATE (indexer);
Modified: branches/indexer-split/src/tracker-indexer/tracker-main.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-main.c (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-main.c Wed Jul 2 14:53:56 2008
@@ -33,6 +33,7 @@
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-log.h>
#include <libtracker-common/tracker-ontology.h>
+#include <libtracker-common/tracker-module-config.h>
#include <libtracker-db/tracker-db-manager.h>
#include "tracker-dbus.h"
@@ -193,6 +194,7 @@
g_free (filename);
tracker_db_manager_init (0, NULL);
+ tracker_module_config_init ();
g_free (data_dir);
g_free (user_data_dir);
@@ -205,6 +207,7 @@
g_message ("Shutting down...\n");
tracker_db_manager_shutdown (FALSE);
+ tracker_module_config_shutdown ();
}
gint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]