tracker r2560 - in branches/turtle/src: libtracker-data trackerd
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2560 - in branches/turtle/src: libtracker-data trackerd
- Date: Tue, 25 Nov 2008 13:06:48 +0000 (UTC)
Author: pvanhoof
Date: Tue Nov 25 13:06:47 2008
New Revision: 2560
URL: http://svn.gnome.org/viewvc/tracker?rev=2560&view=rev
Log:
Various fixes
Modified:
branches/turtle/src/libtracker-data/tracker-turtle.c
branches/turtle/src/trackerd/tracker-backup.c
Modified: branches/turtle/src/libtracker-data/tracker-turtle.c
==============================================================================
--- branches/turtle/src/libtracker-data/tracker-turtle.c (original)
+++ branches/turtle/src/libtracker-data/tracker-turtle.c Tue Nov 25 13:06:47 2008
@@ -209,11 +209,10 @@
turtle = g_new0 (TurtleFile, 1);
turtle->file = fopen (turtle_file, "a");
-
/* Similar to a+ */
if (!turtle->file)
turtle->file = fopen (turtle_file, "w");
-
+
turtle->serializer = raptor_new_serializer ("turtle");
uri_string = raptor_uri_filename_to_uri_string (turtle_file);
@@ -230,10 +229,10 @@
void
-tracker_turtle_add_triple (TurtleFile *turtle,
- const gchar *uri,
+tracker_turtle_add_triple (TurtleFile *turtle,
+ const gchar *uri,
TrackerField *property,
- const gchar *value)
+ const gchar *value)
{
#ifdef HAVE_RAPTOR
gchar *about_uri;
@@ -244,7 +243,7 @@
} else {
about_uri = g_strdup_printf ("<file://%s>", uri);
}
-
+
g_debug ("turtle <%s, %s, %s>",
about_uri,
tracker_field_get_name (property),
@@ -274,7 +273,6 @@
raptor_serialize_end (turtle->serializer);
raptor_free_serializer(turtle->serializer);
fclose (turtle->file);
-
raptor_finish ();
g_free (turtle);
#endif
Modified: branches/turtle/src/trackerd/tracker-backup.c
==============================================================================
--- branches/turtle/src/trackerd/tracker-backup.c (original)
+++ branches/turtle/src/trackerd/tracker-backup.c Tue Nov 25 13:06:47 2008
@@ -49,18 +49,19 @@
static void
extended_result_set_to_turtle (TrackerDBResultSet *result_set)
{
- TrackerField *field;
- gint metadata_id;
- gboolean valid = TRUE;
+ TrackerField *field;
+ gint metadata_id;
+ gboolean valid = TRUE;
TrackerDataMetadata *metadata;
- TurtleFile *turtle_file;
+ TurtleFile *turtle_file;
- turtle_file = tracker_turtle_open ("/home/ivan/tracker-saving-things.ttl");
+ /* TODO: temporary location */
+ turtle_file = tracker_turtle_open ("/tmp/tracker-saving-things.ttl");
while (valid) {
GValue transform = {0, };
GValue value = {0, };
- gchar *str;
+ gchar *str = NULL;
gchar *uri;
g_value_init (&transform, G_TYPE_STRING);
@@ -89,29 +90,34 @@
g_free (str);
return;
}
- g_debug ("Insertion in turtle");
- tracker_turtle_add_triple (turtle_file, uri, field, str);
+
+ g_debug ("Insertion in turtle");
+ tracker_turtle_add_triple (turtle_file, uri, field, str);
+
+ g_free (str);
valid = tracker_db_result_set_iter_next (result_set);
}
- tracker_turtle_close (turtle_file);
+ tracker_turtle_close (turtle_file);
}
void
tracker_backup_save ()
{
- TrackerDBResultSet *data;
- TrackerService *service;
- GHashTable *trash;
+ TrackerDBResultSet *data;
+ TrackerService *service;
g_message ("***** tracker_backup: Saving metadata in turtle file *****");
- service = tracker_ontology_get_service_by_name ("Files");
- data = tracker_data_query_backup_metadata (service);
-
- extended_result_set_to_turtle (data);
+ service = tracker_ontology_get_service_by_name ("Files");
+ data = tracker_data_query_backup_metadata (service);
+
+ if (data) {
+ extended_result_set_to_turtle (data);
+ g_object_unref (data);
+ }
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]