tracker r1540 - in branches/indexer-split: . src/tracker-indexer
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1540 - in branches/indexer-split: . src/tracker-indexer
- Date: Fri, 30 May 2008 09:40:15 +0000 (UTC)
Author: carlosg
Date: Fri May 30 09:40:15 2008
New Revision: 1540
URL: http://svn.gnome.org/viewvc/tracker?rev=1540&view=rev
Log:
2008-05-30 Carlos Garnacho <carlos imendio com>
* tracker-indexer-db.[ch] (tracker_db_increment_stats)
(tracker_db_create_service):
* tracker-indexer.c (process_file): Pass around the TrackerService
instead of having to look it up in the ontology several times.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c
branches/indexer-split/src/tracker-indexer/tracker-indexer-db.h
branches/indexer-split/src/tracker-indexer/tracker-indexer.c
Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c Fri May 30 09:40:15 2008
@@ -525,33 +525,30 @@
void
tracker_db_increment_stats (TrackerDBInterface *iface,
- const gchar *service)
+ TrackerService *service)
{
- gchar *parent;
+ const gchar *service_type, *parent;
- tracker_db_interface_execute_procedure (iface, NULL, "IncStat", service, NULL);
+ service_type = tracker_service_get_name (service);
+ parent = tracker_service_get_parent (service);
- parent = tracker_ontology_get_parent_service (service);
+ tracker_db_interface_execute_procedure (iface, NULL, "IncStat", service_type, NULL);
if (parent) {
tracker_db_interface_execute_procedure (iface, NULL, "IncStat", parent, NULL);
- g_free (parent);
}
}
gboolean
tracker_db_create_service (TrackerDBInterface *iface,
guint32 id,
- const char *service_type,
+ TrackerService *service,
const gchar *path,
GHashTable *metadata)
{
- TrackerService *service;
gchar *id_str, *service_type_id_str;
gchar *dirname, *basename;
- service = tracker_ontology_get_service_type_by_name (service_type);
-
if (!service) {
return FALSE;
}
Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-db.h
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-db.h (original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-db.h Fri May 30 09:40:15 2008
@@ -20,6 +20,7 @@
#ifndef __TRACKER_INDEXER_DB_H__
#define __TRACKER_INDEXER_DB_H__
+#include <libtracker-common/tracker-ontology.h>
#include <libtracker-db/tracker-db-interface.h>
G_BEGIN_DECLS
@@ -30,11 +31,11 @@
guint32 tracker_db_get_new_service_id (TrackerDBInterface *iface);
void tracker_db_increment_stats (TrackerDBInterface *iface,
- const gchar *service);
+ TrackerService *service);
gboolean tracker_db_create_service (TrackerDBInterface *iface,
guint32 id,
- const char *service_type,
+ TrackerService *service,
const gchar *path,
GHashTable *metadata);
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 Fri May 30 09:40:15 2008
@@ -48,6 +48,7 @@
#include <libtracker-common/tracker-config.h>
#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-ontology.h>
#include <libtracker-db/tracker-db-interface-sqlite.h>
#include <qdbm/depot.h>
@@ -346,6 +347,7 @@
metadata = tracker_indexer_module_get_file_metadata (info->module, info->path);
if (metadata) {
+ TrackerService *service;
TrackerIndexerPrivate *priv;
const gchar *service_type;
guint32 id;
@@ -353,10 +355,11 @@
priv = TRACKER_INDEXER_GET_PRIVATE (indexer);
service_type = tracker_indexer_module_get_name (info->module);
+ service = tracker_ontology_get_service_type_by_name (service_type);
id = tracker_db_get_new_service_id (priv->common);
- if (tracker_db_create_service (priv->metadata, id, service_type, info->path, metadata)) {
- tracker_db_increment_stats (priv->common, service_type);
+ if (tracker_db_create_service (priv->metadata, id, service, info->path, metadata)) {
+ tracker_db_increment_stats (priv->common, service);
/* FIXME
if (tracker_config_get_enable_xesam (tracker->config))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]