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

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