1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:18:12 +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

@ -54,7 +54,7 @@ WindowManager::WindowManager(Gfx::PaletteImpl const& palette)
reload_config();
m_keymap_switcher->on_keymap_change = [&](String const& keymap) {
m_keymap_switcher->on_keymap_change = [&](DeprecatedString const& keymap) {
for_each_window_manager([&keymap](WMConnectionFromClient& conn) {
if (!(conn.event_mask() & WMEventMask::KeymapChanged))
return IterationDecision::Continue;
@ -90,7 +90,7 @@ void WindowManager::reload_config()
m_cursor_highlight_color = Color::from_string(m_config->read_entry("Mouse", "CursorHighlightColor")).value_or(default_highlight_color);
apply_cursor_theme(m_config->read_entry("Mouse", "CursorTheme", "Default"));
auto reload_graphic = [&](RefPtr<MultiScaleBitmaps>& bitmap, String const& name) {
auto reload_graphic = [&](RefPtr<MultiScaleBitmaps>& bitmap, DeprecatedString const& name) {
if (bitmap) {
if (!bitmap->load(name))
bitmap = nullptr;
@ -117,7 +117,7 @@ Gfx::Font const& WindowManager::window_title_font() const
return Gfx::FontDatabase::window_title_font();
}
bool WindowManager::set_screen_layout(ScreenLayout&& screen_layout, bool save, String& error_msg)
bool WindowManager::set_screen_layout(ScreenLayout&& screen_layout, bool save, DeprecatedString& error_msg)
{
if (!Screen::apply_layout(move(screen_layout), error_msg))
return false;
@ -147,7 +147,7 @@ ScreenLayout WindowManager::get_screen_layout() const
return Screen::layout();
}
bool WindowManager::save_screen_layout(String& error_msg)
bool WindowManager::save_screen_layout(DeprecatedString& error_msg)
{
if (!Screen::layout().save_config(*m_config)) {
error_msg = "Could not save";
@ -267,7 +267,7 @@ void WindowManager::set_acceleration_factor(double factor)
{
ScreenInput::the().set_acceleration_factor(factor);
dbgln("Saving acceleration factor {} to config file at {}", factor, m_config->filename());
m_config->write_entry("Mouse", "AccelerationFactor", String::formatted("{}", factor));
m_config->write_entry("Mouse", "AccelerationFactor", DeprecatedString::formatted("{}", factor));
sync_config_to_disk();
}
@ -275,7 +275,7 @@ void WindowManager::set_scroll_step_size(unsigned step_size)
{
ScreenInput::the().set_scroll_step_size(step_size);
dbgln("Saving scroll step size {} to config file at {}", step_size, m_config->filename());
m_config->write_entry("Mouse", "ScrollStepSize", String::number(step_size));
m_config->write_entry("Mouse", "ScrollStepSize", DeprecatedString::number(step_size));
sync_config_to_disk();
}
@ -284,7 +284,7 @@ void WindowManager::set_double_click_speed(int speed)
VERIFY(speed >= double_click_speed_min && speed <= double_click_speed_max);
m_double_click_speed = speed;
dbgln("Saving double-click speed {} to config file at {}", speed, m_config->filename());
m_config->write_entry("Input", "DoubleClickSpeed", String::number(speed));
m_config->write_entry("Input", "DoubleClickSpeed", DeprecatedString::number(speed));
sync_config_to_disk();
}
@ -2013,7 +2013,7 @@ Gfx::IntRect WindowManager::tiled_window_rect(Window const& window, WindowTileTy
return rect;
}
void WindowManager::start_dnd_drag(ConnectionFromClient& client, String const& text, Gfx::Bitmap const* bitmap, Core::MimeData const& mime_data)
void WindowManager::start_dnd_drag(ConnectionFromClient& client, DeprecatedString const& text, Gfx::Bitmap const* bitmap, Core::MimeData const& mime_data)
{
VERIFY(!m_dnd_client);
m_dnd_client = client;
@ -2062,7 +2062,7 @@ void WindowManager::invalidate_after_theme_or_font_change()
Compositor::the().invalidate_after_theme_or_font_change();
}
bool WindowManager::update_theme(String theme_path, String theme_name, bool keep_desktop_background)
bool WindowManager::update_theme(DeprecatedString theme_path, DeprecatedString theme_name, bool keep_desktop_background)
{
auto new_theme = Gfx::load_system_theme(theme_path);
if (!new_theme.is_valid())
@ -2101,7 +2101,7 @@ void WindowManager::clear_theme_override()
{
m_theme_overridden = false;
auto previous_theme_name = m_config->read_entry("Theme", "Name");
auto previous_theme = Gfx::load_system_theme(String::formatted("/res/themes/{}.ini", previous_theme_name));
auto previous_theme = Gfx::load_system_theme(DeprecatedString::formatted("/res/themes/{}.ini", previous_theme_name));
VERIFY(previous_theme.is_valid());
Gfx::set_system_theme(previous_theme);
m_palette = Gfx::PaletteImpl::create_with_anonymous_buffer(previous_theme);
@ -2213,9 +2213,9 @@ WindowStack& WindowManager::get_rendering_window_stacks(WindowStack*& transition
return Compositor::the().get_rendering_window_stacks(transitioning_window_stack);
}
void WindowManager::apply_cursor_theme(String const& theme_name)
void WindowManager::apply_cursor_theme(DeprecatedString const& theme_name)
{
auto theme_path = String::formatted("/res/cursor-themes/{}/{}", theme_name, "Config.ini");
auto theme_path = DeprecatedString::formatted("/res/cursor-themes/{}/{}", theme_name, "Config.ini");
auto cursor_theme_config_or_error = Core::ConfigFile::open(theme_path);
if (cursor_theme_config_or_error.is_error()) {
dbgln("Unable to open cursor theme '{}': {}", theme_path, cursor_theme_config_or_error.error());
@ -2224,11 +2224,11 @@ void WindowManager::apply_cursor_theme(String const& theme_name)
auto cursor_theme_config = cursor_theme_config_or_error.release_value();
auto* current_cursor = Compositor::the().current_cursor();
auto reload_cursor = [&](RefPtr<Cursor>& cursor, String const& name) {
auto reload_cursor = [&](RefPtr<Cursor>& cursor, DeprecatedString const& name) {
bool is_current_cursor = current_cursor && current_cursor == cursor.ptr();
static auto const s_default_cursor_path = "/res/cursor-themes/Default/arrow.x2y2.png"sv;
cursor = Cursor::create(String::formatted("/res/cursor-themes/{}/{}", theme_name, cursor_theme_config->read_entry("Cursor", name)), s_default_cursor_path);
cursor = Cursor::create(DeprecatedString::formatted("/res/cursor-themes/{}/{}", theme_name, cursor_theme_config->read_entry("Cursor", name)), s_default_cursor_path);
if (is_current_cursor) {
Compositor::the().current_cursor_was_reloaded(cursor.ptr());