summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser
diff options
context:
space:
mode:
authornetworkException <git@nwex.de>2021-08-21 16:33:54 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-22 01:32:25 +0200
commitacde7d12b0d2870feba3ebaaaf2ef99ac6fb41b3 (patch)
tree9ea1d89f621446ea24b9ee34ca93c73acef225a0 /Userland/Applications/Browser
parent938051feb8d9340657251082f3fd4abffd57b813 (diff)
downloadserenity-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/Applications/Browser')
-rw-r--r--Userland/Applications/Browser/BrowserWindow.cpp8
-rw-r--r--Userland/Applications/Browser/DownloadWidget.cpp4
-rw-r--r--Userland/Applications/Browser/main.cpp2
3 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp
index 8a8658d555..17605bc13f 100644
--- a/Userland/Applications/Browser/BrowserWindow.cpp
+++ b/Userland/Applications/Browser/BrowserWindow.cpp
@@ -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);
});
diff --git a/Userland/Applications/Browser/DownloadWidget.cpp b/Userland/Applications/Browser/DownloadWidget.cpp
index ee9aa889b6..d18385be44 100644
--- a/Userland/Applications/Browser/DownloadWidget.cpp
+++ b/Userland/Applications/Browser/DownloadWidget.cpp
@@ -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);
};
diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp
index 45f10779ab..91f9a14c19 100644
--- a/Userland/Applications/Browser/main.cpp
+++ b/Userland/Applications/Browser/main.cpp
@@ -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", {});