Blame SOURCES/0001-zpj-Use-an-HTTP-URL-as-nie-url.patch

e8dcec
From 4e095d31acb53b7f393dc7a5ecdbd427f2529a68 Mon Sep 17 00:00:00 2001
e8dcec
From: Debarshi Ray <debarshir@gnome.org>
e8dcec
Date: Mon, 27 Mar 2017 18:36:30 +0200
e8dcec
Subject: [PATCH] zpj: Use an HTTP URL as nie:url
e8dcec
e8dcec
The nao:identifier value is not a valid nie:url. The identifier has the
e8dcec
format "windows-live:skydrive:<id>", and is not a GVfs supported URI.
e8dcec
This is a problem because the nie:url is used to locate the path to
e8dcec
the entry's thumbnail in the desktop's thumbnail cache. Running
e8dcec
g_file_query_info (file, G_FILE_ATTRIBUTE_THUMBNAIL_PATH, ...) on such
e8dcec
a URI will fail. Therefore we use a fake OneDrive-namespaced URI that
e8dcec
GVfs understands.
e8dcec
e8dcec
Force a full reindex of OneDrive resources for existing users.
e8dcec
---
e8dcec
 src/gom-zpj-miner.c | 7 +++++--
e8dcec
 1 file changed, 5 insertions(+), 2 deletions(-)
e8dcec
e8dcec
diff --git a/src/gom-zpj-miner.c b/src/gom-zpj-miner.c
e8dcec
index 6dff947ada9d..da54c2a53be5 100644
e8dcec
--- a/src/gom-zpj-miner.c
e8dcec
+++ b/src/gom-zpj-miner.c
e8dcec
@@ -46,6 +46,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
e8dcec
   gchar *contact_resource;
e8dcec
   gchar *resource = NULL;
e8dcec
   gchar *date, *identifier;
e8dcec
+  gchar *url = NULL;
e8dcec
   const gchar *class = NULL, *id, *name;
e8dcec
   gboolean resource_exists, mtime_changed;
e8dcec
   gint64 new_mtime;
e8dcec
@@ -99,11 +100,12 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
e8dcec
     goto out;
e8dcec
 
e8dcec
   /* the resource changed - just set all the properties again */
e8dcec
+  url = g_strconcat ("http://onedrive.com/", id, NULL);
e8dcec
   gom_tracker_sparql_connection_insert_or_replace_triple
e8dcec
     (connection,
e8dcec
      cancellable, error,
e8dcec
      datasource_urn, resource,
e8dcec
-     "nie:url", identifier);
e8dcec
+     "nie:url", url);
e8dcec
 
e8dcec
   if (*error != NULL)
e8dcec
     goto out;
e8dcec
@@ -202,6 +204,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
e8dcec
  out:
e8dcec
   g_free (resource);
e8dcec
   g_free (identifier);
e8dcec
+  g_free (url);
e8dcec
 
e8dcec
   if (*error != NULL)
e8dcec
     return FALSE;
e8dcec
@@ -324,7 +327,7 @@ gom_zpj_miner_class_init (GomZpjMinerClass *klass)
e8dcec
 
e8dcec
   miner_class->goa_provider_type = "windows_live";
e8dcec
   miner_class->miner_identifier = MINER_IDENTIFIER;
e8dcec
-  miner_class->version = 1;
e8dcec
+  miner_class->version = 2;
e8dcec
 
e8dcec
   miner_class->create_services = create_services;
e8dcec
   miner_class->query = query_zpj;
e8dcec
-- 
e8dcec
2.9.3
e8dcec