From 81fe2ef178137876a96f37185929bb3670e15174 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 7 Dec 2022 15:37:45 +0000 Subject: [PATCH] FileManager: Silence the "not found" error when setting no wallpaper If we're setting the path to "" then we can just set the wallpaper to nullptr and carry on with our day. :^) --- Userland/Applications/FileManager/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp index 9c8433d000..71116882c6 100644 --- a/Userland/Applications/FileManager/main.cpp +++ b/Userland/Applications/FileManager/main.cpp @@ -540,6 +540,10 @@ ErrorOr run_in_desktop_mode() virtual void config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value) override { if (domain == "WindowManager" && group == "Background" && key == "Wallpaper") { + if (value.is_empty()) { + GUI::Desktop::the().set_wallpaper(nullptr, {}); + return; + } auto wallpaper_bitmap_or_error = Gfx::Bitmap::try_load_from_file(value); if (wallpaper_bitmap_or_error.is_error()) dbgln("Failed to load wallpaper bitmap from path: {}", wallpaper_bitmap_or_error.error());