tracker r2069 - in branches/indexer-split: . src/libtracker-common src/tracker-indexer
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2069 - in branches/indexer-split: . src/libtracker-common src/tracker-indexer
- Date: Wed, 13 Aug 2008 14:26:35 +0000 (UTC)
Author: carlosg
Date: Wed Aug 13 14:26:35 2008
New Revision: 2069
URL: http://svn.gnome.org/viewvc/tracker?rev=2069&view=rev
Log:
2008-08-12 Carlos Garnacho <carlos imendio com>
* src/libtracker-common/tracker-parser.c
(tracker_parser_text_to_string): Check we're dealing with sane UTF8.
* src/tracker-indexer/tracker-indexer.c (index_metadata_item): Handle
the case where tracker_parser_text_to_string() returns NULL.
(delete_item) (create_update_item): Add debug messages that give a
better clue about what is it doing at that moment.
(process_file): Remove debug message from here.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/libtracker-common/tracker-parser.c
branches/indexer-split/src/tracker-indexer/tracker-indexer.c
Modified: branches/indexer-split/src/libtracker-common/tracker-parser.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-parser.c (original)
+++ branches/indexer-split/src/libtracker-common/tracker-parser.c Wed Aug 13 14:26:35 2008
@@ -353,6 +353,7 @@
gchar *parsed_text;
gchar *word = NULL;
guint32 i = 0;
+ gint len;
g_return_val_if_fail (language != NULL, NULL);
@@ -360,6 +361,13 @@
return NULL;
}
+ len = strlen (txt);
+ len = MIN (len, 500);
+
+ if (!g_utf8_validate (txt, len, NULL)) {
+ return NULL;
+ }
+
if (text_needs_pango (txt)) {
/* CJK text does not need stemming or other
* treatment.
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 Aug 13 14:26:35 2008
@@ -790,6 +790,11 @@
tracker_field_get_filtered (field),
tracker_field_get_filtered (field),
tracker_field_get_delimited (field));
+
+ if (!parsed_value) {
+ return;
+ }
+
arr = g_strsplit (parsed_value, " ", -1);
for (i = 0; arr[i]; i++) {
@@ -1019,6 +1024,8 @@
tracker_indexer_module_file_get_uri (info->module, info->file, &dirname, &basename);
id = tracker_db_check_service (service_def, dirname, basename);
+ g_debug ("Processing item:'%s/%s'", dirname, basename);
+
/* FIXME: should check mtime and reindex if necessary */
if (id == 0) {
@@ -1120,6 +1127,8 @@
return;
}
+ g_debug ("Deleting item:'%s/%s'", dirname, basename);
+
if (!service_type || !service_type[0]) {
gchar *name;
@@ -1145,7 +1154,7 @@
g_free (basename);
if (service_id < 1) {
- g_message ("Can not delete file, it doesnt exist in DB");
+ g_debug ("Can not delete file, it doesnt exist in DB");
return;
}
@@ -1414,8 +1423,6 @@
{
TrackerMetadata *metadata;
- g_debug ("Processing file:'%s'", info->file->path);
-
/* Set the current module */
g_free (indexer->private->current_module_name);
indexer->private->current_module_name = g_strdup (info->file->module_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]