diff options
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-manager.c')
-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); |