[tracker/handle-desktop-links] tracker-miner-applications: Handle desktop files of type=Link



commit 7f69925c944de2ebfa440a1b8090f0b40ea0d020
Author: Carlos Garnacho <carlos lanedo com>
Date:   Wed Aug 31 18:08:42 2011 +0200

    tracker-miner-applications: Handle desktop files of type=Link
    
    Fixes NB#256958. Such desktop files are often just links to some URL,
    so handle these as nfo:Bookmark in the applications miner.

 src/miners/fs/tracker-miner-applications.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-applications.c b/src/miners/fs/tracker-miner-applications.c
index d6c6373..56d4749 100644
--- a/src/miners/fs/tracker-miner-applications.c
+++ b/src/miners/fs/tracker-miner-applications.c
@@ -509,6 +509,23 @@ process_desktop_file (ProcessApplicationData  *data,
 
 		tracker_sparql_builder_predicate (sparql, "nie:dataSource");
 		tracker_sparql_builder_object_iri (sparql, APPLICATION_DATASOURCE_URN);
+	} else if (name && g_ascii_strcasecmp (type, "Link") == 0) {
+		gchar *url = g_key_file_get_string (key_file, GROUP_DESKTOP_ENTRY, "URL", NULL);
+
+		uri = g_file_get_uri (data->file);
+		tracker_sparql_builder_insert_silent_open (sparql, TRACKER_MINER_FS_GRAPH_URN);
+
+		tracker_sparql_builder_subject_iri (sparql, uri);
+		tracker_sparql_builder_predicate (sparql, "a");
+		tracker_sparql_builder_object (sparql, "nfo:Bookmark");
+
+		tracker_sparql_builder_predicate (sparql, "nfo:bookmarks");
+		tracker_sparql_builder_object_iri (sparql, url);
+
+		tracker_sparql_builder_predicate (sparql, "nie:dataSource");
+		tracker_sparql_builder_object_iri (sparql, APPLICATION_DATASOURCE_URN);
+
+		is_software = FALSE;
 #ifdef HAVE_MEEGOTOUCH
 	} else if (name && g_ascii_strcasecmp (type, "ControlPanelApplet") == 0) {
 		/* Special case control panel applets */



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