[tracker/tracker-0.12] tracker-miner-applications: Fix theme icon URIs
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.12] tracker-miner-applications: Fix theme icon URIs
- Date: Wed, 5 Oct 2011 08:55:51 +0000 (UTC)
commit 4332b3308a802df30bb14fd3f42103e649d07765
Author: JÃrg Billeter <j bitron ch>
Date: Tue Sep 27 09:58:46 2011 +0200
tracker-miner-applications: Fix theme icon URIs
src/miners/fs/tracker-miner-applications.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-applications.c b/src/miners/fs/tracker-miner-applications.c
index d74cf20..b20d6a6 100644
--- a/src/miners/fs/tracker-miner-applications.c
+++ b/src/miners/fs/tracker-miner-applications.c
@@ -473,12 +473,15 @@ process_desktop_file (ProcessApplicationData *data,
tracker_sparql_builder_object (sparql, "nfo:SoftwareCategory");
if (icon) {
+ gchar *escaped_icon;
gchar *icon_uri;
/* Sanitize icon */
g_strstrip (icon);
- icon_uri = g_strdup_printf (THEME_ICON_URN_PREFIX "%s", icon);
+ escaped_icon = g_uri_escape_string (icon, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, FALSE);
+
+ icon_uri = g_strdup_printf (THEME_ICON_URN_PREFIX "%s", escaped_icon);
tracker_sparql_builder_subject_iri (sparql, icon_uri);
tracker_sparql_builder_predicate (sparql, "a");
@@ -489,6 +492,7 @@ process_desktop_file (ProcessApplicationData *data,
tracker_sparql_builder_object_iri (sparql, icon_uri);
g_free (icon_uri);
+ g_free (escaped_icon);
g_free (icon);
}
@@ -670,12 +674,15 @@ process_desktop_file (ProcessApplicationData *data,
icon = g_key_file_get_string (key_file, GROUP_DESKTOP_ENTRY, "Icon", NULL);
if (icon) {
+ gchar *escaped_icon;
gchar *icon_uri;
/* Sanitize icon */
g_strstrip (icon);
- icon_uri = g_strdup_printf (THEME_ICON_URN_PREFIX "%s", icon);
+ escaped_icon = g_uri_escape_string (icon, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, FALSE);
+
+ icon_uri = g_strdup_printf (THEME_ICON_URN_PREFIX "%s", escaped_icon);
tracker_sparql_builder_subject_iri (sparql, icon_uri);
tracker_sparql_builder_predicate (sparql, "a");
@@ -686,6 +693,7 @@ process_desktop_file (ProcessApplicationData *data,
tracker_sparql_builder_object_iri (sparql, icon_uri);
g_free (icon_uri);
+ g_free (escaped_icon);
g_free (icon);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]