1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47: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:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -217,7 +217,7 @@ enum class ImageType {
class Mandelbrot : public GUI::Frame {
C_OBJECT(Mandelbrot)
void export_image(String const& export_path, ImageType image_type);
void export_image(DeprecatedString const& export_path, ImageType image_type);
enum class Zoom {
In,
@ -366,7 +366,7 @@ void Mandelbrot::resize_event(GUI::ResizeEvent& event)
m_set.resize(event.size());
}
void Mandelbrot::export_image(String const& export_path, ImageType image_type)
void Mandelbrot::export_image(DeprecatedString const& export_path, ImageType image_type)
{
m_set.resize(Gfx::IntSize { 1920, 1080 });
ByteBuffer encoded_data;
@ -388,7 +388,7 @@ void Mandelbrot::export_image(String const& export_path, ImageType image_type)
m_set.resize(size());
auto file = fopen(export_path.characters(), "wb");
if (!file) {
GUI::MessageBox::show(window(), String::formatted("Could not open '{}' for writing.", export_path), "Mandelbrot"sv, GUI::MessageBox::Type::Error);
GUI::MessageBox::show(window(), DeprecatedString::formatted("Could not open '{}' for writing.", export_path), "Mandelbrot"sv, GUI::MessageBox::Type::Error);
return;
}
fwrite(encoded_data.data(), 1, encoded_data.size(), file);
@ -420,21 +420,21 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(export_submenu.try_add_action(GUI::Action::create("As &BMP",
[&](GUI::Action&) {
Optional<String> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "bmp");
Optional<DeprecatedString> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "bmp");
if (!export_path.has_value())
return;
mandelbrot->export_image(export_path.value(), ImageType::BMP);
})));
TRY(export_submenu.try_add_action(GUI::Action::create("As &PNG", { Mod_Ctrl | Mod_Shift, Key_S },
[&](GUI::Action&) {
Optional<String> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "png");
Optional<DeprecatedString> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "png");
if (!export_path.has_value())
return;
mandelbrot->export_image(export_path.value(), ImageType::PNG);
})));
TRY(export_submenu.try_add_action(GUI::Action::create("As &QOI",
[&](GUI::Action&) {
Optional<String> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "qoi");
Optional<DeprecatedString> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "qoi");
if (!export_path.has_value())
return;
mandelbrot->export_image(export_path.value(), ImageType::QOI);