1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

Userland: Prefer _string over _short_string

As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
This commit is contained in:
Lucas CHOLLET 2023-08-07 22:26:17 -04:00 committed by Andreas Kling
parent a5edc9cdfc
commit 3f35ffb648
198 changed files with 684 additions and 684 deletions

View file

@ -84,17 +84,17 @@ ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
TRY(button_widget->add_spacer());
auto ok_button = TRY(make_button("OK"_short_string, button_widget));
auto ok_button = TRY(make_button("OK"_string, button_widget));
ok_button->on_click = [this](auto) {
if (apply_changes())
close();
};
auto cancel_button = TRY(make_button("Cancel"_short_string, button_widget));
auto cancel_button = TRY(make_button("Cancel"_string, button_widget));
cancel_button->on_click = [this](auto) {
close();
};
m_apply_button = TRY(make_button("Apply"_short_string, button_widget));
m_apply_button = TRY(make_button("Apply"_string, button_widget));
m_apply_button->on_click = [this](auto) { apply_changes(); };
m_apply_button->set_enabled(false);
@ -120,7 +120,7 @@ ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
ErrorOr<void> PropertiesWindow::create_general_tab(GUI::TabWidget& tab_widget, bool disable_rename)
{
auto general_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("General"_short_string));
auto general_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("General"_string));
TRY(general_tab->load_from_gml(properties_window_general_tab_gml));
m_icon = general_tab->find_descendant_of_type_named<GUI::ImageWidget>("icon");
@ -260,7 +260,7 @@ ErrorOr<void> PropertiesWindow::create_archive_tab(GUI::TabWidget& tab_widget, N
auto statistics = TRY(zip.calculate_statistics());
tab->find_descendant_of_type_named<GUI::Label>("archive_format")->set_text("ZIP"_short_string);
tab->find_descendant_of_type_named<GUI::Label>("archive_format")->set_text("ZIP"_string);
tab->find_descendant_of_type_named<GUI::Label>("archive_file_count")->set_text(TRY(String::number(statistics.file_count())));
tab->find_descendant_of_type_named<GUI::Label>("archive_directory_count")->set_text(TRY(String::number(statistics.directory_count())));
tab->find_descendant_of_type_named<GUI::Label>("archive_uncompressed_size")->set_text(TRY(String::from_deprecated_string(AK::human_readable_size(statistics.total_uncompressed_bytes()))));
@ -277,7 +277,7 @@ ErrorOr<void> PropertiesWindow::create_audio_tab(GUI::TabWidget& tab_widget, Non
}
auto loader = loader_or_error.release_value();
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Audio"_short_string));
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Audio"_string));
TRY(tab->load_from_gml(properties_window_audio_tab_gml));
tab->find_descendant_of_type_named<GUI::Label>("audio_type")->set_text(TRY(String::from_deprecated_string(loader->format_name())));
@ -359,7 +359,7 @@ ErrorOr<void> PropertiesWindow::create_font_tab(GUI::TabWidget& tab_widget, Nonn
auto font_info = font_info_or_error.release_value();
auto& typeface = font_info.typeface;
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Font"_short_string));
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Font"_string));
TRY(tab->load_from_gml(properties_window_font_tab_gml));
String format_name;
@ -382,7 +382,7 @@ ErrorOr<void> PropertiesWindow::create_font_tab(GUI::TabWidget& tab_widget, Nonn
}
tab->find_descendant_of_type_named<GUI::Label>("font_format")->set_text(format_name);
tab->find_descendant_of_type_named<GUI::Label>("font_family")->set_text(TRY(String::from_deprecated_string(typeface->family())));
tab->find_descendant_of_type_named<GUI::Label>("font_fixed_width")->set_text(typeface->is_fixed_width() ? "Yes"_short_string : "No"_short_string);
tab->find_descendant_of_type_named<GUI::Label>("font_fixed_width")->set_text(typeface->is_fixed_width() ? "Yes"_string : "No"_string);
tab->find_descendant_of_type_named<GUI::Label>("font_width")->set_text(TRY(String::from_utf8(Gfx::width_to_name(static_cast<Gfx::FontWidth>(typeface->width())))));
auto nearest_weight_class_name = [](unsigned weight) {
@ -404,7 +404,7 @@ ErrorOr<void> PropertiesWindow::create_image_tab(GUI::TabWidget& tab_widget, Non
if (!image_decoder)
return {};
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Image"_short_string));
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Image"_string));
TRY(tab->load_from_gml(properties_window_image_tab_gml));
tab->find_descendant_of_type_named<GUI::Label>("image_type")->set_text(TRY(String::from_utf8(mime_type)));
@ -426,7 +426,7 @@ ErrorOr<void> PropertiesWindow::create_image_tab(GUI::TabWidget& tab_widget, Non
animation_text = TRY(builder.to_string());
} else {
animation_text = "None"_short_string;
animation_text = "None"_string;
}
tab->find_descendant_of_type_named<GUI::Label>("image_animation")->set_text(move(animation_text));
@ -450,7 +450,7 @@ ErrorOr<void> PropertiesWindow::create_image_tab(GUI::TabWidget& tab_widget, Non
}
} else {
hide_icc_group("None"_short_string);
hide_icc_group("None"_string);
}
return {};
@ -467,7 +467,7 @@ ErrorOr<void> PropertiesWindow::create_pdf_tab(GUI::TabWidget& tab_widget, Nonnu
if (auto handler = document->security_handler(); handler && !handler->has_user_password()) {
// FIXME: Show a password dialog, once we've switched to lazy-loading
auto tab = TRY(tab_widget.try_add_tab<GUI::Label>("PDF"_short_string));
auto tab = TRY(tab_widget.try_add_tab<GUI::Label>("PDF"_string));
tab->set_text("PDF is password-protected."_string);
return {};
}
@ -477,7 +477,7 @@ ErrorOr<void> PropertiesWindow::create_pdf_tab(GUI::TabWidget& tab_widget, Nonnu
return {};
}
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("PDF"_short_string));
auto tab = TRY(tab_widget.try_add_tab<GUI::Widget>("PDF"_string));
TRY(tab->load_from_gml(properties_window_pdf_tab_gml));
tab->find_descendant_of_type_named<GUI::Label>("pdf_version")->set_text(TRY(String::formatted("{}.{}", document->version().major, document->version().minor)));