diff options
author | networkException <git@nwex.de> | 2021-08-21 16:33:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-22 01:32:25 +0200 |
commit | acde7d12b0d2870feba3ebaaaf2ef99ac6fb41b3 (patch) | |
tree | 9ea1d89f621446ea24b9ee34ca93c73acef225a0 /Userland/Libraries | |
parent | 938051feb8d9340657251082f3fd4abffd57b813 (diff) | |
download | serenity-acde7d12b0d2870feba3ebaaaf2ef99ac6fb41b3.zip |
Everywhere: Rename get in ConfigFile::get_for_{lib,app,system} to open
This patch brings the ConfigFile helpers for opening lib, app and system
configs more inline with the regular ConfigFile::open functions.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibCore/ConfigFile.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibCore/ConfigFile.h | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/Desktop.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibLine/Editor.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibTLS/TLSv12.cpp | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/Userland/Libraries/LibCore/ConfigFile.cpp b/Userland/Libraries/LibCore/ConfigFile.cpp index a53a2a0aa3..d9edd1c00a 100644 --- a/Userland/Libraries/LibCore/ConfigFile.cpp +++ b/Userland/Libraries/LibCore/ConfigFile.cpp @@ -14,7 +14,7 @@ namespace Core { -NonnullRefPtr<ConfigFile> ConfigFile::get_for_lib(String const& lib_name, AllowWriting allow_altering) +NonnullRefPtr<ConfigFile> ConfigFile::open_for_lib(String const& lib_name, AllowWriting allow_altering) { String directory = StandardPaths::config_directory(); auto path = String::formatted("{}/lib/{}.ini", directory, lib_name); @@ -22,14 +22,14 @@ NonnullRefPtr<ConfigFile> ConfigFile::get_for_lib(String const& lib_name, AllowW return adopt_ref(*new ConfigFile(path, allow_altering)); } -NonnullRefPtr<ConfigFile> ConfigFile::get_for_app(String const& app_name, AllowWriting allow_altering) +NonnullRefPtr<ConfigFile> ConfigFile::open_for_app(String const& app_name, AllowWriting allow_altering) { String directory = StandardPaths::config_directory(); auto path = String::formatted("{}/{}.ini", directory, app_name); return adopt_ref(*new ConfigFile(path, allow_altering)); } -NonnullRefPtr<ConfigFile> ConfigFile::get_for_system(String const& app_name, AllowWriting allow_altering) +NonnullRefPtr<ConfigFile> ConfigFile::open_for_system(String const& app_name, AllowWriting allow_altering) { auto path = String::formatted("/etc/{}.ini", app_name); return adopt_ref(*new ConfigFile(path, allow_altering)); diff --git a/Userland/Libraries/LibCore/ConfigFile.h b/Userland/Libraries/LibCore/ConfigFile.h index aa0528f2f2..d2262cbb56 100644 --- a/Userland/Libraries/LibCore/ConfigFile.h +++ b/Userland/Libraries/LibCore/ConfigFile.h @@ -24,9 +24,9 @@ public: No, }; - static NonnullRefPtr<ConfigFile> get_for_lib(String const& lib_name, AllowWriting = AllowWriting::No); - static NonnullRefPtr<ConfigFile> get_for_app(String const& app_name, AllowWriting = AllowWriting::No); - static NonnullRefPtr<ConfigFile> get_for_system(String const& app_name, AllowWriting = AllowWriting::No); + static NonnullRefPtr<ConfigFile> open_for_lib(String const& lib_name, AllowWriting = AllowWriting::No); + static NonnullRefPtr<ConfigFile> open_for_app(String const& app_name, AllowWriting = AllowWriting::No); + static NonnullRefPtr<ConfigFile> open_for_system(String const& app_name, AllowWriting = AllowWriting::No); static NonnullRefPtr<ConfigFile> open(String const& filename, AllowWriting = AllowWriting::No); static NonnullRefPtr<ConfigFile> open(String const& filename, int fd); ~ConfigFile(); diff --git a/Userland/Libraries/LibGUI/Desktop.cpp b/Userland/Libraries/LibGUI/Desktop.cpp index 90c05247d1..465c3976cd 100644 --- a/Userland/Libraries/LibGUI/Desktop.cpp +++ b/Userland/Libraries/LibGUI/Desktop.cpp @@ -59,7 +59,7 @@ bool Desktop::set_wallpaper(const StringView& path, bool save_config) auto ret_val = WindowServerConnection::the().wait_for_specific_message<Messages::WindowClient::SetWallpaperFinished>()->success(); if (ret_val && save_config) { - RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("WindowManager", Core::ConfigFile::AllowWriting::Yes); + RefPtr<Core::ConfigFile> config = Core::ConfigFile::open_for_app("WindowManager", Core::ConfigFile::AllowWriting::Yes); dbgln("Saving wallpaper path '{}' to config file at {}", path, config->filename()); config->write_entry("Background", "Wallpaper", path); config->sync(); diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index 57790728e0..f274d120ab 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -39,7 +39,7 @@ namespace Line { Configuration Configuration::from_config(const StringView& libname) { Configuration configuration; - auto config_file = Core::ConfigFile::get_for_lib(libname); + auto config_file = Core::ConfigFile::open_for_lib(libname); // Read behaviour options. auto refresh = config_file->read_entry("behaviour", "refresh", "lazy"); diff --git a/Userland/Libraries/LibTLS/TLSv12.cpp b/Userland/Libraries/LibTLS/TLSv12.cpp index ff372f308f..059da14cde 100644 --- a/Userland/Libraries/LibTLS/TLSv12.cpp +++ b/Userland/Libraries/LibTLS/TLSv12.cpp @@ -348,7 +348,7 @@ Singleton<DefaultRootCACertificates> DefaultRootCACertificates::s_the; DefaultRootCACertificates::DefaultRootCACertificates() { // FIXME: This might not be the best format, find a better way to represent CA certificates. - auto config = Core::ConfigFile::get_for_system("ca_certs"); + auto config = Core::ConfigFile::open_for_system("ca_certs"); auto now = Core::DateTime::now(); auto last_year = Core::DateTime::create(now.year() - 1); auto next_year = Core::DateTime::create(now.year() + 1); |