[libshumate] file-cache: Fix bug when updating tiles
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libshumate] file-cache: Fix bug when updating tiles
- Date: Thu, 8 Apr 2021 07:41:23 +0000 (UTC)
commit 14f77633d86ff72688e6e5abf483f900903b8b85
Author: James Westman <james jwestman net>
Date: Thu Apr 8 00:10:33 2021 -0500
file-cache: Fix bug when updating tiles
When store_tile() was called and the tile already existed in the cache,
it would fail to overwrite it, because it was using
g_file_create_async() instead of g_file_replace_async().
shumate/shumate-file-cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/shumate/shumate-file-cache.c b/shumate/shumate-file-cache.c
index 870ccf4..d061901 100644
--- a/shumate/shumate-file-cache.c
+++ b/shumate/shumate-file-cache.c
@@ -958,7 +958,7 @@ shumate_file_cache_store_tile_async (ShumateFileCache *self,
data->filename = g_steal_pointer (&filename);
g_task_set_task_data (task, data, (GDestroyNotify) store_tile_data_free);
- g_file_create_async (file, G_FILE_CREATE_PRIVATE, G_PRIORITY_DEFAULT, cancellable, on_file_created,
g_object_ref (task));
+ g_file_replace_async (file, NULL, FALSE, G_FILE_CREATE_PRIVATE, G_PRIORITY_DEFAULT, cancellable,
on_file_created, g_object_ref (task));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]