mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
LibGUI/Desktop: Use LibConfig instead of Core::ConfigFile
This commit is contained in:
parent
5f783492cf
commit
d276657f85
2 changed files with 6 additions and 6 deletions
|
@ -124,4 +124,4 @@ set(GENERATED_SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_lib(LibGUI gui)
|
serenity_lib(LibGUI gui)
|
||||||
target_link_libraries(LibGUI LibCore LibGfx LibIPC LibThreading LibRegex LibSyntax)
|
target_link_libraries(LibGUI LibCore LibGfx LibIPC LibThreading LibRegex LibSyntax LibConfig)
|
||||||
|
|
|
@ -5,11 +5,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/Badge.h>
|
#include <AK/Badge.h>
|
||||||
#include <LibCore/ConfigFile.h>
|
|
||||||
#include <LibGUI/Desktop.h>
|
#include <LibGUI/Desktop.h>
|
||||||
#include <LibGUI/WindowServerConnection.h>
|
#include <LibGUI/WindowServerConnection.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
// Including this after to avoid LibIPC errors
|
||||||
|
#include <LibConfig/Client.h>
|
||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
Desktop& Desktop::the()
|
Desktop& Desktop::the()
|
||||||
|
@ -59,10 +61,8 @@ bool Desktop::set_wallpaper(const StringView& path, bool save_config)
|
||||||
auto ret_val = WindowServerConnection::the().wait_for_specific_message<Messages::WindowClient::SetWallpaperFinished>()->success();
|
auto ret_val = WindowServerConnection::the().wait_for_specific_message<Messages::WindowClient::SetWallpaperFinished>()->success();
|
||||||
|
|
||||||
if (ret_val && save_config) {
|
if (ret_val && save_config) {
|
||||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::open_for_app("WindowManager", Core::ConfigFile::AllowWriting::Yes);
|
dbgln("Saving wallpaper path '{}' to ConfigServer", path);
|
||||||
dbgln("Saving wallpaper path '{}' to config file at {}", path, config->filename());
|
Config::write_string("WindowManager", "Background", "Wallpaper", path);
|
||||||
config->write_entry("Background", "Wallpaper", path);
|
|
||||||
config->sync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret_val;
|
return ret_val;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue