[gnome-online-miners/wip/rishi/insert-share: 21/24] gdata: Accept a NULL 'parent_resource_urn'



commit c7d7b3194a14574a99cb0348c52918862080d0ad
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Sep 5 16:15:52 2016 +0200

    gdata: Accept a NULL 'parent_resource_urn'
    
    This will let us use this code from the insert_shared_content
    implementation.

 src/gom-gdata-miner.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/src/gom-gdata-miner.c b/src/gom-gdata-miner.c
index e189941..5cae579 100644
--- a/src/gom-gdata-miner.c
+++ b/src/gom-gdata-miner.c
@@ -453,14 +453,17 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
   if (*error != NULL)
     goto out;
 
-  gom_tracker_sparql_connection_insert_or_replace_triple
-    (connection,
-     cancellable, error,
-     datasource_urn, resource,
-     "nie:isPartOf", parent_resource_urn);
+  if (parent_resource_urn != NULL)
+    {
+      gom_tracker_sparql_connection_insert_or_replace_triple
+        (connection,
+         cancellable, error,
+         datasource_urn, resource,
+         "nie:isPartOf", parent_resource_urn);
 
-  if (*error != NULL)
-    goto out;
+      if (*error != NULL)
+        goto out;
+    }
 
   mime = gdata_media_content_get_content_type (GDATA_MEDIA_CONTENT (media_contents->data));
   gom_tracker_sparql_connection_insert_or_replace_triple


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