tracker r1254 - in trunk: . data data/services src/tracker-preferences src/trackerd
- From: ifrade svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1254 - in trunk: . data data/services src/tracker-preferences src/trackerd
- Date: Tue, 8 Apr 2008 11:09:46 +0100 (BST)
Author: ifrade
Date: Tue Apr 8 11:09:46 2008
New Revision: 1254
URL: http://svn.gnome.org/viewvc/tracker?rev=1254&view=rev
Log:
Commit bug #523200: Service type encapsulated in GObject
Modified:
trunk/ChangeLog
trunk/data/services/default.service
trunk/data/sqlite-stored-procs.sql
trunk/src/tracker-preferences/tracker-preferences.c
trunk/src/trackerd/Makefile.am
trunk/src/trackerd/tracker-db-email.c
trunk/src/trackerd/tracker-db-sqlite.c
trunk/src/trackerd/tracker-db-sqlite.h
trunk/src/trackerd/tracker-db.c
trunk/src/trackerd/tracker-dbus-files.c
trunk/src/trackerd/tracker-dbus-keywords.c
trunk/src/trackerd/tracker-dbus-metadata.c
trunk/src/trackerd/tracker-dbus-methods.c
trunk/src/trackerd/tracker-dbus-search.c
trunk/src/trackerd/tracker-dbus.c
trunk/src/trackerd/tracker-dbus.h
trunk/src/trackerd/tracker-indexer.c
trunk/src/trackerd/tracker-metadata.c
trunk/src/trackerd/tracker-process-files.c
trunk/src/trackerd/tracker-rdf-query.c
trunk/src/trackerd/tracker-utils.c
trunk/src/trackerd/tracker-utils.h
trunk/src/trackerd/trackerd.c
Modified: trunk/data/services/default.service
==============================================================================
--- trunk/data/services/default.service (original)
+++ trunk/data/services/default.service Tue Apr 8 11:09:46 2008
@@ -33,6 +33,9 @@
MimePrefixes=application/vnd.oasis.opendocument;application/vnd.sun.xml;application/vnd.stardivision;
ShowServiceFiles=true
ShowServiceDirectories=true
+HasMetadata=true
+HasFullText=true
+HasThumbs=true
[WebHistory]
DisplayName=Web History
@@ -47,7 +50,9 @@
TileMetadata=Doc:Title;Doc:URL;Doc:Subject;Doc:Author;Doc:Created;Doc:PageCount;File:Size;
ShowServiceFiles=false
ShowServiceDirectories=false
-
+HasMetadata=true
+HasFullText=true
+HasThumbs=true
[Images]
@@ -69,6 +74,9 @@
MimePrefixes=image/;
ShowServiceFiles=true
ShowServiceDirectories=true
+HasMetadata=true
+HasFullText=false
+HasThumbs=true
[Music]
@@ -95,6 +103,9 @@
MimePrefixes=audio/;
ShowServiceFiles=true
ShowServiceDirectories=true
+HasMetadata=true
+HasFullText=false
+HasThumbs=false
[Videos]
@@ -115,6 +126,9 @@
MimePrefixes=video/;
ShowServiceFiles=true
ShowServiceDirectories=true
+HasMetadata=true
+HasFullText=false
+HasThumbs=true
[Text]
@@ -127,6 +141,9 @@
Mimes=text/plain;text/x-authors;text/x-changelog;text/x-copying;text/x-credits;text/x-install;text/x-readme;
ShowServiceFiles=true
ShowServiceDirectories=true
+HasMetadata=false
+HasFullText=true
+HasThumbs=false
[Development]
@@ -139,6 +156,9 @@
Mimes=application/x-perl;application/x-shellscript;application/x-php;application/x-java;application/x-javascript;application/x-glade;application/x-csh;application/x-class-file;application/x-awk;application/x-asp;application/x-ruby;application/x-m4;text/x-m4;text/x-c++;text/x-adasrc;text/x-c;text/x-c++hdr;text/x-chdr;text/x-csharp;text/x-c++src;text/x-csrc;text/x-dcl;text/x-dsrc;text/x-emacs-lisp;text/x-fortran;text/x-haskell;text/x-literate-haskell;text/x-java;text/x-java-source" ,text/x-makefile;text/x-objcsrc;text/x-pascal;text/x-patch;text/x-python;text/x-scheme;text/x-sql;text/x-tcl;
ShowServiceFiles=true
ShowServiceDirectories=true
+HasMetadata=false
+HasFullText=true
+HasThumbs=false
[Other]
DisplayName=Other Files
@@ -146,6 +166,9 @@
Parent=Files
ShowServiceFiles=true
ShowServiceDirectories=true
+HasMetadata=true
+HasFullText=true
+HasThumbs=true
[Emails]
DisplayName=Emails
@@ -218,6 +241,9 @@
UIVisible=true
Icon=stock_help-chat
ShowServiceFiles=true
+HasMetadata=false
+HasFullText=true
+HasThumbs=false
[GaimConversations]
DisplayName=Gaim Conversations
@@ -225,6 +251,9 @@
Parent=Conversations
Icon=stock_help-chat
ShowServiceFiles=true
+HasMetadata=false
+HasFullText=true
+HasThumbs=false
[Applications]
DisplayName=Applications
@@ -236,3 +265,6 @@
KeyMetadata2=App:Exec
KeyMetadata3=App:Icon
TileMetadata=App:GenericName;AppComment;App:Categories
+HasMetadata=false
+HasFullText=false
+HasThumbs=false
Modified: trunk/data/sqlite-stored-procs.sql
==============================================================================
--- trunk/data/sqlite-stored-procs.sql (original)
+++ trunk/data/sqlite-stored-procs.sql Tue Apr 8 11:09:46 2008
@@ -124,6 +124,9 @@
InsertMimes replace into FileMimes (Mime) Values (?);
InsertMimePrefixes replace into FileMimePrefixes (MimePrefix) Values (?);
+GetMimeForServiceId select Mime from FileMimes where ServiceTypeId = ?;
+GetMimePrefixeForServiceId select MimePrefix from FileMimesPrefix where ServiceTypeId = ?;
+
ExistsPendingFiles select count (*) from FilePending where Action <> 20;
InsertPendingFile INSERT INTO FilePending (FileID, Action, PendingDate, FileUri, MimeType, IsDir, IsNew, RefreshEmbedded, RefreshContents, ServiceTypeID) VALUES (?,?,?,?,?,?,?,?,?,?);
CountPendingMetadataFiles select count (*) from FilePending where Action = 20;
Modified: trunk/src/tracker-preferences/tracker-preferences.c
==============================================================================
--- trunk/src/tracker-preferences/tracker-preferences.c (original)
+++ trunk/src/tracker-preferences/tracker-preferences.c Tue Apr 8 11:09:46 2008
@@ -206,7 +206,7 @@
}
priv->tracker_proxy = dbus_g_proxy_new_for_name (priv->connection,
- TRACKER_SERVICE,
+ TRACKER_DBUS_SERVICE,
TRACKER_OBJECT,
TRACKER_INTERFACE);
@@ -490,7 +490,7 @@
const gchar *prev_owner, const gchar *new_owner,
gpointer data)
{
- if (!g_str_equal (name, TRACKER_SERVICE))
+ if (!g_str_equal (name, TRACKER_DBUS_SERVICE))
return;
if (!first_time)
Modified: trunk/src/trackerd/Makefile.am
==============================================================================
--- trunk/src/trackerd/Makefile.am (original)
+++ trunk/src/trackerd/Makefile.am Tue Apr 8 11:09:46 2008
@@ -91,6 +91,10 @@
tracker-rdf-query.h \
tracker-utils.c \
tracker-utils.h \
+ tracker-service.c \
+ tracker-service.h \
+ tracker-service-manager.c \
+ tracker-service-manager.h \
tracker-ioprio.c \
tracker-ioprio.h \
tracker-os-dependant.h \
Modified: trunk/src/trackerd/tracker-db-email.c
==============================================================================
--- trunk/src/trackerd/tracker-db-email.c (original)
+++ trunk/src/trackerd/tracker-db-email.c Tue Apr 8 11:09:46 2008
@@ -529,7 +529,7 @@
}
- type_id = tracker_get_id_for_service (service);
+ type_id = tracker_service_manager_get_id_for_service (service);
if (type_id == -1) {
tracker_error ("ERROR: service %s not found", service);
g_free (attachment_service);
Modified: trunk/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- trunk/src/trackerd/tracker-db-sqlite.c (original)
+++ trunk/src/trackerd/tracker-db-sqlite.c Tue Apr 8 11:09:46 2008
@@ -52,6 +52,7 @@
#include "tracker-metadata.h"
#include "tracker-utils.h"
#include "tracker-watch.h"
+#include "tracker-service-manager.h"
#define MAX_TEXT_BUFFER 65567
#define MAX_COMPRESS_BUFFER 65565
@@ -189,9 +190,9 @@
}
default:{
- char *output;
+ gchar *output;
- output = tracker_get_service_by_id (sqlite3_value_int (argv[0]));
+ output = tracker_service_manager_get_service_by_id (sqlite3_value_int (argv[0]));
sqlite3_result_text (context, output, strlen (output), g_free);
}
}
@@ -209,9 +210,11 @@
}
default:{
- int output;
+ const gchar *service;
+ gint output;
- output = tracker_get_id_for_service ((char *) sqlite3_value_text (argv[0]));
+ service = (const gchar*) sqlite3_value_text (argv[0]);
+ output = tracker_service_manager_get_id_for_service (service);
sqlite3_result_int (context, output);
}
}
@@ -229,9 +232,11 @@
}
default:{
- int output;
+ const gchar *service;
+ gint output;
- output = tracker_get_id_for_service ((char *) sqlite3_value_text (argv[0]));
+ service = (const gchar*) sqlite3_value_text (argv[0]);
+ output = tracker_service_manager_get_id_for_service (service);
if (output == 0) {
output = 8;
@@ -780,7 +785,7 @@
open_common_db (db_con);
- db_con->db_type = DB_COMMON;
+ db_con->db_type = TRACKER_DB_TYPE_COMMON;
db_con->cache = NULL;
db_con->emails = NULL;
@@ -1029,7 +1034,7 @@
g_free (dbname);
- db_con->db_type = DB_DATA;
+ db_con->db_type = TRACKER_DB_TYPE_DATA;
db_con->db_category = DB_CATEGORY_FILES;
sqlite3_busy_timeout (db_con->db, 10000000);
@@ -1128,7 +1133,7 @@
db_con = g_new0 (DBConnection, 1);
- db_con->db_type = DB_INDEX;
+ db_con->db_type = TRACKER_DB_TYPE_INDEX;
db_con->db_category = DB_CATEGORY_FILES;
db_con->index = db_con;
@@ -1157,7 +1162,7 @@
db_con = g_new0 (DBConnection, 1);
- db_con->db_type = DB_INDEX;
+ db_con->db_type = TRACKER_DB_TYPE_INDEX;
db_con->db_category = DB_CATEGORY_EMAILS;
db_con->index = db_con;
@@ -1198,7 +1203,7 @@
db_con = g_new0 (DBConnection, 1);
- db_con->db_type = DB_CONTENT;
+ db_con->db_type = TRACKER_DB_TYPE_CONTENT;
db_con->db_category = DB_CATEGORY_FILES;
db_con->blob = db_con;
@@ -1237,7 +1242,7 @@
db_con = g_new0 (DBConnection, 1);
- db_con->db_type = DB_CONTENT;
+ db_con->db_type = TRACKER_DB_TYPE_CONTENT;
db_con->db_category = DB_CATEGORY_EMAILS;
db_con->blob = db_con;
@@ -1342,7 +1347,7 @@
g_free (dbname);
- db_con->db_type = DB_CACHE;
+ db_con->db_type = TRACKER_DB_TYPE_CACHE;
db_con->cache = db_con;
sqlite3_busy_timeout (db_con->db, 10000000);
@@ -1397,7 +1402,7 @@
g_free (dbname);
- db_con->db_type = DB_EMAIL;
+ db_con->db_type = TRACKER_DB_TYPE_EMAIL;
db_con->db_category = DB_CATEGORY_EMAILS;
db_con->emails = db_con;
@@ -1461,8 +1466,11 @@
char *
tracker_db_get_alias (const char *service)
{
- int id = tracker_get_id_for_parent_service (service);
- char *parent = tracker_get_service_by_id (id);
+ gchar *parent;
+ gint id;
+
+ id = tracker_service_manager_get_id_for_parent_service (service);
+ parent = tracker_service_manager_get_service_by_id (id);
if (strcmp (parent, "Files") == 0) {
g_free (parent);
@@ -2408,39 +2416,10 @@
}
-int
-tracker_metadata_is_key (const char *service, const char *meta_name)
+gint
+tracker_metadata_is_key (const gchar *service, const gchar *meta_name)
{
- int i;
-
- char *name = g_utf8_strdown (service, -1);
-
- ServiceDef *def = g_hash_table_lookup (tracker->service_table, name);
-
- g_free (name);
-
- if (!def) {
- tracker_log ("WARNING: service %s not found", service);
- return 0;
- }
-
- GSList *list;
- i = 0;
- for (list=def->key_metadata; list; list=list->next) {
-
- i++;
- if (list->data) {
- char *meta = (char *) list->data;
-
- if (strcasecmp (meta, meta_name) == 0) {
- return i;
- }
- }
-
- }
-
- return 0;
-
+ return tracker_service_manager_metadata_in_service (service, meta_name);
}
@@ -3343,6 +3322,7 @@
update_metadata_index (DBConnection *db_con, const char *id, const char *service, FieldDef *def, const char *old_value, const char *new_value)
{
GHashTable *old_table, *new_table;
+ gint sid;
if (!def) {
tracker_error ("ERROR: cannot find details for metadata type");
@@ -3354,7 +3334,11 @@
new_table = NULL;
if (old_value) {
- old_table = tracker_parse_text (old_table, old_value, def->weight, def->filtered, def->delimited);
+ old_table = tracker_parse_text (old_table,
+ old_value,
+ def->weight,
+ def->filtered,
+ def->delimited);
}
/* parse new metadata value */
@@ -3363,10 +3347,7 @@
}
/* we only do differential updates so only changed words scores are updated */
-
- int sid;
-
- sid = tracker_get_id_for_service (service);
+ sid = tracker_service_manager_get_id_for_service (service);
tracker_db_update_differential_index (db_con, old_table, new_table, id, sid);
tracker_word_table_free (old_table);
@@ -3808,7 +3789,9 @@
tracker_exec_proc (db_con, "SetMetadataKeyword", 3, id, def->id, values[i]);
/* backup non-embedded data for embedded services */
- if (do_backup && !def->embedded && tracker_is_service_embedded (service)) {
+ if (do_backup &&
+ !def->embedded &&
+ tracker_service_manager_is_service_embedded (service)) {
backup_non_embedded_metadata (db_con, id, def->id, values[i]);
}
@@ -3836,7 +3819,9 @@
}
/* backup non-embedded data for embedded services */
- if (do_backup && !def->embedded && tracker_is_service_embedded (service)) {
+ if (do_backup &&
+ !def->embedded &&
+ tracker_service_manager_is_service_embedded (service)) {
backup_non_embedded_metadata (db_con, id, def->id, values[i]);
}
@@ -3870,7 +3855,9 @@
if (!values[i] || !values[i][0]) continue;
/* backup non-embedded data for embedded services */
- if (do_backup && !def->embedded && tracker_is_service_embedded (service)) {
+ if (do_backup &&
+ !def->embedded &&
+ tracker_service_manager_is_service_embedded (service)) {
backup_non_embedded_metadata (db_con, id, def->id, values[i]);
}
@@ -3890,7 +3877,9 @@
if (!values[i] || !values[i][0]) continue;
/* backup non-embedded data for embedded services */
- if (do_backup && !def->embedded && tracker_is_service_embedded (service)) {
+ if (do_backup &&
+ !def->embedded &&
+ tracker_service_manager_is_service_embedded (service)) {
backup_non_embedded_metadata (db_con, id, def->id, values[i]);
}
@@ -3908,7 +3897,9 @@
if (!values[i] || !values[i][0]) continue;
/* backup non-embedded data for embedded services */
- if (do_backup && !def->embedded && tracker_is_service_embedded (service)) {
+ if (do_backup &&
+ !def->embedded &&
+ tracker_service_manager_is_service_embedded (service)) {
backup_non_embedded_metadata (db_con, id, def->id, values[i]);
}
@@ -3935,7 +3926,9 @@
tracker_exec_proc (db_con, "SetMetadataNumeric", 3, id, def->id, mvalue);
/* backup non-embedded data for embedded services */
- if (do_backup && !def->embedded && tracker_is_service_embedded (service)) {
+ if (do_backup &&
+ !def->embedded &&
+ tracker_service_manager_is_service_embedded (service)) {
backup_non_embedded_metadata (db_con, id, def->id, mvalue);
}
@@ -4058,7 +4051,8 @@
}
- if (!def->embedded && tracker_is_service_embedded (service)) {
+ if (!def->embedded &&
+ tracker_service_manager_is_service_embedded (service)) {
backup_delete_non_embedded_metadata_value (db_con, id, def->id, value);
}
@@ -4197,7 +4191,8 @@
return;
}
- if (!def->embedded && tracker_is_service_embedded (service)) {
+ if (!def->embedded &&
+ tracker_service_manager_is_service_embedded (service)) {
backup_delete_non_embedded_metadata (db_con, id, def->id);
}
@@ -4337,7 +4332,7 @@
str_mtime = tracker_gint32_to_str (info->mtime);
str_offset = tracker_gint32_to_str (info->offset);
- service_type_id = tracker_get_id_for_service (service);
+ service_type_id = tracker_service_manager_get_id_for_service (service);
if (info->mime) {
tracker_debug ("service id for %s is %d and sid is %s with mime %s", service, service_type_id, sid, info->mime);
@@ -4350,6 +4345,8 @@
str_aux = tracker_int_to_str (info->aux_id);
if (service_type_id != -1) {
+ gchar *parent;
+
// gchar *apath = tracker_escape_string (path);
// gchar *aname = tracker_escape_string (name);
@@ -4383,7 +4380,7 @@
tracker_exec_proc (db_con->common, "IncStat", 1, service);
- char *parent = tracker_get_parent_service (service);
+ parent = tracker_service_manager_get_parent_service (service);
if (parent) {
tracker_exec_proc (db_con->common, "IncStat", 1, parent);
@@ -4501,12 +4498,16 @@
static void
dec_stat (DBConnection *db_con, int id)
{
- char *service = tracker_get_service_by_id (id);
+ gchar *service;
+
+ service = tracker_service_manager_get_service_by_id (id);
if (service) {
+ gchar *parent;
+
tracker_exec_proc (db_con->common, "DecStat", 1, service);
- char *parent = tracker_get_parent_service (service);
+ parent = tracker_service_manager_get_parent_service (service);
if (parent) {
tracker_exec_proc (db_con->common, "DecStat", 1, parent);
@@ -4526,10 +4527,10 @@
char *
tracker_db_get_id (DBConnection *db_con, const char *service, const char *uri)
{
- int service_id;
+ gint service_id;
guint32 id;
- service_id = tracker_get_id_for_service (service);
+ service_id = tracker_service_manager_get_id_for_service (service);
if (service_id == -1) {
return NULL;
@@ -4933,19 +4934,19 @@
GSList *hit_list, *result_list;
const GSList *tmp;
int count;
+ gint service_array[8];
result = NULL;
result_list = NULL;
- int service_array[8];
- service_array[0] = tracker_get_id_for_service ("Files");
- service_array[1] = tracker_get_id_for_service ("Folders");
- service_array[2] = tracker_get_id_for_service ("Documents");
- service_array[3] = tracker_get_id_for_service ("Images");
- service_array[4] = tracker_get_id_for_service ("Music");
- service_array[5] = tracker_get_id_for_service ("Videos");
- service_array[6] = tracker_get_id_for_service ("Text");
- service_array[7] = tracker_get_id_for_service ("Other");
+ service_array[0] = tracker_service_manager_get_id_for_service ("Files");
+ service_array[1] = tracker_service_manager_get_id_for_service ("Folders");
+ service_array[2] = tracker_service_manager_get_id_for_service ("Documents");
+ service_array[3] = tracker_service_manager_get_id_for_service ("Images");
+ service_array[4] = tracker_service_manager_get_id_for_service ("Music");
+ service_array[5] = tracker_service_manager_get_id_for_service ("Videos");
+ service_array[6] = tracker_service_manager_get_id_for_service ("Text");
+ service_array[7] = tracker_service_manager_get_id_for_service ("Other");
SearchQuery *query = tracker_create_query (db_con->word_index, service_array, 8, 0, 999999);
@@ -5050,19 +5051,19 @@
GSList *hit_list, *result_list;
const GSList *tmp;
int count;
+ gint service_array[8];
location_prefix = g_strconcat (location, G_DIR_SEPARATOR_S, NULL);
- int service_array[8];
- service_array[0] = tracker_get_id_for_service ("Files");
- service_array[1] = tracker_get_id_for_service ("Folders");
- service_array[2] = tracker_get_id_for_service ("Documents");
- service_array[3] = tracker_get_id_for_service ("Images");
- service_array[4] = tracker_get_id_for_service ("Music");
- service_array[5] = tracker_get_id_for_service ("Videos");
- service_array[6] = tracker_get_id_for_service ("Text");
- service_array[7] = tracker_get_id_for_service ("Other");
+ service_array[0] = tracker_service_manager_get_id_for_service ("Files");
+ service_array[1] = tracker_service_manager_get_id_for_service ("Folders");
+ service_array[2] = tracker_service_manager_get_id_for_service ("Documents");
+ service_array[3] = tracker_service_manager_get_id_for_service ("Images");
+ service_array[4] = tracker_service_manager_get_id_for_service ("Music");
+ service_array[5] = tracker_service_manager_get_id_for_service ("Videos");
+ service_array[6] = tracker_service_manager_get_id_for_service ("Text");
+ service_array[7] = tracker_service_manager_get_id_for_service ("Other");
SearchQuery *query = tracker_create_query (db_con->word_index, service_array, 8, 0, 999999);
@@ -5165,19 +5166,19 @@
GSList *hit_list, *result_list;
const GSList *tmp;
int count;
+ gint service_array[8];
location_prefix = g_strconcat (location, G_DIR_SEPARATOR_S, NULL);
- int service_array[8];
- service_array[0] = tracker_get_id_for_service ("Files");
- service_array[1] = tracker_get_id_for_service ("Folders");
- service_array[2] = tracker_get_id_for_service ("Documents");
- service_array[3] = tracker_get_id_for_service ("Images");
- service_array[4] = tracker_get_id_for_service ("Music");
- service_array[5] = tracker_get_id_for_service ("Videos");
- service_array[6] = tracker_get_id_for_service ("Text");
- service_array[7] = tracker_get_id_for_service ("Other");
+ service_array[0] = tracker_service_manager_get_id_for_service ("Files");
+ service_array[1] = tracker_service_manager_get_id_for_service ("Folders");
+ service_array[2] = tracker_service_manager_get_id_for_service ("Documents");
+ service_array[3] = tracker_service_manager_get_id_for_service ("Images");
+ service_array[4] = tracker_service_manager_get_id_for_service ("Music");
+ service_array[5] = tracker_service_manager_get_id_for_service ("Videos");
+ service_array[6] = tracker_service_manager_get_id_for_service ("Text");
+ service_array[7] = tracker_service_manager_get_id_for_service ("Other");
SearchQuery *query = tracker_create_query (db_con->word_index, service_array, 8, 0, 999999);
@@ -5687,28 +5688,152 @@
return res;
}
+GSList *
+tracker_db_mime_query (DBConnection *db_con,
+ const gchar *stored_proc,
+ gint service_id)
+{
+
+ GSList *result = NULL;
+ gchar *service_id_str;
+ gchar ***result_set;
+
+ service_id_str = g_strdup_printf ("%d", service_id);
+ result_set = tracker_exec_proc (db_con, stored_proc, 1, service_id_str);
+ g_free (service_id_str);
+
+ if (result_set) {
+ gchar **row;
+ gint k;
+
+ for (k = 0; (row = tracker_db_get_row (result_set, k)); k++) {
+ result = g_slist_prepend (result, g_strdup(row[0]));
+ }
+
+ tracker_db_free_result (result_set);
+
+ }
+
+ return result;
+}
+
+GSList *
+tracker_db_get_mimes_for_service_id (DBConnection *db_con,
+ gint service_id)
+{
+ return tracker_db_mime_query (db_con, "GetMimeForServiceId", service_id);
+}
+
+GSList *
+tracker_db_get_mime_prefixes_for_service_id (DBConnection *db_con,
+ gint service_id)
+{
+ return tracker_db_mime_query (db_con, "GetMimePrefixForServiceId", service_id);
+}
+
+static TrackerService *
+db_row_to_service (gchar **row)
+{
+ TrackerService *service;
+ GSList *new_list;
+ gint id;
+ const gchar *name;
+ gint i;
+
+ if (!row[0] || !row[1] ||
+ !row[2] || !row[3] ||
+ !row[4] || !row[5] ||
+ !row[6] || !row[7] ||
+ !row[8]) {
+ return NULL;
+ }
+
+ service = tracker_service_new ();
+
+ new_list = NULL;
+ id = atoi (row[0]);
+ name = row[1];
+
+ tracker_service_set_id (service, id);
+ tracker_service_set_name (service, name);
+ tracker_service_set_parent (service, row[2]);
+ tracker_service_set_enabled (service, row[3][0] == '1');
+ tracker_service_set_embedded (service, row[4][0] == '1');
+ tracker_service_set_has_metadata (service, row[5][0] == '1');
+ tracker_service_set_has_full_text (service, row[6][0] == '1');
+ tracker_service_set_has_thumbs (service, row[7][0] == '1');
+
+ if (row[8][1]) {
+ tracker_service_set_content_metadata (service, row[8]);
+ }
+
+ if (g_str_has_prefix (name, "Email") ||
+ g_str_has_suffix (name, "Emails")) {
+ tracker_service_set_db_type (service, TRACKER_DB_TYPE_EMAIL);
+
+ if (tracker->email_service_min == 0 ||
+ id < tracker->email_service_min) {
+ tracker->email_service_min = id;
+ }
+
+ if (tracker->email_service_max == 0 ||
+ id > tracker->email_service_max) {
+ tracker->email_service_max = id;
+ }
+ } else {
+ tracker_service_set_db_type (service, TRACKER_DB_TYPE_DATA);
+ }
+
+ tracker_service_set_show_service_files (service, row[10][0] == '1');
+ tracker_service_set_show_service_directories (service, row[11][0] == '1');
+
+ for (i = 12; i < 23; i++) {
+ if (row[i] && row[i][1]) {
+ /* We do not duplicate the data here because
+ * the TrackerService will do this for us.
+ */
+ new_list = g_slist_prepend (new_list, row[i]);
+ }
+ }
+
+ /* Hack to prevent db change late in the cycle, check the
+ * service name matches "Applications", then add some voodoo.
+ */
+ if (strcmp (name, "Applications") == 0) {
+ /* These strings should be definitions at the top of
+ * this file somewhere really.
+ */
+ new_list = g_slist_prepend (new_list, "App:DisplayName");
+ new_list = g_slist_prepend (new_list, "App:Exec");
+ new_list = g_slist_prepend (new_list, "App:Icon");
+ }
+
+ new_list = g_slist_reverse (new_list);
+
+ tracker_service_set_key_metadata (service, new_list);
+ g_slist_free (new_list);
+
+ return service;
+}
/* get static data like metadata field definitions and services definitions and load them into hashtables */
void
tracker_db_get_static_data (DBConnection *db_con)
{
- int i = 0, j;
- char ***res;
-
+ gchar ***res;
+ gint i = 0;
+ gint j;
- /* get static metadata info */
+ /* Get static metadata info */
res = tracker_exec_proc (db_con, "GetMetadataTypes", 0);
-
if (res) {
- char **row;
+ gchar **row;
while ((row = tracker_db_get_row (res, i))) {
-
i++;
if (row[0] && row[1] && row[2] && row[3] && row[4] && row[5] && row[6] && row[7] && row[8] && row[9]) {
-
FieldDef *def = NULL;
def = g_new (FieldDef, 1);
@@ -5733,7 +5858,6 @@
char **row2;
while ((row2 = tracker_db_get_row (res2, j))) {
-
j++;
if (row2[1]) {
@@ -5744,97 +5868,59 @@
}
g_hash_table_insert (tracker->metadata_table, g_utf8_strdown (row[1], -1), def);
- tracker_debug ("loading metadata def %s with weight %d", def->field_name, def->weight);
-
+ tracker_debug ("loading metadata def %s with weight %d",
+ def->field_name, def->weight);
}
-
}
+
tracker_db_free_result (res);
}
-
- /* get static service info */
-
+ /* Get static service info */
res = tracker_exec_proc_ignore_nulls (db_con, "GetAllServices", 0);
if (res) {
- char **row;
+ gchar **row;
+
i = 0;
tracker->email_service_min = 0;
tracker->email_service_max = 0;
- while ((row = tracker_db_get_row (res, i))) {
-
- i++;
+ while ((row = tracker_db_get_row (res, i++))) {
+ TrackerService *service;
+ gint id;
+ const gchar *name;
+ GSList *mimes;
+ GSList *mime_prefixes;
- if (row[0] && row[1] && row[2] && row[3] && row[4] && row[5] && row[6] && row[7] && row[8]) {
- ServiceDef *def = g_new0 (ServiceDef, 1);
+ service = db_row_to_service (row);
- def->id = atoi (row[0]);
- def->name = g_strdup (row[1]);
- def->parent = g_strdup (row[2]);
- def->enabled = (row[3][0] == '1');
- def->embedded = (row[4][0] == '1');
- def->has_metadata = (row[5][0] == '1');
- def->has_fulltext = (row[6][0] == '1');
- def->has_thumbs = (row[7][0] == '1');
-
- def->content_metadata = NULL;
- if (row[8][1]) {
- def->content_metadata = g_strdup (row[8]);
+ if (!service) {
+ continue;
}
- if (g_str_has_prefix (def->name, "Email") || g_str_has_suffix (def->name, "Emails")) {
- def->database = DB_EMAIL;
+ id = tracker_service_get_id (service);
+ name = tracker_service_get_name (service);
- if (tracker->email_service_min == 0 || def->id < tracker->email_service_min) {
- tracker->email_service_min = def->id;
- }
-
- if (tracker->email_service_max == 0 || def->id > tracker->email_service_max) {
- tracker->email_service_max = def->id;
- }
-
-
-
- } else {
- def->database = DB_DATA;
- }
-
- def->show_service_files = (row[10][0] == '1');
- def->show_service_directories = (row[11][0] == '1');
-
- def->key_metadata = NULL;
+ mimes = tracker_db_get_mimes_for_service_id (db_con, id);
+ mime_prefixes = tracker_db_get_mime_prefixes_for_service_id (db_con, id);
- int j;
+ tracker_debug ("Adding service definition for %s with id %d", name, id);
+ tracker_service_manager_add_service (service,
+ mimes,
+ mime_prefixes);
- for (j=12; j<23; j++) {
- if (row[j] && row[j][1]) {
- def->key_metadata = g_slist_prepend (def->key_metadata, g_strdup (row[j]));
- }
- }
+ g_slist_free (mimes);
+ g_slist_free (mime_prefixes);
- /* hack to prevent db change late in the cycle */
- if (strcmp (def->name, "Applications") == 0) {
- def->key_metadata = g_slist_prepend (def->key_metadata, g_strdup ("App:DisplayName"));
- def->key_metadata = g_slist_prepend (def->key_metadata, g_strdup ("App:Exec"));
- def->key_metadata = g_slist_prepend (def->key_metadata, g_strdup ("App:Icon"));
+ g_object_unref (service);
}
-
- def->key_metadata = g_slist_reverse (def->key_metadata);
-
- tracker_debug ("adding service definition for %s with id %s", def->name, row[0]);
- g_hash_table_insert (tracker->service_table, g_utf8_strdown (def->name, -1), def);
- g_hash_table_insert (tracker->service_id_table, g_strdup (row[0]), def);
- }
-
- }
tracker_db_free_result (res);
/* check for web history */
- if (!g_hash_table_lookup (tracker->service_table, "Webhistory")) {
+ if (!tracker_service_manager_get_service ("Webhistory")) {
tracker_log ("Adding missing Webhistory service");
tracker_exec_proc (db_con, "InsertServiceType", 1, "Webhistory");
}
@@ -5846,11 +5932,11 @@
DBConnection *
tracker_db_get_service_connection (DBConnection *db_con, const char *service)
{
- DBTypes type;
+ TrackerDBType type;
- type = tracker_get_db_for_service (service);
+ type = tracker_service_manager_get_db_for_service (service);
- if (type == DB_EMAIL) {
+ if (type == TRACKER_DB_TYPE_EMAIL) {
return db_con->emails;
}
@@ -5966,23 +6052,18 @@
} else {
id = atoi (def->id);
}
-
} else if (is_service) {
+ TrackerService *service;
- char *name = g_utf8_strdown (*array, -1);
+ tracker_log ("Trying to obtain service %s in cache", *array);
+ service = tracker_service_manager_get_service (*array);
- ServiceDef *def = g_hash_table_lookup (tracker->service_table, *array);
-
- g_free (name);
-
- if (!def) {
+ if (!service) {
tracker_exec_proc (db_con, "InsertServiceType", 1, *array);
id = sqlite3_last_insert_rowid (db_con->db);
} else {
- id = def->id;
+ id = tracker_service_get_id (service);
}
-
-
} else {
/* TODO add support for extractors here */;
}
Modified: trunk/src/trackerd/tracker-db-sqlite.h
==============================================================================
--- trunk/src/trackerd/tracker-db-sqlite.h (original)
+++ trunk/src/trackerd/tracker-db-sqlite.h Tue Apr 8 11:09:46 2008
@@ -26,7 +26,7 @@
#include <glib.h>
#include "tracker-utils.h"
-
+#include "tracker-service-manager.h"
typedef enum {
@@ -42,7 +42,7 @@
typedef struct {
sqlite3 *db;
- DBTypes db_type;
+ TrackerDBType db_type;
DBCategory db_category;
char *err;
char *name;
Modified: trunk/src/trackerd/tracker-db.c
==============================================================================
--- trunk/src/trackerd/tracker-db.c (original)
+++ trunk/src/trackerd/tracker-db.c Tue Apr 8 11:09:46 2008
@@ -32,6 +32,7 @@
#include "tracker-email.h"
#include "tracker-metadata.h"
#include "tracker-os-dependant.h"
+#include "tracker-service-manager.h"
extern Tracker *tracker;
@@ -796,13 +797,6 @@
}
-gboolean
-tracker_is_valid_service (DBConnection *db_con, const char *service)
-{
- return tracker_get_id_for_service (service) != -1;
-}
-
-
static void
restore_backup_data (gpointer mtype,
gpointer value,
@@ -850,7 +844,7 @@
uri = attachment_uri;
}
- info->service_type_id = tracker_get_id_for_service (service);
+ info->service_type_id = tracker_service_manager_get_id_for_service (service);
if (info->service_type_id == -1) {
tracker_log ("Service %s not supported yet", service);
@@ -952,7 +946,7 @@
}
if (attachment_service) {
- info->service_type_id = tracker_get_id_for_service (attachment_service);
+ info->service_type_id = tracker_service_manager_get_id_for_service (attachment_service);
}
/* save stuff to Db */
@@ -1094,9 +1088,6 @@
void
tracker_db_index_file (DBConnection *db_con, FileInfo *info, const char *attachment_uri, const char *attachment_service)
{
- char *services_with_metadata[] = {"Documents", "Music", "Videos", "Images","WebHistory", NULL};
- char *services_with_text[] = {"Documents", "Development", "Text", "WebHistory",NULL};
- char *services_with_thumbs[] = {"Documents", "Images", "Videos", "WebHistory",NULL};
GHashTable *meta_table;
const char *ext;
@@ -1129,7 +1120,7 @@
tracker_info ("mime is %s for %s", info->mime, info->uri);
- service_name = tracker_get_service_type_for_mime (info->mime);
+ service_name = tracker_service_manager_get_service_type_for_mime (info->mime);
}
@@ -1216,14 +1207,25 @@
is_external_service = g_str_has_prefix (info->mime, "service/");
- is_file_indexable = (!info->is_directory && (strcmp (info->mime, "unknown") != 0) && (strcmp (info->mime, "symlink") != 0) && tracker_file_is_indexable (info->uri));
-
- service_has_metadata = (is_external_service ||
- (is_file_indexable && (tracker_str_in_array (service_name, services_with_metadata) != -1))) && !is_sidecar;
- service_has_fulltext = (is_external_service ||
- (is_file_indexable && (tracker_str_in_array (service_name, services_with_text) != -1))) && !is_sidecar;
- service_has_thumbs = (is_external_service ||
- (is_file_indexable && (tracker_str_in_array (service_name, services_with_thumbs) != -1)));
+ is_file_indexable = (!info->is_directory &&
+ (strcmp (info->mime, "unknown") != 0) &&
+ (strcmp (info->mime, "symlink") != 0) &&
+ tracker_file_is_indexable (info->uri));
+
+ service_has_metadata =
+ (is_external_service ||
+ (is_file_indexable &&
+ tracker_service_manager_has_metadata (service_name))) &&
+ !is_sidecar;
+ service_has_fulltext =
+ (is_external_service ||
+ (is_file_indexable &&
+ tracker_service_manager_has_text (service_name))) &&
+ !is_sidecar;
+ service_has_thumbs =
+ (is_external_service ||
+ (is_file_indexable &&
+ tracker_service_manager_has_thumbnails (service_name)));
#ifdef HAVE_EXEMPI
if (!info->is_directory) {
Modified: trunk/src/trackerd/tracker-dbus-files.c
==============================================================================
--- trunk/src/trackerd/tracker-dbus-files.c (original)
+++ trunk/src/trackerd/tracker-dbus-files.c Tue Apr 8 11:09:46 2008
@@ -24,6 +24,7 @@
#include "tracker-dbus-methods.h"
#include "tracker-metadata.h"
#include "tracker-dbus-files.h"
+#include "tracker-service-manager.h"
void
tracker_dbus_method_files_exists (DBusRec *rec)
@@ -85,7 +86,7 @@
service = g_strdup ("Files");
} else {
info->mime = tracker_get_mime_type (uri);
- service = tracker_get_service_type_for_mime (info->mime);
+ service = tracker_service_manager_get_service_type_for_mime (info->mime);
info = tracker_get_file_info (info);
}
@@ -161,7 +162,7 @@
info = tracker_create_file_info (uri, 1, 0, 0);
info->mime = g_strdup (mime);
- service = tracker_get_service_type_for_mime (mime);
+ service = tracker_service_manager_get_service_type_for_mime (mime);
info->is_directory = is_dir;
info->file_size = size;
info->mtime = mtime;
@@ -334,7 +335,7 @@
mime = tracker_get_metadata (db_con, "Files", str_id, "File:Mime");
- result = tracker_get_service_type_for_mime (mime);
+ result = tracker_service_manager_get_service_type_for_mime (mime);
tracker_log ("Info for file %s is : id=%u, mime=%s, service=%s", uri, file_id, mime, result);
@@ -647,7 +648,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
Modified: trunk/src/trackerd/tracker-dbus-keywords.c
==============================================================================
--- trunk/src/trackerd/tracker-dbus-keywords.c (original)
+++ trunk/src/trackerd/tracker-dbus-keywords.c Tue Apr 8 11:09:46 2008
@@ -89,7 +89,9 @@
DBusMessage *msg;
dbus_uint32_t serial = 0;
- msg = dbus_message_new_signal (TRACKER_OBJECT, TRACKER_INTERFACE_KEYWORDS, TRACKER_SIGNAL_KEYWORD_ADDED);
+ msg = dbus_message_new_signal (TRACKER_OBJECT,
+ TRACKER_INTERFACE_KEYWORDS,
+ TRACKER_SIGNAL_KEYWORD_ADDED);
if (!msg || !tracker->dbus_con) {
return;
@@ -131,7 +133,9 @@
DBusMessage *msg;
dbus_uint32_t serial = 0;
- msg = dbus_message_new_signal (TRACKER_OBJECT, TRACKER_INTERFACE_KEYWORDS, TRACKER_SIGNAL_KEYWORD_REMOVED);
+ msg = dbus_message_new_signal (TRACKER_OBJECT,
+ TRACKER_INTERFACE_KEYWORDS,
+ TRACKER_SIGNAL_KEYWORD_REMOVED);
if (!msg || !tracker->dbus_con) {
return;
@@ -200,7 +204,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -249,7 +253,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -330,7 +334,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -408,7 +412,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -483,7 +487,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -556,7 +560,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -598,10 +602,10 @@
g_string_free (str_words, TRUE);
- int smin, smax;
+ gint smin, smax;
char *str_min, *str_max;
- smin = tracker_get_id_for_service (service);
+ smin = tracker_service_manager_get_id_for_service (service);
if (smin == 0) {
smax = 8;
Modified: trunk/src/trackerd/tracker-dbus-metadata.c
==============================================================================
--- trunk/src/trackerd/tracker-dbus-metadata.c (original)
+++ trunk/src/trackerd/tracker-dbus-metadata.c Tue Apr 8 11:09:46 2008
@@ -61,7 +61,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -159,7 +159,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
Modified: trunk/src/trackerd/tracker-dbus-methods.c
==============================================================================
--- trunk/src/trackerd/tracker-dbus-methods.c (original)
+++ trunk/src/trackerd/tracker-dbus-methods.c Tue Apr 8 11:09:46 2008
@@ -140,7 +140,7 @@
service = g_strdup ("Files");
} else {
info->mime = tracker_get_mime_type (uri_in_locale);
- service = tracker_get_service_type_for_mime (info->mime);
+ service = tracker_service_manager_get_service_type_for_mime (info->mime);
info = tracker_get_file_info (info);
}
Modified: trunk/src/trackerd/tracker-dbus-search.c
==============================================================================
--- trunk/src/trackerd/tracker-dbus-search.c (original)
+++ trunk/src/trackerd/tracker-dbus-search.c Tue Apr 8 11:09:46 2008
@@ -25,10 +25,10 @@
#include "tracker-dbus-methods.h"
#include "tracker-rdf-query.h"
#include "tracker-indexer.h"
+#include "tracker-service-manager.h"
extern Tracker *tracker;
-
void
tracker_dbus_method_search_get_hit_count (DBusRec *rec)
{
@@ -68,7 +68,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -86,27 +86,27 @@
DBusMessage *reply;
int service_count = 1;
- service_array[0] = tracker_get_id_for_service (service);
+ service_array[0] = tracker_service_manager_get_id_for_service (service);
if (strcmp (service, "Files") == 0) {
- service_array[1] = tracker_get_id_for_service ("Folders");
- service_array[2] = tracker_get_id_for_service ("Documents");
- service_array[3] = tracker_get_id_for_service ("Images");
- service_array[4] = tracker_get_id_for_service ("Videos");
- service_array[5] = tracker_get_id_for_service ("Music");
- service_array[6] = tracker_get_id_for_service ("Text");
- service_array[7] = tracker_get_id_for_service ("Development");
- service_array[8] = tracker_get_id_for_service ("Other");
+ service_array[1] = tracker_service_manager_get_id_for_service ("Folders");
+ service_array[2] = tracker_service_manager_get_id_for_service ("Documents");
+ service_array[3] = tracker_service_manager_get_id_for_service ("Images");
+ service_array[4] = tracker_service_manager_get_id_for_service ("Videos");
+ service_array[5] = tracker_service_manager_get_id_for_service ("Music");
+ service_array[6] = tracker_service_manager_get_id_for_service ("Text");
+ service_array[7] = tracker_service_manager_get_id_for_service ("Development");
+ service_array[8] = tracker_service_manager_get_id_for_service ("Other");
service_count = 9;
} else if (strcmp (service, "Emails") == 0) {
- service_array[1] = tracker_get_id_for_service ("EvolutionEmails");
- service_array[2] = tracker_get_id_for_service ("KMailEmails");
- service_array[3] = tracker_get_id_for_service ("ThunderbirdEmails");
+ service_array[1] = tracker_service_manager_get_id_for_service ("EvolutionEmails");
+ service_array[2] = tracker_service_manager_get_id_for_service ("KMailEmails");
+ service_array[3] = tracker_service_manager_get_id_for_service ("ThunderbirdEmails");
service_count = 4;
} else if (strcmp (service, "Conversations") == 0) {
- service_array[1] = tracker_get_id_for_service ("GaimConversations");
+ service_array[1] = tracker_service_manager_get_id_for_service ("GaimConversations");
service_count = 2;
}
@@ -251,7 +251,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -368,7 +368,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -439,7 +439,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -624,7 +624,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -691,7 +691,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
@@ -790,7 +790,7 @@
return;
}
- if (!tracker_is_valid_service (db_con, service)) {
+ if (!tracker_service_manager_is_valid_service (service)) {
tracker_set_error (rec, "Invalid service %s or service has not been implemented yet", service);
return;
}
Modified: trunk/src/trackerd/tracker-dbus.c
==============================================================================
--- trunk/src/trackerd/tracker-dbus.c (original)
+++ trunk/src/trackerd/tracker-dbus.c Tue Apr 8 11:09:46 2008
@@ -69,7 +69,10 @@
dbus_error_init (&error);
- ret = dbus_bus_request_name (connection, TRACKER_SERVICE, DBUS_NAME_FLAG_DO_NOT_QUEUE, &error);
+ ret = dbus_bus_request_name (connection,
+ TRACKER_DBUS_SERVICE,
+ DBUS_NAME_FLAG_DO_NOT_QUEUE,
+ &error);
if (dbus_error_is_set (&error)) {
tracker_error ("ERROR: could not acquire service name due to '%s'", error.message);
@@ -81,7 +84,10 @@
exit (EXIT_FAILURE);
}
- if (!dbus_connection_register_object_path (connection, TRACKER_OBJECT, &tracker_vtable, NULL)) {
+ if (!dbus_connection_register_object_path (connection,
+ TRACKER_OBJECT,
+ &tracker_vtable,
+ NULL)) {
tracker_error ("ERROR: could not register D-BUS handlers");
connection = NULL;
}
@@ -116,7 +122,9 @@
gboolean battery_pause;
gboolean enable_indexing;
- msg = dbus_message_new_signal (TRACKER_OBJECT, TRACKER_INTERFACE, TRACKER_SIGNAL_INDEX_STATUS_CHANGE);
+ msg = dbus_message_new_signal (TRACKER_OBJECT,
+ TRACKER_INTERFACE,
+ TRACKER_SIGNAL_INDEX_STATUS_CHANGE);
if (!msg || !tracker->dbus_con) {
return;
@@ -172,7 +180,9 @@
dbus_uint32_t serial = 0;
int count, processed;
- msg = dbus_message_new_signal (TRACKER_OBJECT, TRACKER_INTERFACE, TRACKER_SIGNAL_INDEX_PROGRESS);
+ msg = dbus_message_new_signal (TRACKER_OBJECT,
+ TRACKER_INTERFACE,
+ TRACKER_SIGNAL_INDEX_PROGRESS);
if (!msg || !tracker->dbus_con) {
return;
@@ -240,7 +250,9 @@
dbus_uint32_t serial = 0;
int i = time (NULL) - tracker->index_time_start;
- msg = dbus_message_new_signal (TRACKER_OBJECT, TRACKER_INTERFACE, TRACKER_SIGNAL_INDEX_FINISHED);
+ msg = dbus_message_new_signal (TRACKER_OBJECT,
+ TRACKER_INTERFACE,
+ TRACKER_SIGNAL_INDEX_FINISHED);
if (!msg || !tracker->dbus_con) {
return;
@@ -297,7 +309,9 @@
}
/* process shutdown calls in this thread */
- if (dbus_message_is_method_call (message, TRACKER_INTERFACE, TRACKER_METHOD_SHUTDOWN)) {
+ if (dbus_message_is_method_call (message,
+ TRACKER_INTERFACE,
+ TRACKER_METHOD_SHUTDOWN)) {
DBusMessage *reply;
DBusError dbus_error;
Modified: trunk/src/trackerd/tracker-dbus.h
==============================================================================
--- trunk/src/trackerd/tracker-dbus.h (original)
+++ trunk/src/trackerd/tracker-dbus.h Tue Apr 8 11:09:46 2008
@@ -30,7 +30,7 @@
#include <dbus/dbus-glib.h>
-#define TRACKER_SERVICE "org.freedesktop.Tracker"
+#define TRACKER_DBUS_SERVICE "org.freedesktop.Tracker"
#define TRACKER_OBJECT "/org/freedesktop/tracker"
#define TRACKER_INTERFACE "org.freedesktop.Tracker"
#define TRACKER_INTERFACE_METADATA "org.freedesktop.Tracker.Metadata"
Modified: trunk/src/trackerd/tracker-indexer.c
==============================================================================
--- trunk/src/trackerd/tracker-indexer.c (original)
+++ trunk/src/trackerd/tracker-indexer.c Tue Apr 8 11:09:46 2008
@@ -52,6 +52,7 @@
#include "tracker-indexer.h"
#include "tracker-cache.h"
#include "tracker-dbus.h"
+#include "tracker-service-manager.h"
extern Tracker *tracker;
@@ -1632,19 +1633,30 @@
GSList *tmp;
for (tmp = query->hits; tmp; tmp=tmp->next) {
- SearchHit *hit = tmp->data;
- guint32 count = GPOINTER_TO_UINT (g_hash_table_lookup (table, GUINT_TO_POINTER (hit->service_type_id))) + 1;
+ SearchHit *hit;
+ gpointer data;
+ guint32 count;
+ gint parent_id;
+
+ hit = tmp->data;
+ data = g_hash_table_lookup (table, GUINT_TO_POINTER (hit->service_type_id));
+ count = GPOINTER_TO_UINT (data) + 1;
+
+ g_hash_table_insert (table,
+ GUINT_TO_POINTER (hit->service_type_id),
+ GUINT_TO_POINTER (count));
- g_hash_table_insert (table, GUINT_TO_POINTER (hit->service_type_id), GUINT_TO_POINTER (count));
-
- /* update service's parent count too (if it has a parent) */
- gint parent_id = tracker_get_parent_id_for_service_id (hit->service_type_id);
+ /* Update service's parent count too (if it has a parent) */
+ parent_id = tracker_service_manager_get_parent_id_for_service_id (hit->service_type_id);
if (parent_id != -1) {
- count = GPOINTER_TO_UINT (g_hash_table_lookup (table, GUINT_TO_POINTER (parent_id))) + 1;
+ data = g_hash_table_lookup (table, GUINT_TO_POINTER (parent_id));
+ count = GPOINTER_TO_UINT (data) + 1;
- g_hash_table_insert (table, GUINT_TO_POINTER (parent_id), GUINT_TO_POINTER (count));
+ g_hash_table_insert (table,
+ GUINT_TO_POINTER (parent_id),
+ GUINT_TO_POINTER (count));
}
}
tracker_index_free_hit_list (query->hits);
@@ -1660,18 +1672,29 @@
GSList *tmp;
for (tmp = query->hits; tmp; tmp=tmp->next) {
- SearchHit *hit = tmp->data;
- guint32 count = GPOINTER_TO_UINT (g_hash_table_lookup (table, GUINT_TO_POINTER (hit->service_type_id))) + 1;
-
- g_hash_table_insert (table, GUINT_TO_POINTER (hit->service_type_id), GUINT_TO_POINTER (count));
+ SearchHit *hit;
+ gpointer data;
+ guint32 count;
+ gint parent_id;
+
+ hit = tmp->data;
+ data = g_hash_table_lookup (table, GUINT_TO_POINTER (hit->service_type_id));
+ count = GPOINTER_TO_UINT (data) + 1;
+
+ g_hash_table_insert (table,
+ GUINT_TO_POINTER (hit->service_type_id),
+ GUINT_TO_POINTER (count));
/* update service's parent count too (if it has a parent) */
- gint parent_id = tracker_get_parent_id_for_service_id (hit->service_type_id);
+ parent_id = tracker_service_manager_get_parent_id_for_service_id (hit->service_type_id);
if (parent_id != -1) {
- count = GPOINTER_TO_UINT (g_hash_table_lookup (table, GUINT_TO_POINTER (parent_id))) + 1;
+ data = g_hash_table_lookup (table, GUINT_TO_POINTER (parent_id));
+ count = GPOINTER_TO_UINT (data) + 1;
- g_hash_table_insert (table, GUINT_TO_POINTER (parent_id), GUINT_TO_POINTER (count));
+ g_hash_table_insert (table,
+ GUINT_TO_POINTER (parent_id),
+ GUINT_TO_POINTER (count));
}
}
@@ -1697,6 +1720,10 @@
i = 0;
for (lst = list; i < len && lst; lst = lst->next) {
+ gpointer data;
+ guint32 service;
+ guint32 count;
+ gchar **row;
if (!lst || !lst->data) {
tracker_error ("ERROR: in get hit counts");
@@ -1704,11 +1731,13 @@
continue;
}
- guint32 service = GPOINTER_TO_UINT (lst->data);
- guint32 count = GPOINTER_TO_UINT (g_hash_table_lookup (table, GUINT_TO_POINTER (service)));
+ service = GPOINTER_TO_UINT (lst->data);
+ data = g_hash_table_lookup (table, GUINT_TO_POINTER (service));
+ count = GPOINTER_TO_UINT (data);
+
+ row = g_new0 (gchar *, 3);
- gchar **row = g_new0 (gchar *, 3);
- row[0] = tracker_get_service_by_id ((int) service);
+ row[0] = tracker_service_manager_get_service_by_id ((gint) service);
row[1] = tracker_uint_to_str (count);
row[2] = NULL;
Modified: trunk/src/trackerd/tracker-metadata.c
==============================================================================
--- trunk/src/trackerd/tracker-metadata.c (original)
+++ trunk/src/trackerd/tracker-metadata.c Tue Apr 8 11:09:46 2008
@@ -35,235 +35,23 @@
#include "tracker-metadata.h"
#include "tracker-utils.h"
+#include "tracker-service-manager.h"
extern Tracker *tracker;
-typedef enum {
- IGNORE_METADATA,
- NO_METADATA,
- DOC_METADATA,
- IMAGE_METADATA,
- VIDEO_METADATA,
- AUDIO_METADATA,
- DEVEL_METADATA,
- TEXT_METADATA
-} MetadataFileType;
-
-
-/* document mime type specific metadata groups - NB mime types below may be prefixes */
-char *doc_mime_types[] = {
- "application/rtf",
- "text/richtext",
- "application/msword",
- "application/pdf",
- "application/postscript",
- "application/x-dvi",
- "application/vnd.ms-excel",
- "vnd.ms-powerpoint",
- "application/vnd.oasis.opendocument",
- "application/vnd.sun.xml",
- "application/vnd.stardivision",
- "application/x-abiword",
- "text/html",
- "text/sgml",
- "text/x-tex",
- "application/x-mswrite",
- "application/x-applix-word",
- "application/docbook+xml",
- "application/x-kword",
- "application/x-kword-crypt",
- "application/x-lyx",
- "application/vnd.lotus-1-2-3",
- "application/x-applix-spreadsheet",
- "application/x-gnumeric",
- "application/x-kspread",
- "application/x-kspread-crypt",
- "application/x-quattropro",
- "application/x-sc",
- "application/x-siag",
- "application/x-magicpoint",
- "application/x-kpresenter",
- "application/illustrator",
- "application/vnd.corel-draw",
- "application/vnd.stardivision.draw",
- "application/vnd.oasis.opendocument.graphics",
- "application/x-dia-diagram",
- "application/x-karbon",
- "application/x-killustrator",
- "application/x-kivio",
- "application/x-kontour",
- "application/x-wpg",
- "application/rdf+xml"
-};
-
-
-char *text_mime_types[] = {
- "text/plain",
- "text/x-authors",
- "text/x-changelog",
- "text/x-copying",
- "text/x-credits",
- "text/x-install",
- "text/x-readme"
-};
-
-
-char *development_mime_types[] = {
- "application/x-perl",
- "application/x-shellscript",
- "application/x-php",
- "application/x-java",
- "application/x-javascript",
- "application/x-glade",
- "application/x-csh",
- "application/x-class-file",
- "application/x-awk",
- "application/x-asp",
- "application/x-ruby",
- "application/x-m4",
- "text/x-m4",
- "text/x-c++",
- "text/x-adasrc",
- "text/x-c",
- "text/x-c++hdr",
- "text/x-chdr",
- "text/x-csharp",
- "text/x-c++src",
- "text/x-csrc",
- "text/x-dcl",
- "text/x-dsrc",
- "text/x-emacs-lisp",
- "text/x-fortran",
- "text/x-haskell",
- "text/x-literate-haskell",
- "text/x-java",
- "text/x-java-source" ,
- "text/x-makefile",
- "text/x-objcsrc",
- "text/x-pascal",
- "text/x-patch",
- "text/x-python",
- "text/x-scheme",
- "text/x-sql",
- "text/x-tcl"
-};
-
-
-
-
-static MetadataFileType
-tracker_get_metadata_type (const char *mime)
-{
- int i;
- int num_elements;
-
- if (strcmp (mime, "text/plain") == 0) {
- return TEXT_METADATA;
- }
-
- if (g_str_has_prefix (mime, "image") || (strcmp (mime, "application/vnd.oasis.opendocument.image") == 0) || (strcmp (mime, "application/x-krita") == 0)) {
- return IMAGE_METADATA;
-
- } else if (g_str_has_prefix (mime, "video")) {
- return VIDEO_METADATA;
-
- } else if (g_str_has_prefix (mime, "audio") || (strcmp (mime, "application/ogg") == 0)) {
- return AUDIO_METADATA;
-
- } else {
- num_elements = sizeof (doc_mime_types) / sizeof (char *);
- for (i = 0; i < num_elements; i++ ) {
- if (g_str_has_prefix (mime, doc_mime_types [i] )) {
- return DOC_METADATA;
- }
- }
- }
-
- num_elements = sizeof (development_mime_types) / sizeof (char *);
-
- for (i = 0; i < num_elements; i++ ) {
- if (strcmp (mime, development_mime_types[i]) == 0 ) {
- return DEVEL_METADATA;
- }
- }
-
- num_elements = sizeof (text_mime_types) / sizeof (char *);
-
- for (i = 0; i < num_elements; i++ ) {
- if (strcmp (mime, text_mime_types[i]) == 0 ) {
- return TEXT_METADATA;
- }
- }
-
- return NO_METADATA;
-}
-
-
-char *
-tracker_get_service_type_for_mime (const char *mime)
-{
- MetadataFileType stype;
-
- stype = tracker_get_metadata_type (mime);
-
- switch (stype) {
-
- case IGNORE_METADATA:
- if (g_str_has_prefix (mime, "video")) {
- return g_strdup ("Videos");
- } else {
- return g_strdup ("Other");
- }
- break;
-
- case NO_METADATA:
- return g_strdup ("Other");
- break;
-
- case TEXT_METADATA:
- return g_strdup ("Text");
- break;
-
- case DOC_METADATA:
- return g_strdup ("Documents");
- break;
-
- case IMAGE_METADATA:
- return g_strdup ("Images");
- break;
-
- case VIDEO_METADATA:
- return g_strdup ("Videos");
- break;
-
- case AUDIO_METADATA:
- return g_strdup ("Music");
- break;
-
- case DEVEL_METADATA:
- return g_strdup ("Development");
- break;
- }
-
- return g_strdup ("Other Files");
-}
-
-
char *
tracker_metadata_get_text_file (const char *uri, const char *mime)
{
- MetadataFileType ftype;
char *text_filter_file;
-
+ char *service_type;
text_filter_file = NULL;
- ftype = tracker_get_metadata_type (mime);
-
/* no need to filter text based files - index em directly */
+ service_type = tracker_service_manager_get_service_type_for_mime (mime);
+ if ( !strcmp ("Text", service_type) || !strcmp ("Development", service_type)) {
- if (ftype == TEXT_METADATA || ftype == DEVEL_METADATA) {
-
+ g_free (service_type);
return g_filename_from_utf8 (uri, -1, NULL, NULL, NULL);
} else {
@@ -376,21 +164,26 @@
void
tracker_metadata_get_embedded (const char *uri, const char *mime, GHashTable *table)
{
- MetadataFileType meta_type;
gboolean success;
char *argv[4];
char *output;
char **values;
+ char *service_type;
gint i;
if (!uri || !mime || !table) {
return;
}
- meta_type = tracker_get_metadata_type (mime);
+ service_type = tracker_service_manager_get_service_type_for_mime (mime);
+ if (!service_type ) {
+ return;
+ }
- if (! (meta_type == DOC_METADATA || meta_type == IMAGE_METADATA || meta_type == AUDIO_METADATA || meta_type == VIDEO_METADATA))
+ if (!tracker_service_manager_has_metadata (service_type)) {
+ g_free (service_type);
return;
+ }
/* we extract metadata out of process using pipes */
argv[0] = g_strdup ("tracker-extract");
Modified: trunk/src/trackerd/tracker-process-files.c
==============================================================================
--- trunk/src/trackerd/tracker-process-files.c (original)
+++ trunk/src/trackerd/tracker-process-files.c Tue Apr 8 11:09:46 2008
@@ -44,6 +44,7 @@
#include "tracker-os-dependant.h"
#include "tracker-utils.h"
#include "tracker-watch.h"
+#include "tracker-service.h"
static void
process_my_yield (void)
@@ -325,9 +326,8 @@
process_index_entity (Tracker *tracker,
FileInfo *info)
{
- ServiceDef *def;
+ TrackerService *def;
gchar *service_info;
- gchar *str;
g_return_if_fail (info);
g_return_if_fail (tracker_check_uri (info->uri));
@@ -348,9 +348,7 @@
return;
}
- str = g_utf8_strdown (service_info, -1);
- def = g_hash_table_lookup (tracker->service_table, str);
- g_free (str);
+ def = tracker_service_manager_get_service (service_info);
if (!def) {
if (service_info) {
@@ -363,12 +361,12 @@
}
if (info->is_directory) {
- info->is_hidden = !def->show_service_directories;
+ info->is_hidden = !tracker_service_get_show_service_directories (def);
tracker_db_index_file (tracker->index_db, info, NULL, NULL);
g_free (service_info);
return;
} else {
- info->is_hidden = !def->show_service_files;
+ info->is_hidden = !tracker_service_get_show_service_files (def);
}
if (g_str_has_suffix (service_info, "Emails")) {
Modified: trunk/src/trackerd/tracker-rdf-query.c
==============================================================================
--- trunk/src/trackerd/tracker-rdf-query.c (original)
+++ trunk/src/trackerd/tracker-rdf-query.c Tue Apr 8 11:09:46 2008
@@ -23,7 +23,6 @@
#include "tracker-rdf-query.h"
-
/* RDF Query Condition
<rdfq:Condition>
<rdfq:and>
@@ -1024,7 +1023,7 @@
int type;
result = g_string_new ("");
- type = tracker_get_id_for_service (service);
+ type = tracker_service_manager_get_id_for_service (service);
switch (type) {
Modified: trunk/src/trackerd/tracker-utils.c
==============================================================================
--- trunk/src/trackerd/tracker-utils.c (original)
+++ trunk/src/trackerd/tracker-utils.c Tue Apr 8 11:09:46 2008
@@ -94,174 +94,6 @@
};
-char *
-tracker_get_service_by_id (int service_type_id)
-{
- char *str_id;
- ServiceDef *def;
-
- str_id = tracker_int_to_str (service_type_id);
- def = g_hash_table_lookup (tracker->service_id_table, str_id);
- g_free (str_id);
-
- if (!def) {
- tracker_log ("WARNING: no service found for id %d", service_type_id);
- return NULL;
- }
-
- return g_strdup (def->name);
-}
-
-
-char *
-tracker_get_parent_service_by_id (int service_type_id)
-{
- char *str_id = tracker_int_to_str (service_type_id);
- ServiceDef *def = g_hash_table_lookup (tracker->service_id_table, str_id);
-
- g_free (str_id);
-
- if (!def) {
- return NULL;
- }
-
- return g_strdup (def->parent);
-}
-
-
-int
-tracker_get_parent_id_for_service_id (int service_type_id)
-{
- char *str_id = tracker_int_to_str (service_type_id);
- ServiceDef *def = g_hash_table_lookup (tracker->service_id_table, str_id);
-
- g_free (str_id);
-
- if (!def) {
- return -1;
- }
-
- char *name = g_utf8_strdown (def->parent, -1);
-
- ServiceDef *def2 = g_hash_table_lookup (tracker->service_table, name);
-
- g_free (name);
-
- if (!def2) {
- return -1;
- }
-
- return def2->id;
-}
-
-
-int
-tracker_get_id_for_service (const char *service)
-{
- char *name = g_utf8_strdown (service, -1);
-
- ServiceDef *def = g_hash_table_lookup (tracker->service_table, name);
-
- g_free (name);
-
- if (!def) {
- return -1;
- }
-
- return def->id;
-}
-
-
-int
-tracker_get_id_for_parent_service (const char *service)
-{
- char *name = g_utf8_strdown (service, -1);
-
- ServiceDef *def = g_hash_table_lookup (tracker->service_table, name);
-
- g_free (name);
-
- if (!def) {
- return -1;
- }
-
- return tracker_get_id_for_service (def->parent);
-}
-
-
-char *
-tracker_get_parent_service (const char *service)
-{
- char *name = g_utf8_strdown (service, -1);
-
- ServiceDef *def = g_hash_table_lookup (tracker->service_table, name);
-
- g_free (name);
-
- if (!def) {
- return NULL;
- }
-
- if (def->parent) {
- return g_strdup (def->parent);
- }
-
- return NULL;
-}
-
-
-ServiceDef *
-tracker_get_service (const char *service)
-{
- char *name = g_utf8_strdown (service, -1);
-
- ServiceDef *def = g_hash_table_lookup (tracker->service_table, name);
-
- g_free (name);
-
- return def;
-}
-
-
-DBTypes
-tracker_get_db_for_service (const char *service)
-{
- char *name = g_utf8_strdown (service, -1);
-
- if (g_str_has_prefix (name, "emails") || g_str_has_prefix (name, "attachments")) {
- g_free (name);
- return DB_EMAIL;
- }
-
- int id = tracker_get_id_for_parent_service (name);
- char *str_id = tracker_int_to_str (id);
-
- g_free (str_id);
-
- g_free (name);
-
- return DB_DATA;
-
-}
-
-
-gboolean
-tracker_is_service_embedded (const char *service)
-{
- char *name = g_utf8_strdown (service, -1);
-
- ServiceDef *def = g_hash_table_lookup (tracker->service_table, name);
-
- g_free (name);
-
- if (!def) {
- return FALSE;
- }
-
- return def->embedded;
-}
-
-
char **
tracker_make_array_null_terminated (char **array, int length)
{
Modified: trunk/src/trackerd/tracker-utils.h
==============================================================================
--- trunk/src/trackerd/tracker-utils.h (original)
+++ trunk/src/trackerd/tracker-utils.h Tue Apr 8 11:09:46 2008
@@ -91,17 +91,6 @@
typedef enum {
- DB_DATA,
- DB_INDEX,
- DB_COMMON,
- DB_CONTENT,
- DB_EMAIL,
- DB_CACHE,
- DB_USER
-} DBTypes;
-
-
-typedef enum {
DB_CATEGORY_FILES,
DB_CATEGORY_EMAILS,
DB_CATEGORY_USER
@@ -165,26 +154,6 @@
typedef struct {
-
- int id;
- char *name;
- char *parent;
- char *content_metadata;
- GSList *key_metadata;
- DBTypes database;
-
- guint enabled : 1;
- guint embedded : 1;
- guint has_metadata : 1;
- guint has_fulltext : 1;
- guint has_thumbs : 1;
- guint show_service_files : 1;
- guint show_service_directories : 1;
-
-} ServiceDef;
-
-
-typedef struct {
char *name;
char *type;
} ServiceInfo;
@@ -297,8 +266,6 @@
GSList *service_directory_list;
/* lookup tables for service and metadata IDs */
- GHashTable *service_table;
- GHashTable *service_id_table;
GHashTable *metadata_table;
/* email config options */
@@ -486,17 +453,6 @@
} FileInfo;
-ServiceDef * tracker_get_service (const char *service);
-int tracker_get_id_for_service (const char *service);
-int tracker_get_id_for_parent_service (const char *service);
-char * tracker_get_service_by_id (int service_type_id);
-char * tracker_get_parent_service (const char *service);
-char * tracker_get_parent_service_by_id (int service_type_id);
-int tracker_get_parent_id_for_service_id (int service_type_id);
-DBTypes tracker_get_db_for_service (const char *service);
-gboolean tracker_is_service_embedded (const char *service);
-
-
GSList * tracker_filename_array_to_list (gchar **array);
GSList * tracker_string_list_to_gslist (const gchar **array);
gchar ** tracker_gslist_to_string_list (GSList *list);
Modified: trunk/src/trackerd/trackerd.c
==============================================================================
--- trunk/src/trackerd/trackerd.c (original)
+++ trunk/src/trackerd/trackerd.c Tue Apr 8 11:09:46 2008
@@ -60,6 +60,8 @@
#include "tracker-process-requests.h"
#include "tracker-watch.h"
+#include "tracker-service-manager.h"
+
#ifdef OS_WIN32
#include <windows.h>
#include <pthread.h>
@@ -709,13 +711,16 @@
tracker_log ("Throttle level is %d\n", tracker_config_get_throttle (tracker->config));
- tracker->metadata_table = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
- tracker->service_table = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
- tracker->service_id_table = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
- tracker->service_directory_table = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
+ tracker->metadata_table = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ NULL,
+ NULL);
+ tracker->service_directory_table = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ NULL,
+ NULL);
}
-
static void
create_index (gboolean need_data)
{
@@ -1046,6 +1051,9 @@
sanity_check_option_values ();
+ /* Initialize the service manager */
+ tracker_service_manager_init ();
+
/* set thread safe DB connection */
tracker_db_thread_init ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]