[gnome-photos/wip/rishi/de-dup: 9/9] local-item: implement vfunc



commit 7ab16573644b2d01a8777a1669314cafb1828819
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Sep 6 20:46:05 2016 +0200

    local-item: implement vfunc

 src/photos-local-item.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-local-item.c b/src/photos-local-item.c
index 5cba1da..7f78e94 100644
--- a/src/photos-local-item.c
+++ b/src/photos-local-item.c
@@ -170,6 +170,39 @@ photos_local_item_get_source_widget (PhotosBaseItem *item)
 }
 
 
+static gboolean
+photos_local_item_metadata_add_shared (PhotosBaseItem  *item,
+                                       const gchar     *provider_type,
+                                       const gchar     *account_identity,
+                                       const gchar     *shared_id,
+                                       GCancellable    *cancellable,
+                                       GError         **error)
+{
+  GExiv2Metadata *metadata = NULL;
+  gboolean ret_val == FALSE;
+  gchar *path = NULL;
+
+  path = photos_base_item_download (item, cancellable, error);
+  if (path == NULL)
+    goto out;
+
+  metadata = gexiv2_metadata_new ();
+
+  if (!gexiv2_metadata_open_path (metadata, path, error))
+    goto out;
+
+  if (!gexiv2_metadata_save_file (metadata, path, error))
+    goto out;
+
+  ret_val = TRUE;
+
+ out:
+  g_clear_object (&metadata);
+  g_free (path);
+  return ret_val;
+}
+
+
 static void
 photos_local_item_trash_finish (GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
@@ -271,5 +304,6 @@ photos_local_item_class_init (PhotosLocalItemClass *class)
   base_item_class->create_thumbnail = photos_local_item_create_thumbnail;
   base_item_class->download = photos_local_item_download;
   base_item_class->get_source_widget = photos_local_item_get_source_widget;
+  base_item_class->metadata_add_shared = photos_local_item_metadata_add_shared;
   base_item_class->trash = photos_local_item_trash;
 }


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