tracker r2094 - in branches/indexer-split: . src/tracker-indexer
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2094 - in branches/indexer-split: . src/tracker-indexer
- Date: Mon, 18 Aug 2008 16:07:53 +0000 (UTC)
Author: carlosg
Date: Mon Aug 18 16:07:52 2008
New Revision: 2094
URL: http://svn.gnome.org/viewvc/tracker?rev=2094&view=rev
Log:
2008-08-18 Carlos Garnacho <carlos imendio com>
* src/tracker-indexer/tracker-indexer-module.[ch]:
* src/tracker-indexer/tracker-indexer.c:
* src/tracker-indexer/tracker-module.h: Move the module_name parameter
from TrackerFile to PathInfo, such information is internal to the
indexer, and modules shouldn't have to care about their own name.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c
branches/indexer-split/src/tracker-indexer/tracker-indexer-module.h
branches/indexer-split/src/tracker-indexer/tracker-indexer.c
branches/indexer-split/src/tracker-indexer/tracker-module.h
Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-module.c Mon Aug 18 16:07:52 2008
@@ -82,14 +82,12 @@
TrackerFile *
tracker_indexer_module_file_new (GModule *module,
- const gchar *module_name,
const gchar *path)
{
TrackerModuleFileGetDataFunc func;
TrackerFile *file = NULL;
file = g_slice_new0 (TrackerFile);
- file->module_name = g_strdup (module_name);
file->path = g_strdup (path);
if (g_module_symbol (module, "tracker_module_file_get_data", (gpointer *) &func)) {
@@ -110,7 +108,6 @@
(func) (file->data);
}
- g_free (file->module_name);
g_free (file->path);
g_slice_free (TrackerFile, file);
}
@@ -149,19 +146,9 @@
return TRUE;
} else {
- g_warning ("Could not get URI for '%s'", file->path);
-
g_free (tmp_dirname);
g_free (tmp_basename);
- if (dirname) {
- *dirname = NULL;
- }
-
- if (basename) {
- *basename = NULL;
- }
-
return FALSE;
}
}
Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-module.h
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-module.h (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-module.h Mon Aug 18 16:07:52 2008
@@ -36,7 +36,6 @@
G_CONST_RETURN gchar * tracker_indexer_module_get_name (GModule *module);
TrackerFile * tracker_indexer_module_file_new (GModule *module,
- const gchar *module_name,
const gchar *path);
void tracker_indexer_module_file_free (GModule *module,
TrackerFile *file);
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 Mon Aug 18 16:07:52 2008
@@ -138,6 +138,7 @@
struct PathInfo {
GModule *module;
TrackerFile *file;
+ gchar *module_name;
};
struct MetadataForeachData {
@@ -188,7 +189,8 @@
info = g_slice_new (PathInfo);
info->module = module;
- info->file = tracker_indexer_module_file_new (module, module_name, path);
+ info->module_name = g_strdup (module_name);
+ info->file = tracker_indexer_module_file_new (module, path);
return info;
}
@@ -197,6 +199,7 @@
path_info_free (PathInfo *info)
{
tracker_indexer_module_file_free (info->module, info->file);
+ g_free (info->module_name);
g_slice_free (PathInfo, info);
}
@@ -1064,13 +1067,10 @@
return;
}
- if (!tracker_indexer_module_file_get_uri (info->module,
- info->file,
- &dirname,
- &basename)) {
- return;
- }
-
+ tracker_indexer_module_file_get_uri (info->module,
+ info->file,
+ &dirname,
+ &basename);
id = tracker_db_check_service (service_def,
dirname,
basename);
@@ -1186,7 +1186,7 @@
guint service_id;
guint service_type_id;
- service_type = tracker_module_config_get_index_service (info->file->module_name);
+ service_type = tracker_module_config_get_index_service (info->module_name);
if (!tracker_indexer_module_file_get_uri (info->module,
info->file,
@@ -1525,7 +1525,7 @@
/* Set the current module */
g_free (indexer->private->current_module_name);
- indexer->private->current_module_name = g_strdup (info->file->module_name);
+ indexer->private->current_module_name = g_strdup (info->module_name);
/* Sleep to throttle back indexing */
tracker_throttle (indexer->private->config, 100);
@@ -1571,11 +1571,11 @@
path = g_build_filename (info->file->path, name, NULL);
- new_info = path_info_new (info->module, info->file->module_name, path);
+ new_info = path_info_new (info->module, info->module_name, path);
add_file (indexer, new_info);
if (recurse && g_file_test (path, G_FILE_TEST_IS_DIR)) {
- new_info = path_info_new (info->module, info->file->module_name, path);
+ new_info = path_info_new (info->module, info->module_name, path);
add_directory (indexer, new_info);
}
Modified: branches/indexer-split/src/tracker-indexer/tracker-module.h
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-module.h (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-module.h Mon Aug 18 16:07:52 2008
@@ -29,7 +29,6 @@
struct TrackerFile {
gchar *path;
- gchar *module_name;
gpointer data;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]