diff options
author | Gabriel Ivascu <ivascu.gabriel59@gmail.com> | 2017-07-31 03:45:32 +0300 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2017-08-06 09:28:09 -0500 |
commit | 5aa6404157ce92cde758807792967bc402fa870c (patch) | |
tree | 69bb27b109de2e1383562a2b91cea38247dc0349 /src/bookmarks | |
parent | 39318d977d6fc63fa3224b7cdc34d7aa69369504 (diff) | |
download | epiphany-5aa6404157ce92cde758807792967bc402fa870c.tar.gz |
sync: Allow mobile bookmarks to be synced too
Have them displayed under a Mobile tag
Diffstat (limited to 'src/bookmarks')
-rw-r--r-- | src/bookmarks/ephy-bookmarks-manager.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/bookmarks/ephy-bookmarks-manager.c b/src/bookmarks/ephy-bookmarks-manager.c index 1a7ad913c..7fe9cf420 100644 --- a/src/bookmarks/ephy-bookmarks-manager.c +++ b/src/bookmarks/ephy-bookmarks-manager.c @@ -752,11 +752,13 @@ ephy_bookmarks_manager_handle_initial_merge (EphyBookmarksManager *self, char *parent_id; g_object_get (l->data, "type", &type, "parentid", &parent_id, NULL); - /* Ignore mobile/unfiled bookmarks and everything that is not of type bookmark. */ - if (g_strcmp0 (type, "bookmark") || - (!g_strcmp0 (parent_id, "mobile") || !g_strcmp0 (parent_id, "unfiled"))) + /* Ignore unfiled bookmarks and everything that is not of type bookmark. */ + if (g_strcmp0 (type, "bookmark") || !g_strcmp0 (parent_id, "unfiled")) goto next; + if (!g_strcmp0 (parent_id, "mobile") && !ephy_bookmark_has_tag (l->data, "Mobile")) + ephy_bookmark_add_tag (l->data, "Mobile"); + /* Bookmarks from server may miss the time added timestamp. */ if (!ephy_bookmark_get_time_added (l->data)) ephy_bookmark_set_time_added (l->data, g_get_real_time ()); @@ -843,11 +845,13 @@ ephy_bookmarks_manager_handle_regular_merge (EphyBookmarksManager *self, char *parent_id; g_object_get (l->data, "type", &type, "parentid", &parent_id, NULL); - /* Ignore mobile/unfiled bookmarks and everything that is not of type bookmark. */ - if (g_strcmp0 (type, "bookmark") || - (!g_strcmp0 (parent_id, "mobile") || !g_strcmp0 (parent_id, "unfiled"))) + /* Ignore unfiled bookmarks and everything that is not of type bookmark. */ + if (g_strcmp0 (type, "bookmark") || !g_strcmp0 (parent_id, "unfiled")) goto next; + if (!g_strcmp0 (parent_id, "mobile") && !ephy_bookmark_has_tag (l->data, "Mobile")) + ephy_bookmark_add_tag (l->data, "Mobile"); + /* Bookmarks from server may miss the time added timestamp. */ if (!ephy_bookmark_get_time_added (l->data)) ephy_bookmark_set_time_added (l->data, g_get_real_time ()); @@ -902,6 +906,9 @@ synchronizable_manager_merge (EphySynchronizableManager *manager, EphyBookmarksManager *self = EPHY_BOOKMARKS_MANAGER (manager); GSList *to_upload = NULL; + if (!ephy_bookmarks_manager_tag_exists (self, "Mobile")) + ephy_bookmarks_manager_create_tag (self, "Mobile"); + if (is_initial) to_upload = ephy_bookmarks_manager_handle_initial_merge (self, remotes_updated); |