mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 11:57:36 +00:00
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
This commit is contained in:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -12,16 +12,16 @@
|
|||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/Model.h>
|
||||
|
||||
static String default_homepage_url = "file:///res/html/misc/welcome.html";
|
||||
static String default_new_tab_url = "file:///res/html/misc/new-tab.html";
|
||||
static String default_search_engine = "";
|
||||
static String default_color_scheme = "auto";
|
||||
static DeprecatedString default_homepage_url = "file:///res/html/misc/welcome.html";
|
||||
static DeprecatedString default_new_tab_url = "file:///res/html/misc/new-tab.html";
|
||||
static DeprecatedString default_search_engine = "";
|
||||
static DeprecatedString default_color_scheme = "auto";
|
||||
static bool default_show_bookmarks_bar = true;
|
||||
static bool default_auto_close_download_windows = false;
|
||||
|
||||
struct ColorScheme {
|
||||
String title;
|
||||
String setting_value;
|
||||
DeprecatedString title;
|
||||
DeprecatedString setting_value;
|
||||
};
|
||||
|
||||
class ColorSchemeModel final : public GUI::Model {
|
||||
|
@ -96,7 +96,7 @@ BrowserSettingsWidget::BrowserSettingsWidget()
|
|||
Vector<GUI::JsonArrayModel::FieldSpec> search_engine_fields;
|
||||
search_engine_fields.empend("title", "Title", Gfx::TextAlignment::CenterLeft);
|
||||
search_engine_fields.empend("url_format", "Url format", Gfx::TextAlignment::CenterLeft);
|
||||
auto search_engines_model = GUI::JsonArrayModel::create(String::formatted("{}/SearchEngines.json", Core::StandardPaths::config_directory()), move(search_engine_fields));
|
||||
auto search_engines_model = GUI::JsonArrayModel::create(DeprecatedString::formatted("{}/SearchEngines.json", Core::StandardPaths::config_directory()), move(search_engine_fields));
|
||||
search_engines_model->invalidate();
|
||||
Vector<JsonValue> custom_search_engine;
|
||||
custom_search_engine.append("Custom...");
|
||||
|
@ -105,7 +105,7 @@ BrowserSettingsWidget::BrowserSettingsWidget()
|
|||
|
||||
m_search_engine_combobox->set_model(move(search_engines_model));
|
||||
m_search_engine_combobox->set_only_allow_values_from_model(true);
|
||||
m_search_engine_combobox->on_change = [this](AK::String const&, GUI::ModelIndex const& cursor_index) {
|
||||
m_search_engine_combobox->on_change = [this](AK::DeprecatedString const&, GUI::ModelIndex const& cursor_index) {
|
||||
auto url_format = m_search_engine_combobox->model()->index(cursor_index.row(), 1).data().to_string();
|
||||
m_is_custom_search_engine = url_format.is_empty();
|
||||
m_custom_search_engine_group->set_enabled(m_is_custom_search_engine);
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
|
||||
static constexpr bool s_default_enable_content_filtering = true;
|
||||
|
||||
static String filter_list_file_path()
|
||||
static DeprecatedString filter_list_file_path()
|
||||
{
|
||||
return String::formatted("{}/BrowserContentFilters.txt", Core::StandardPaths::config_directory());
|
||||
return DeprecatedString::formatted("{}/BrowserContentFilters.txt", Core::StandardPaths::config_directory());
|
||||
}
|
||||
|
||||
ErrorOr<void> DomainListModel::load()
|
||||
|
@ -55,7 +55,7 @@ ErrorOr<void> DomainListModel::save()
|
|||
return {};
|
||||
}
|
||||
|
||||
void DomainListModel::add_domain(String name)
|
||||
void DomainListModel::add_domain(DeprecatedString name)
|
||||
{
|
||||
begin_insert_rows({}, m_domain_list.size(), m_domain_list.size());
|
||||
m_domain_list.append(move(name));
|
||||
|
@ -117,7 +117,7 @@ ContentFilterSettingsWidget::ContentFilterSettingsWidget()
|
|||
m_enable_content_filtering_checkbox->on_checked = [&](auto) { set_modified(true); };
|
||||
|
||||
m_add_new_domain_button->on_click = [&](unsigned) {
|
||||
String text;
|
||||
DeprecatedString text;
|
||||
|
||||
if (GUI::InputBox::show(window(), text, "Enter domain name"sv, "Add domain to Content Filter"sv) == GUI::Dialog::ExecResult::OK
|
||||
&& !text.is_empty()) {
|
||||
|
|
|
@ -21,12 +21,12 @@ public:
|
|||
virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return 1; }
|
||||
virtual GUI::Variant data(GUI::ModelIndex const& index, GUI::ModelRole = GUI::ModelRole::Display) const override { return m_domain_list[index.row()]; }
|
||||
|
||||
void add_domain(String name);
|
||||
void add_domain(DeprecatedString name);
|
||||
void delete_domain(size_t index);
|
||||
|
||||
private:
|
||||
bool m_was_modified { false };
|
||||
Vector<String> m_domain_list;
|
||||
Vector<DeprecatedString> m_domain_list;
|
||||
};
|
||||
|
||||
class ContentFilterSettingsWidget : public GUI::SettingsWindow::Tab {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue