mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
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.
This commit is contained in:
parent
938051feb8
commit
acde7d12b0
Notes:
sideshowbarker
2024-07-18 05:25:19 +09:00
Author: https://github.com/networkException Commit: https://github.com/SerenityOS/serenity/commit/acde7d12b0d Pull-request: https://github.com/SerenityOS/serenity/pull/9501 Reviewed-by: https://github.com/awesomekling
37 changed files with 51 additions and 51 deletions
|
@ -211,9 +211,9 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("AudioApplet", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("AudioApplet", Core::ConfigFile::AllowWriting::Yes);
|
||||
// To not upset the audio server state, we responsibly read this once.
|
||||
auto audio_master_config = Core::ConfigFile::get_for_app("Audio");
|
||||
auto audio_master_config = Core::ConfigFile::open_for_app("Audio");
|
||||
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
|
|
|
@ -277,7 +277,7 @@ void BrowserWindow::build_menus()
|
|||
|
||||
m_change_homepage_action = GUI::Action::create(
|
||||
"Set Homepage URL", [this](auto&) {
|
||||
auto config = Core::ConfigFile::get_for_app("Browser", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Browser", Core::ConfigFile::AllowWriting::Yes);
|
||||
String homepage_url = config->read_entry("Preferences", "Home", "about:blank");
|
||||
if (GUI::InputBox::show(this, homepage_url, "Enter URL", "Change homepage URL") == GUI::InputBox::ExecOK) {
|
||||
if (URL(homepage_url).is_valid()) {
|
||||
|
@ -300,7 +300,7 @@ void BrowserWindow::build_menus()
|
|||
auto action = GUI::Action::create_checkable(
|
||||
name, [&](auto&) {
|
||||
g_search_engine = url_format;
|
||||
auto config = Core::ConfigFile::get_for_app("Browser", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Browser", Core::ConfigFile::AllowWriting::Yes);
|
||||
config->write_entry("Preferences", "SearchEngine", g_search_engine);
|
||||
},
|
||||
this);
|
||||
|
@ -317,7 +317,7 @@ void BrowserWindow::build_menus()
|
|||
m_disable_search_engine_action = GUI::Action::create_checkable(
|
||||
"Disable", [](auto&) {
|
||||
g_search_engine = {};
|
||||
auto config = Core::ConfigFile::get_for_app("Browser", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Browser", Core::ConfigFile::AllowWriting::Yes);
|
||||
config->write_entry("Preferences", "SearchEngine", g_search_engine);
|
||||
},
|
||||
this);
|
||||
|
@ -347,7 +347,7 @@ void BrowserWindow::build_menus()
|
|||
}
|
||||
|
||||
g_search_engine = search_engine;
|
||||
auto config = Core::ConfigFile::get_for_app("Browser", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Browser", Core::ConfigFile::AllowWriting::Yes);
|
||||
config->write_entry("Preferences", "SearchEngine", g_search_engine);
|
||||
action.set_status_tip(search_engine);
|
||||
});
|
||||
|
|
|
@ -36,7 +36,7 @@ DownloadWidget::DownloadWidget(const URL& url)
|
|||
m_destination_path = builder.to_string();
|
||||
}
|
||||
|
||||
auto browser_config = Core::ConfigFile::get_for_app("Browser");
|
||||
auto browser_config = Core::ConfigFile::open_for_app("Browser");
|
||||
auto close_on_finish = browser_config->read_bool_entry("Preferences", "CloseDownloadWidgetOnFinish", false);
|
||||
|
||||
m_elapsed_timer.start();
|
||||
|
@ -90,7 +90,7 @@ DownloadWidget::DownloadWidget(const URL& url)
|
|||
m_close_on_finish_checkbox->set_checked(close_on_finish);
|
||||
|
||||
m_close_on_finish_checkbox->on_checked = [&](bool checked) {
|
||||
auto browser_config = Core::ConfigFile::get_for_app("Browser", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto browser_config = Core::ConfigFile::open_for_app("Browser", Core::ConfigFile::AllowWriting::Yes);
|
||||
browser_config->write_bool_entry("Preferences", "CloseDownloadWidgetOnFinish", checked);
|
||||
};
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto app_icon = GUI::Icon::default_icon("app-browser");
|
||||
|
||||
auto m_config = Core::ConfigFile::get_for_app("Browser");
|
||||
auto m_config = Core::ConfigFile::open_for_app("Browser");
|
||||
Browser::g_home_url = m_config->read_entry("Preferences", "Home", "about:blank");
|
||||
Browser::g_search_engine = m_config->read_entry("Preferences", "SearchEngine", {});
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ void BackgroundSettingsWidget::create_frame()
|
|||
void BackgroundSettingsWidget::load_current_settings()
|
||||
{
|
||||
auto ws_config = Core::ConfigFile::open("/etc/WindowServer.ini");
|
||||
auto wm_config = Core::ConfigFile::get_for_app("WindowManager");
|
||||
auto wm_config = Core::ConfigFile::open_for_app("WindowManager");
|
||||
|
||||
auto selected_wallpaper = wm_config->read_entry("Background", "Wallpaper", "");
|
||||
if (!selected_wallpaper.is_empty()) {
|
||||
|
@ -118,7 +118,7 @@ void BackgroundSettingsWidget::load_current_settings()
|
|||
|
||||
void BackgroundSettingsWidget::apply_settings()
|
||||
{
|
||||
auto wm_config = Core::ConfigFile::get_for_app("WindowManager", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto wm_config = Core::ConfigFile::open_for_app("WindowManager", Core::ConfigFile::AllowWriting::Yes);
|
||||
wm_config->write_entry("Background", "Wallpaper", m_monitor_widget->wallpaper());
|
||||
|
||||
if (!m_monitor_widget->wallpaper().is_empty()) {
|
||||
|
|
|
@ -75,7 +75,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("FileManager", Core::ConfigFile::AllowWriting::Yes);
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::open_for_app("FileManager", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
bool is_desktop_mode { false }, is_selection_mode { false }, ignore_path_resolution { false };
|
||||
|
@ -415,7 +415,7 @@ int run_in_desktop_mode([[maybe_unused]] RefPtr<Core::ConfigFile> config)
|
|||
}
|
||||
};
|
||||
|
||||
auto wm_config = Core::ConfigFile::get_for_app("WindowManager");
|
||||
auto wm_config = Core::ConfigFile::open_for_app("WindowManager");
|
||||
auto selected_wallpaper = wm_config->read_entry("Background", "Wallpaper", "");
|
||||
if (!selected_wallpaper.is_empty()) {
|
||||
GUI::Desktop::the().set_wallpaper(selected_wallpaper, false);
|
||||
|
|
|
@ -35,7 +35,7 @@ HexEditorWidget::HexEditorWidget()
|
|||
{
|
||||
load_from_gml(hex_editor_window_gml);
|
||||
|
||||
m_config = Core::ConfigFile::get_for_app("HexEditor", Core::ConfigFile::AllowWriting::Yes);
|
||||
m_config = Core::ConfigFile::open_for_app("HexEditor", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
m_toolbar = *find_descendant_of_type_named<GUI::Toolbar>("toolbar");
|
||||
m_toolbar_container = *find_descendant_of_type_named<GUI::ToolbarContainer>("toolbar_container");
|
||||
|
|
|
@ -47,7 +47,7 @@ IRCClient::IRCClient(String server, int port)
|
|||
: m_nickname("seren1ty")
|
||||
, m_client_window_list_model(IRCWindowListModel::create(*this))
|
||||
, m_log(IRCLogBuffer::create())
|
||||
, m_config(Core::ConfigFile::get_for_app("IRCClient", Core::ConfigFile::AllowWriting::Yes))
|
||||
, m_config(Core::ConfigFile::open_for_app("IRCClient", Core::ConfigFile::AllowWriting::Yes))
|
||||
{
|
||||
struct passwd* user_pw = getpwuid(getuid());
|
||||
m_socket = Core::TCPSocket::construct(this);
|
||||
|
|
|
@ -38,7 +38,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("KeyboardSettings", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("KeyboardSettings", Core::ConfigFile::AllowWriting::Yes);
|
||||
if (unveil(config->filename().characters(), "rwc") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
|
|
|
@ -100,7 +100,7 @@ MailWidget::~MailWidget()
|
|||
|
||||
bool MailWidget::connect_and_login()
|
||||
{
|
||||
auto config = Core::ConfigFile::get_for_app("Mail");
|
||||
auto config = Core::ConfigFile::open_for_app("Mail");
|
||||
|
||||
auto server = config->read_entry("Connection", "Server", {});
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ void MailSettingsWindow::write_values()
|
|||
|
||||
MailSettingsWindow::MailSettingsWindow()
|
||||
{
|
||||
m_config = Core::ConfigFile::get_for_app("Mail", Core::ConfigFile::AllowWriting::Yes);
|
||||
m_config = Core::ConfigFile::open_for_app("Mail", Core::ConfigFile::AllowWriting::Yes);
|
||||
if (unveil(m_config->filename().characters(), "rwc") < 0) {
|
||||
perror("unveil");
|
||||
GUI::Application::the()->quit();
|
||||
|
|
|
@ -291,7 +291,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Terminal", Core::ConfigFile::AllowWriting::Yes);
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::open_for_app("Terminal", Core::ConfigFile::AllowWriting::Yes);
|
||||
Core::File::ensure_parent_directories(config->filename());
|
||||
|
||||
int ptm_fd;
|
||||
|
|
|
@ -47,7 +47,7 @@ MainWidget::MainWidget()
|
|||
{
|
||||
load_from_gml(text_editor_window_gml);
|
||||
|
||||
m_config = Core::ConfigFile::get_for_app("TextEditor", Core::ConfigFile::AllowWriting::Yes);
|
||||
m_config = Core::ConfigFile::open_for_app("TextEditor", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
m_toolbar = *find_descendant_of_type_named<GUI::Toolbar>("toolbar");
|
||||
m_toolbar_container = *find_descendant_of_type_named<GUI::ToolbarContainer>("toolbar_container");
|
||||
|
|
|
@ -157,7 +157,7 @@ TerminalWrapper::TerminalWrapper(bool user_spawned)
|
|||
{
|
||||
set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Terminal");
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::open_for_app("Terminal");
|
||||
m_terminal_widget = add<VT::TerminalWidget>(-1, false, config);
|
||||
|
||||
if (user_spawned)
|
||||
|
|
|
@ -37,7 +37,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto window = GUI::Window::construct();
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("2048", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("2048", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
size_t board_size = config->read_num_entry("", "board_size", 4);
|
||||
u32 target_tile = config->read_num_entry("", "target_tile", 2048);
|
||||
|
|
|
@ -26,7 +26,7 @@ int main(int argc, char** argv)
|
|||
auto window = GUI::Window::construct();
|
||||
auto& widget = window->set_main_widget<ChessWidget>();
|
||||
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Chess", Core::ConfigFile::AllowWriting::Yes);
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::open_for_app("Chess", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio rpath wpath cpath recvfd sendfd thread proc exec", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -22,7 +22,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto config = Core::ConfigFile::get_for_app("FlappyBug", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("FlappyBug", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio rpath wpath cpath recvfd sendfd", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -26,7 +26,7 @@ int main(int argc, char** argv)
|
|||
{
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto app_icon = GUI::Icon::default_icon("app-hearts");
|
||||
auto config = Core::ConfigFile::get_for_app("Hearts", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Hearts", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio recvfd sendfd rpath wpath cpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -137,7 +137,7 @@ Field::Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_b
|
|||
set_face(Face::Default);
|
||||
|
||||
{
|
||||
auto config = Core::ConfigFile::get_for_app("Minesweeper");
|
||||
auto config = Core::ConfigFile::open_for_app("Minesweeper");
|
||||
bool single_chording = config->read_num_entry("Minesweeper", "SingleChording", false);
|
||||
int mine_count = config->read_num_entry("Game", "MineCount", 10);
|
||||
int rows = config->read_num_entry("Game", "Rows", 9);
|
||||
|
@ -488,7 +488,7 @@ void Field::set_field_size(size_t rows, size_t columns, size_t mine_count)
|
|||
if (m_rows == rows && m_columns == columns && m_mine_count == mine_count)
|
||||
return;
|
||||
{
|
||||
auto config = Core::ConfigFile::get_for_app("Minesweeper", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Minesweeper", Core::ConfigFile::AllowWriting::Yes);
|
||||
config->write_num_entry("Game", "MineCount", mine_count);
|
||||
config->write_num_entry("Game", "Rows", rows);
|
||||
config->write_num_entry("Game", "Columns", columns);
|
||||
|
@ -503,7 +503,7 @@ void Field::set_field_size(size_t rows, size_t columns, size_t mine_count)
|
|||
|
||||
void Field::set_single_chording(bool enabled)
|
||||
{
|
||||
auto config = Core::ConfigFile::get_for_app("Minesweeper", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Minesweeper", Core::ConfigFile::AllowWriting::Yes);
|
||||
m_single_chording = enabled;
|
||||
config->write_bool_entry("Minesweeper", "SingleChording", m_single_chording);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("Minesweeper");
|
||||
auto config = Core::ConfigFile::open_for_app("Minesweeper");
|
||||
|
||||
if (unveil("/res", "r") < 0) {
|
||||
perror("unveil");
|
||||
|
|
|
@ -28,7 +28,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("Pong");
|
||||
auto config = Core::ConfigFile::open_for_app("Pong");
|
||||
|
||||
if (unveil("/res", "r") < 0) {
|
||||
perror("unveil");
|
||||
|
|
|
@ -23,7 +23,7 @@ SnakeGame::SnakeGame()
|
|||
srand(time(nullptr));
|
||||
reset();
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("Snake");
|
||||
auto config = Core::ConfigFile::open_for_app("Snake");
|
||||
m_high_score = config->read_num_entry("Snake", "HighScore", 0);
|
||||
m_high_score_text = String::formatted("Best: {}", m_high_score);
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ void SnakeGame::timer_event(Core::TimerEvent&)
|
|||
m_high_score = m_score;
|
||||
m_high_score_text = String::formatted("Best: {}", m_high_score);
|
||||
update(high_score_rect());
|
||||
auto config = Core::ConfigFile::get_for_app("Snake", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Snake", Core::ConfigFile::AllowWriting::Yes);
|
||||
config->write_num_entry("Snake", "HighScore", m_high_score);
|
||||
}
|
||||
update(score_rect());
|
||||
|
|
|
@ -31,7 +31,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("Snake");
|
||||
auto config = Core::ConfigFile::open_for_app("Snake");
|
||||
|
||||
if (unveil("/res", "r") < 0) {
|
||||
perror("unveil");
|
||||
|
|
|
@ -24,7 +24,7 @@ int main(int argc, char** argv)
|
|||
{
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto app_icon = GUI::Icon::default_icon("app-solitaire");
|
||||
auto config = Core::ConfigFile::get_for_app("Solitaire", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Solitaire", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio recvfd sendfd rpath wpath cpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -39,7 +39,7 @@ int main(int argc, char** argv)
|
|||
{
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto app_icon = GUI::Icon::default_icon("app-spider");
|
||||
auto config = Core::ConfigFile::get_for_app("Spider", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Spider", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio recvfd sendfd rpath wpath cpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -17,7 +17,7 @@ int main(int, char**)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("Audio", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Audio", Core::ConfigFile::AllowWriting::Yes);
|
||||
if (unveil(config->filename().characters(), "rwc") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
|
|
|
@ -19,7 +19,7 @@ int main()
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto keyboard_settings_config = Core::ConfigFile::get_for_app("KeyboardSettings");
|
||||
auto keyboard_settings_config = Core::ConfigFile::open_for_app("KeyboardSettings");
|
||||
|
||||
if (unveil("/bin/keymap", "x") < 0) {
|
||||
perror("unveil /bin/keymap");
|
||||
|
|
|
@ -20,7 +20,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
|
|||
auto launcher = LaunchServer::Launcher();
|
||||
|
||||
launcher.load_handlers();
|
||||
launcher.load_config(Core::ConfigFile::get_for_app("LaunchServer"));
|
||||
launcher.load_config(Core::ConfigFile::open_for_app("LaunchServer"));
|
||||
|
||||
if (pledge("stdio accept rpath proc exec", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -37,7 +37,7 @@ LookupServer::LookupServer()
|
|||
VERIFY(s_the == nullptr);
|
||||
s_the = this;
|
||||
|
||||
auto config = Core::ConfigFile::get_for_system("LookupServer");
|
||||
auto config = Core::ConfigFile::open_for_system("LookupServer");
|
||||
dbgln("Using network config file at {}", config->filename());
|
||||
m_nameservers = config->read_entry("DNS", "Nameservers", "1.1.1.1,1.0.0.1").split(',');
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ int main(int, char**)
|
|||
// Read our config and instantiate services.
|
||||
// This takes care of setting up sockets.
|
||||
NonnullRefPtrVector<Service> services;
|
||||
auto config = Core::ConfigFile::get_for_system("SystemServer");
|
||||
auto config = Core::ConfigFile::open_for_system("SystemServer");
|
||||
for (auto name : config->groups()) {
|
||||
auto service = Service::construct(*config, name);
|
||||
if (service->is_enabled())
|
||||
|
|
|
@ -116,7 +116,7 @@ void TaskbarWindow::create_quick_launch_bar()
|
|||
quick_launch_bar.layout()->set_spacing(0);
|
||||
quick_launch_bar.set_frame_thickness(0);
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("Taskbar");
|
||||
auto config = Core::ConfigFile::open_for_app("Taskbar");
|
||||
constexpr const char* quick_launch = "QuickLaunch";
|
||||
|
||||
// FIXME: Core::ConfigFile does not keep the order of the entries.
|
||||
|
|
|
@ -329,7 +329,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto config = config_file.is_empty() ? Core::ConfigFile::get_for_app("Tests") : Core::ConfigFile::open(config_file);
|
||||
auto config = config_file.is_empty() ? Core::ConfigFile::open_for_app("Tests") : Core::ConfigFile::open(config_file);
|
||||
if (config->num_groups() == 0)
|
||||
warnln("Empty configuration file ({}) loaded!", config_file.is_empty() ? "User config for Tests" : config_file.characters());
|
||||
|
||||
|
|
Loading…
Reference in a new issue