[gnome-photos/wip/uajain/side-car-file: 80/81] local-item: Store edits in side-car files



commit b8a90b07f774b9af0d062590cfb97ec20e4a8d6b
Author: Umang Jain <mailumangjain gmail com>
Date:   Sat Feb 10 03:21:32 2018 +0530

    local-item: Store edits in side-car files
    
    https://gitlab.gnome.org/GNOME/gnome-photos/issues/87

 src/photos-local-item.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/src/photos-local-item.c b/src/photos-local-item.c
index f46e2751..311dd34c 100644
--- a/src/photos-local-item.c
+++ b/src/photos-local-item.c
@@ -108,17 +108,26 @@ photos_local_item_create_name_fallback (PhotosBaseItem *item)
 static gchar *
 photos_local_item_get_pipeline_path (PhotosLocalItem *self)
 {
-  const gchar *data_dir;
   const gchar *uri;
-  g_autofree gchar *md5 = NULL;
-  gchar *path;
+  g_autofree gchar *item_path = NULL;
+  gchar *path = NULL;
 
   uri = photos_base_item_get_uri (PHOTOS_BASE_ITEM (self));
-  md5 = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1);
-  data_dir = g_get_user_data_dir ();
 
-  path = g_build_filename (data_dir, PACKAGE_TARNAME, "local", md5, NULL);
+  {
+    g_autoptr (GError) error = NULL;
+
+    item_path = g_filename_from_uri (uri, NULL, &error);
+    if (!item_path)
+      {
+        g_warning ("Unable to create filename for pipeline: %s", error->message);
+        goto out;
+      }
+  }
+
+  path = g_strconcat (item_path, ".gnome-photos", NULL);
 
+ out:
   return path;
 }
 


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