[gnome-online-miners/wip/rishi/insert-share: 20/24] gdata: Accept a NULL 'previous_resources'
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-miners/wip/rishi/insert-share: 20/24] gdata: Accept a NULL 'previous_resources'
- Date: Mon, 5 Sep 2016 15:04:34 +0000 (UTC)
commit f7a12be4b8dc771a1581bca2fceb298211f03104
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Sep 5 16:14:27 2016 +0200
gdata: Accept a NULL 'previous_resources'
This will let us use this code from the insert_shared_content
implementation.
https://bugzilla.gnome.org/show_bug.cgi?id=770899
src/gom-gdata-miner.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/gom-gdata-miner.c b/src/gom-gdata-miner.c
index 16f6577..e189941 100644
--- a/src/gom-gdata-miner.c
+++ b/src/gom-gdata-miner.c
@@ -100,8 +100,9 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
identifier = g_strdup_printf ("%s%s", PREFIX_DRIVE, id);
}
- /* remove from the list of the previous resources */
- g_hash_table_remove (previous_resources, identifier);
+ /* remove from the list of the previous resources, if any */
+ if (previous_resources != NULL)
+ g_hash_table_remove (previous_resources, identifier);
if (GDATA_IS_DOCUMENTS_PRESENTATION (doc_entry))
class = "nfo:Presentation";
@@ -393,8 +394,9 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
identifier = g_strdup_printf ("%s%s", PREFIX_PICASAWEB, id);
- /* remove from the list of the previous resources */
- g_hash_table_remove (previous_resources, identifier);
+ /* remove from the list of the previous resources, if any */
+ if (previous_resources != NULL)
+ g_hash_table_remove (previous_resources, identifier);
resource = gom_tracker_sparql_connection_ensure_resource
(connection,
@@ -656,8 +658,9 @@ account_miner_job_process_album (GomAccountMinerJob *job,
album_id = gdata_entry_get_id (GDATA_ENTRY (album));
identifier = g_strdup_printf ("photos:collection:%s%s", PREFIX_PICASAWEB, album_id);
- /* remove from the list of the previous resources */
- g_hash_table_remove (previous_resources, identifier);
+ /* remove from the list of the previous resources, if any */
+ if (previous_resources != NULL)
+ g_hash_table_remove (previous_resources, identifier);
resource = gom_tracker_sparql_connection_ensure_resource
(connection,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]