[epiphany/wip/ephy-sync: 111/126] bookmarks-manager: Make 'id' and 'modified' fields persistent



commit ccfd3f55d3ceb8c4150eab904a515679ad1ee8b0
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Mon Aug 8 21:48:07 2016 +0300

    bookmarks-manager: Make 'id' and 'modified' fields persistent

 src/ephy-bookmarks-manager.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-bookmarks-manager.c b/src/ephy-bookmarks-manager.c
index 39f4413..986ab95 100644
--- a/src/ephy-bookmarks-manager.c
+++ b/src/ephy-bookmarks-manager.c
@@ -68,10 +68,12 @@ build_variant (EphyBookmark *bookmark)
   GSequence *tags;
   GSequenceIter *iter;
 
-  g_variant_builder_init (&builder, G_VARIANT_TYPE ("(xsas)"));
+  g_variant_builder_init (&builder, G_VARIANT_TYPE ("(xssdas)"));
 
   g_variant_builder_add (&builder, "x", ephy_bookmark_get_time_added (bookmark));
   g_variant_builder_add (&builder, "s", ephy_bookmark_get_title (bookmark));
+  g_variant_builder_add (&builder, "s", ephy_bookmark_get_id (bookmark));
+  g_variant_builder_add (&builder, "d", ephy_bookmark_get_modified (bookmark));
 
   g_variant_builder_open (&builder, G_VARIANT_TYPE ("as"));
   tags = ephy_bookmark_get_tags (bookmark);
@@ -568,11 +570,13 @@ ephy_bookmarks_manager_load_from_file (EphyBookmarksManager *self)
     char *tag;
     char *title;
     gint64 time_added;
+    char *id;
+    double modified;
 
     /* Obtain the correspoding GVariant. */
     value = gvdb_table_get_value (table, list[i]);
 
-    g_variant_get (value, "(x&sas)", &time_added, &title, &iter);
+    g_variant_get (value, "(x&s&sdas)", &time_added, &title, &id, &modified, &iter);
 
     /* Add all stored tags in a GSequence. */
     tags = g_sequence_new (g_free);
@@ -586,6 +590,8 @@ ephy_bookmarks_manager_load_from_file (EphyBookmarksManager *self)
     /* Create the new bookmark. */
     bookmark = ephy_bookmark_new (g_strdup (list[i]), title, tags);
     ephy_bookmark_set_time_added (bookmark, time_added);
+    ephy_bookmark_set_id (bookmark, id);
+    ephy_bookmark_set_modified (bookmark, modified);
     g_sequence_prepend (bookmarks, bookmark);
   }
   ephy_bookmarks_manager_add_bookmarks (self, bookmarks);


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