[xdg-desktop-portal-gnome/gnome-42] wallpaper: Handle the error when storing an image in the cache
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [xdg-desktop-portal-gnome/gnome-42] wallpaper: Handle the error when storing an image in the cache
- Date: Sun, 3 Jul 2022 13:37:06 +0000 (UTC)
commit 0ad441729b419447eeb54de35730336ae0ddf36b
Author: Debarshi Ray <debarshir gnome org>
Date: Sat Jul 2 18:24:24 2022 +0200
wallpaper: Handle the error when storing an image in the cache
https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/merge_requests/46
src/wallpaper.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/wallpaper.c b/src/wallpaper.c
index b6c393d..6ba8376 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -105,13 +105,17 @@ on_file_copy_cb (GObject *source_object,
}
destination = g_file_new_for_path (handle->picture_uri);
- g_file_replace_contents (destination,
- contents,
- length,
- NULL, FALSE,
- G_FILE_CREATE_REPLACE_DESTINATION,
- NULL, NULL,
- &error);
+ if (!g_file_replace_contents (destination,
+ contents,
+ length,
+ NULL, FALSE,
+ G_FILE_CREATE_REPLACE_DESTINATION,
+ NULL, NULL,
+ &error))
+ {
+ g_warning ("Failed to store image as '%s': %s", handle->picture_uri, error->message);
+ goto out;
+ }
if (set_gsettings (BACKGROUND_SCHEMA, handle->picture_uri))
handle->response = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]