summaryrefslogtreecommitdiff
path: root/src/bookmarks/ephy-bookmark-properties-grid.c
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2019-06-20 17:17:05 -0500
committerMichael Catanzaro <mcatanzaro@igalia.com>2019-06-22 13:52:52 -0500
commitcc32bc817bb6e57928a59d36b051e15be8b91bd0 (patch)
treee7ac41be05aa9ab9ea70d696bb07fc2e9e0957f1 /src/bookmarks/ephy-bookmark-properties-grid.c
parentc5ccd9f7ef801e2deff08bf5d8ec1996656f5e2e (diff)
downloadepiphany-cc32bc817bb6e57928a59d36b051e15be8b91bd0.tar.gz
Make ephy_bookmarks_manager_save_to_file_async() actually async
Currently it looks like an asynchronous function, but it actually does sync I/O, which is bad. This also requires also making ephy_bookmarks_export() async, which required adding gvdb_table_write_contents_async(), which I upstreamed to GVDB. (It was added to Epiphany in the previous commit.) It also requires adding GCancellable parameters where required, to avoid introducing new crashes. This means we need a way for external code to access the EphyBookmarkManager's cancellable or we would need to get rid of the warn_on_error convenience callback. Also, remove ephy_bookmarks_manager_load_from_file(), since it's only one line long and only used in one place. Finally, rename the functions according to Carlos's feedback. Fixes #336
Diffstat (limited to 'src/bookmarks/ephy-bookmark-properties-grid.c')
-rw-r--r--src/bookmarks/ephy-bookmark-properties-grid.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bookmarks/ephy-bookmark-properties-grid.c b/src/bookmarks/ephy-bookmark-properties-grid.c
index 63899ff05..9703f93b5 100644
--- a/src/bookmarks/ephy-bookmark-properties-grid.c
+++ b/src/bookmarks/ephy-bookmark-properties-grid.c
@@ -421,9 +421,10 @@ ephy_bookmark_properties_grid_finalize (GObject *object)
if (self->bookmark_is_modified && !self->bookmark_is_removed)
g_signal_emit_by_name (self->manager, "synchronizable-modified", self->bookmark, FALSE);
- ephy_bookmarks_manager_save_to_file_async (self->manager, NULL,
- ephy_bookmarks_manager_save_to_file_warn_on_error_cb,
- NULL);
+ ephy_bookmarks_manager_save (self->manager,
+ ephy_bookmarks_manager_save_warn_on_error_cancellable (self->manager),
+ ephy_bookmarks_manager_save_warn_on_error_cb,
+ NULL);
G_OBJECT_CLASS (ephy_bookmark_properties_grid_parent_class)->finalize (object);
}