diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-04 18:02:33 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-06 08:54:33 +0100 |
commit | 6e19ab2bbce0b113b628e6f8e9b5c0640053933e (patch) | |
tree | 372d21b2f5dcff112f5d0089559c6af5798680d4 /Userland/Applets | |
parent | f74251606d74b504a1379ebb893fdb5529054ea5 (diff) | |
download | serenity-6e19ab2bbce0b113b628e6f8e9b5c0640053933e.zip |
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 :^)
Diffstat (limited to 'Userland/Applets')
-rw-r--r-- | Userland/Applets/Audio/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp | 8 | ||||
-rw-r--r-- | Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h | 6 | ||||
-rw-r--r-- | Userland/Applets/Keymap/KeymapStatusWidget.cpp | 2 | ||||
-rw-r--r-- | Userland/Applets/Keymap/KeymapStatusWidget.h | 4 | ||||
-rw-r--r-- | Userland/Applets/Keymap/KeymapStatusWindow.cpp | 2 | ||||
-rw-r--r-- | Userland/Applets/Keymap/KeymapStatusWindow.h | 2 | ||||
-rw-r--r-- | Userland/Applets/Network/main.cpp | 4 | ||||
-rw-r--r-- | Userland/Applets/ResourceGraph/main.cpp | 8 |
9 files changed, 19 insertions, 19 deletions
diff --git a/Userland/Applets/Audio/main.cpp b/Userland/Applets/Audio/main.cpp index aadf41d60b..c45bb1a4dc 100644 --- a/Userland/Applets/Audio/main.cpp +++ b/Userland/Applets/Audio/main.cpp @@ -169,7 +169,7 @@ private: painter.blit({}, audio_bitmap, audio_bitmap.rect()); if (m_show_percent) { - auto volume_text = m_audio_muted ? "mute" : String::formatted("{}%", m_audio_volume); + auto volume_text = m_audio_muted ? "mute" : DeprecatedString::formatted("{}%", m_audio_volume); painter.draw_text({ 16, 3, 24, 16 }, volume_text, Gfx::FontDatabase::default_fixed_width_font(), Gfx::TextAlignment::TopLeft, palette().window_text()); } } diff --git a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp index 2c7dbc6502..9ef14357e1 100644 --- a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp +++ b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp @@ -21,7 +21,7 @@ ClipboardHistoryModel::ClipboardHistoryModel() { } -String ClipboardHistoryModel::column_name(int column) const +DeprecatedString ClipboardHistoryModel::column_name(int column) const { switch (column) { case Column::Data: @@ -37,7 +37,7 @@ String ClipboardHistoryModel::column_name(int column) const } } -static StringView bpp_for_format_resilient(String format) +static StringView bpp_for_format_resilient(DeprecatedString format) { unsigned format_uint = format.to_uint().value_or(static_cast<unsigned>(Gfx::BitmapFormat::Invalid)); // Cannot use Gfx::Bitmap::bpp_for_format here, as we have to accept invalid enum values. @@ -70,7 +70,7 @@ GUI::Variant ClipboardHistoryModel::data(const GUI::ModelIndex& index, GUI::Mode switch (index.column()) { case Column::Data: if (data_and_type.mime_type.starts_with("text/"sv)) - return String::copy(data_and_type.data); + return DeprecatedString::copy(data_and_type.data); if (data_and_type.mime_type == "image/x-serenityos") { StringBuilder builder; builder.append('['); @@ -128,7 +128,7 @@ void ClipboardHistoryModel::remove_item(int index) m_history_items.remove(index); } -void ClipboardHistoryModel::config_string_did_change(String const& domain, String const& group, String const& key, String const& value_string) +void ClipboardHistoryModel::config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value_string) { if (domain != "ClipboardHistory" || group != "ClipboardHistory") return; diff --git a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h index 64bed85ad2..5711662aff 100644 --- a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h +++ b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h @@ -42,7 +42,7 @@ public: virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; // ^Config::Listener - virtual void config_string_did_change(String const& domain, String const& group, String const& key, String const& value) override; + virtual void config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value) override; private: ClipboardHistoryModel(); @@ -50,11 +50,11 @@ private: // ^GUI::Model virtual int row_count(const GUI::ModelIndex&) const override { return m_history_items.size(); } - virtual String column_name(int) const override; + virtual DeprecatedString column_name(int) const override; virtual int column_count(const GUI::ModelIndex&) const override { return Column::__Count; } // ^GUI::Clipboard::ClipboardClient - virtual void clipboard_content_did_change(String const&) override { add_item(GUI::Clipboard::the().fetch_data_and_type()); } + virtual void clipboard_content_did_change(DeprecatedString const&) override { add_item(GUI::Clipboard::the().fetch_data_and_type()); } Vector<ClipboardItem> m_history_items; size_t m_history_limit; diff --git a/Userland/Applets/Keymap/KeymapStatusWidget.cpp b/Userland/Applets/Keymap/KeymapStatusWidget.cpp index ecc4269bde..bc3b1802d9 100644 --- a/Userland/Applets/Keymap/KeymapStatusWidget.cpp +++ b/Userland/Applets/Keymap/KeymapStatusWidget.cpp @@ -59,7 +59,7 @@ ErrorOr<void> KeymapStatusWidget::refresh_menu() return {}; } -void KeymapStatusWidget::set_current_keymap(String const& keymap, ClearBackground clear_background) +void KeymapStatusWidget::set_current_keymap(DeprecatedString const& keymap, ClearBackground clear_background) { if (clear_background == ClearBackground::Yes) { GUI::Painter painter(*this); diff --git a/Userland/Applets/Keymap/KeymapStatusWidget.h b/Userland/Applets/Keymap/KeymapStatusWidget.h index 3e3e0fa54e..880a6510d2 100644 --- a/Userland/Applets/Keymap/KeymapStatusWidget.h +++ b/Userland/Applets/Keymap/KeymapStatusWidget.h @@ -22,11 +22,11 @@ class KeymapStatusWidget : public GUI::Label { virtual void mousedown_event(GUI::MouseEvent& event) override; - void set_current_keymap(String const& keymap, ClearBackground clear_background = ClearBackground::Yes); + void set_current_keymap(DeprecatedString const& keymap, ClearBackground clear_background = ClearBackground::Yes); private: RefPtr<GUI::Menu> m_context_menu; - String m_current_keymap; + DeprecatedString m_current_keymap; ErrorOr<void> refresh_menu(); diff --git a/Userland/Applets/Keymap/KeymapStatusWindow.cpp b/Userland/Applets/Keymap/KeymapStatusWindow.cpp index 69248141a1..7a0fc2b29f 100644 --- a/Userland/Applets/Keymap/KeymapStatusWindow.cpp +++ b/Userland/Applets/Keymap/KeymapStatusWindow.cpp @@ -30,7 +30,7 @@ void KeymapStatusWindow::wm_event(GUI::WMEvent& event) } } -void KeymapStatusWindow::set_keymap_text(String const& keymap) +void KeymapStatusWindow::set_keymap_text(DeprecatedString const& keymap) { m_status_widget->set_current_keymap(keymap); } diff --git a/Userland/Applets/Keymap/KeymapStatusWindow.h b/Userland/Applets/Keymap/KeymapStatusWindow.h index a4f4d3a162..0ba3c106dc 100644 --- a/Userland/Applets/Keymap/KeymapStatusWindow.h +++ b/Userland/Applets/Keymap/KeymapStatusWindow.h @@ -23,5 +23,5 @@ private: RefPtr<KeymapStatusWidget> m_status_widget; - void set_keymap_text(String const& keymap); + void set_keymap_text(DeprecatedString const& keymap); }; diff --git a/Userland/Applets/Network/main.cpp b/Userland/Applets/Network/main.cpp index 3d0a73adcc..1f62eb7d4e 100644 --- a/Userland/Applets/Network/main.cpp +++ b/Userland/Applets/Network/main.cpp @@ -103,7 +103,7 @@ private: m_connected = connected; } - String get_adapter_info() + DeprecatedString get_adapter_info() { StringBuilder adapter_info; @@ -154,7 +154,7 @@ private: return adapter_info.to_string(); } - String m_adapter_info; + DeprecatedString m_adapter_info; bool m_connected = false; bool m_notifications = true; NonnullRefPtr<Gfx::Bitmap> m_connected_icon; diff --git a/Userland/Applets/ResourceGraph/main.cpp b/Userland/Applets/ResourceGraph/main.cpp index 59cf25a25e..392e2140a5 100644 --- a/Userland/Applets/ResourceGraph/main.cpp +++ b/Userland/Applets/ResourceGraph/main.cpp @@ -54,7 +54,7 @@ private: m_last_idle = idle; float cpu = total_diff > 0 ? (float)(total_diff - idle_diff) / (float)total_diff : 0; m_history.enqueue(cpu); - m_tooltip = String::formatted("CPU usage: {:.1}%", 100 * cpu); + m_tooltip = DeprecatedString::formatted("CPU usage: {:.1}%", 100 * cpu); } else { m_history.enqueue(-1); m_tooltip = "Unable to determine CPU usage"sv; @@ -67,7 +67,7 @@ private: double total_memory = allocated + available; double memory = (double)allocated / total_memory; m_history.enqueue(memory); - m_tooltip = String::formatted("Memory: {} MiB of {:.1} MiB in use", allocated / MiB, total_memory / MiB); + m_tooltip = DeprecatedString::formatted("Memory: {} MiB of {:.1} MiB in use", allocated / MiB, total_memory / MiB); } else { m_history.enqueue(-1); m_tooltip = "Unable to determine memory usage"sv; @@ -98,7 +98,7 @@ private: } } m_history.enqueue(static_cast<float>(recent_tx) / static_cast<float>(m_current_scale)); - m_tooltip = String::formatted("Network: TX {} / RX {} ({:.1} kbit/s)", tx, rx, static_cast<double>(recent_tx) * 8.0 / 1000.0); + m_tooltip = DeprecatedString::formatted("Network: TX {} / RX {} ({:.1} kbit/s)", tx, rx, static_cast<double>(recent_tx) * 8.0 / 1000.0); } else { m_history.enqueue(-1); m_tooltip = "Unable to determine network usage"sv; @@ -230,7 +230,7 @@ private: u64 m_last_total { 0 }; static constexpr u64 const scale_unit = 8000; u64 m_current_scale { scale_unit }; - String m_tooltip; + DeprecatedString m_tooltip; OwnPtr<Core::Stream::File> m_proc_stat; OwnPtr<Core::Stream::File> m_proc_mem; OwnPtr<Core::Stream::File> m_proc_net; |