[tracker/libtracker-miner: 263/263] Fix a few glitches in the merge with master.



commit 7b46173247d5df4097f062cee3f0e8722e611684
Author: Carlos Garnacho <carlos lanedo com>
Date:   Fri Sep 4 11:41:11 2009 +0200

    Fix a few glitches in the merge with master.

 src/tracker-miner-fs/tracker-miner-applications.c |    4 +-
 src/tracker-miner-fs/tracker-miner-files.c        |   29 ++++++++++-----------
 2 files changed, 16 insertions(+), 17 deletions(-)
---
diff --git a/src/tracker-miner-fs/tracker-miner-applications.c b/src/tracker-miner-fs/tracker-miner-applications.c
index db606ca..b00d1cd 100644
--- a/src/tracker-miner-fs/tracker-miner-applications.c
+++ b/src/tracker-miner-fs/tracker-miner-applications.c
@@ -236,6 +236,7 @@ miner_applications_process_file_cb (gpointer user_data)
 		return FALSE;
 	}
 
+	path = g_file_get_path (data->file);
 	cats = g_key_file_get_locale_string_list (key_file, GROUP_DESKTOP_ENTRY, "Categories", NULL, &cats_len, NULL);
 
 	if (!cats)
@@ -388,12 +389,10 @@ miner_applications_process_file_cb (gpointer user_data)
 		tracker_sparql_builder_predicate (sparql, "nie:dataSource");
 		tracker_sparql_builder_object_iri (sparql, APPLICATION_DATASOURCE_URN);
 
-		path = g_file_get_path (data->file);
 		filename = g_filename_display_basename (path);
 		tracker_sparql_builder_predicate (sparql, "nfo:fileName");
 		tracker_sparql_builder_object_string (sparql, filename);
 		g_free (filename);
-		g_free (path);
 
 		desktop_file_uri = g_file_get_uri (data->file);
 		tracker_sparql_builder_subject_iri (sparql, desktop_file_uri);
@@ -432,6 +431,7 @@ miner_applications_process_file_cb (gpointer user_data)
 	g_free (uri);
 	g_key_file_free (key_file);
 	g_free (type);
+	g_free (path);
 	g_free (name);
 
 	return FALSE;
diff --git a/src/tracker-miner-fs/tracker-miner-files.c b/src/tracker-miner-fs/tracker-miner-files.c
index 9d64591..33d0408 100644
--- a/src/tracker-miner-fs/tracker-miner-files.c
+++ b/src/tracker-miner-fs/tracker-miner-files.c
@@ -785,8 +785,10 @@ miner_files_add_to_datasource (TrackerMinerFiles    *mf,
 {
         TrackerMinerFilesPrivate *priv;
 	const gchar *removable_device_udi;
+	gchar *removable_device_urn, *uri;
 
         priv = TRACKER_MINER_FILES_GET_PRIVATE (mf);
+	uri = g_file_get_uri (file);
 
 #ifdef HAVE_HAL
 	removable_device_udi = tracker_storage_get_volume_udi_for_file (priv->storage, file);
@@ -795,27 +797,24 @@ miner_files_add_to_datasource (TrackerMinerFiles    *mf,
 #endif /* HAVE_HAL */
 
 	if (removable_device_udi) {
-		gchar *removable_device_urn;
-
 		removable_device_urn = g_strdup_printf (TRACKER_DATASOURCE_URN_PREFIX "%s",
 						        removable_device_udi);
+	} else {
+		removable_device_urn = g_strdup (TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN);
+	}
 
-		tracker_sparql_builder_subject_iri (sparql, removable_device_urn);
-		tracker_sparql_builder_predicate (sparql, "a");
-		tracker_sparql_builder_object (sparql, "tracker:Volume");
+	tracker_sparql_builder_subject_iri (sparql, uri);
+	tracker_sparql_builder_predicate (sparql, "a");
+	tracker_sparql_builder_object (sparql, "nfo:FileDataObject");
 
-		tracker_sparql_builder_predicate (sparql, "nie:dataSource");
-		tracker_sparql_builder_object_iri (sparql, removable_device_urn);
+        tracker_sparql_builder_predicate (sparql, "nie:dataSource");
+        tracker_sparql_builder_object_iri (sparql, removable_device_urn);
 
-		g_free (removable_device_urn);
-	} else {
-		tracker_sparql_builder_subject_iri (sparql, TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN);
-		tracker_sparql_builder_predicate (sparql, "a");
-		tracker_sparql_builder_object (sparql, "tracker:Volume");
+        tracker_sparql_builder_predicate (sparql, "tracker:available");
+        tracker_sparql_builder_object_boolean (sparql, TRUE);
 
-		tracker_sparql_builder_predicate (sparql, "nie:dataSource");
-		tracker_sparql_builder_object_iri (sparql, TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN);
-	}
+	g_free (removable_device_urn);
+	g_free (uri);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]