mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 06:37:35 +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
|
@ -250,7 +250,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
|
|||
|
||||
void MainWidget::update_title()
|
||||
{
|
||||
window()->set_title(String::formatted("{}[*] - Theme Editor", m_path.value_or("Untitled")));
|
||||
window()->set_title(DeprecatedString::formatted("{}[*] - Theme Editor", m_path.value_or("Untitled")));
|
||||
}
|
||||
|
||||
GUI::Window::CloseRequestDecision MainWidget::request_close()
|
||||
|
@ -272,7 +272,7 @@ GUI::Window::CloseRequestDecision MainWidget::request_close()
|
|||
return GUI::Window::CloseRequestDecision::StayOpen;
|
||||
}
|
||||
|
||||
void MainWidget::set_path(String path)
|
||||
void MainWidget::set_path(DeprecatedString path)
|
||||
{
|
||||
m_path = path;
|
||||
update_title();
|
||||
|
@ -304,7 +304,7 @@ void MainWidget::save_to_file(Core::File& file)
|
|||
|
||||
auto sync_result = theme->sync();
|
||||
if (sync_result.is_error()) {
|
||||
GUI::MessageBox::show_error(window(), String::formatted("Failed to save theme file: {}", sync_result.error()));
|
||||
GUI::MessageBox::show_error(window(), DeprecatedString::formatted("Failed to save theme file: {}", sync_result.error()));
|
||||
} else {
|
||||
m_last_modified_time = Time::now_monotonic();
|
||||
set_path(file.filename());
|
||||
|
@ -525,7 +525,7 @@ void MainWidget::set_metric(Gfx::MetricRole role, int value)
|
|||
set_palette(preview_palette);
|
||||
}
|
||||
|
||||
void MainWidget::set_path(Gfx::PathRole role, String value)
|
||||
void MainWidget::set_path(Gfx::PathRole role, DeprecatedString value)
|
||||
{
|
||||
auto preview_palette = m_current_palette;
|
||||
preview_palette.set_path(role, value);
|
||||
|
@ -543,7 +543,7 @@ void MainWidget::set_palette(Gfx::Palette palette)
|
|||
void MainWidget::show_path_picker_dialog(StringView property_display_name, GUI::TextBox& path_input, PathPickerTarget path_picker_target)
|
||||
{
|
||||
bool open_folder = path_picker_target == PathPickerTarget::Folder;
|
||||
auto window_title = String::formatted(open_folder ? "Select {} folder"sv : "Select {} file"sv, property_display_name);
|
||||
auto window_title = DeprecatedString::formatted(open_folder ? "Select {} folder"sv : "Select {} file"sv, property_display_name);
|
||||
auto target_path = path_input.text();
|
||||
if (Core::File::exists(target_path)) {
|
||||
if (!Core::File::is_directory(target_path))
|
||||
|
|
|
@ -52,7 +52,7 @@ private:
|
|||
AlignmentModel() = default;
|
||||
|
||||
struct AlignmentValue {
|
||||
String title;
|
||||
DeprecatedString title;
|
||||
Gfx::TextAlignment setting_value;
|
||||
};
|
||||
Vector<AlignmentValue> m_alignments {
|
||||
|
@ -67,12 +67,12 @@ struct Property {
|
|||
};
|
||||
|
||||
struct PropertyGroup {
|
||||
String title;
|
||||
DeprecatedString title;
|
||||
Vector<Property> properties;
|
||||
};
|
||||
|
||||
struct PropertyTab {
|
||||
String title;
|
||||
DeprecatedString title;
|
||||
Vector<PropertyGroup> property_groups;
|
||||
};
|
||||
|
||||
|
@ -92,7 +92,7 @@ private:
|
|||
|
||||
void save_to_file(Core::File&);
|
||||
ErrorOr<Core::AnonymousBuffer> encode();
|
||||
void set_path(String);
|
||||
void set_path(DeprecatedString);
|
||||
|
||||
void build_override_controls();
|
||||
|
||||
|
@ -101,7 +101,7 @@ private:
|
|||
void set_color(Gfx::ColorRole, Gfx::Color);
|
||||
void set_flag(Gfx::FlagRole, bool);
|
||||
void set_metric(Gfx::MetricRole, int);
|
||||
void set_path(Gfx::PathRole, String);
|
||||
void set_path(Gfx::PathRole, DeprecatedString);
|
||||
|
||||
void set_palette(Gfx::Palette);
|
||||
|
||||
|
@ -118,7 +118,7 @@ private:
|
|||
RefPtr<GUI::Button> m_theme_override_apply;
|
||||
RefPtr<GUI::Button> m_theme_override_reset;
|
||||
|
||||
Optional<String> m_path;
|
||||
Optional<DeprecatedString> m_path;
|
||||
Gfx::Palette m_current_palette;
|
||||
Time m_last_modified_time { Time::now_monotonic() };
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
parser.add_positional_argument(file_to_edit, "Theme file to edit", "file", Core::ArgsParser::Required::No);
|
||||
parser.parse(arguments);
|
||||
|
||||
Optional<String> path = {};
|
||||
Optional<DeprecatedString> path = {};
|
||||
|
||||
if (!file_to_edit.is_empty())
|
||||
path = Core::File::absolute_path(file_to_edit);
|
||||
|
@ -55,7 +55,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
[&window, &path, &main_widget]() {
|
||||
auto response = FileSystemAccessClient::Client::the().try_request_file_read_only_approved(window, path.value());
|
||||
if (response.is_error())
|
||||
GUI::MessageBox::show_error(window, String::formatted("Opening \"{}\" failed: {}", path.value(), response.error()));
|
||||
GUI::MessageBox::show_error(window, DeprecatedString::formatted("Opening \"{}\" failed: {}", path.value(), response.error()));
|
||||
else
|
||||
main_widget->load_from_file(response.release_value());
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue