mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 12:17:45 +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
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "HighlightPreviewWidget.h"
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <LibCore/ConfigFile.h>
|
||||
#include <LibGUI/ConnectionToWindowServer.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
|
@ -22,7 +22,7 @@ HighlightPreviewWidget::HighlightPreviewWidget(Gfx::Palette const& palette)
|
|||
ErrorOr<void> HighlightPreviewWidget::reload_cursor()
|
||||
{
|
||||
auto cursor_theme = GUI::ConnectionToWindowServer::the().get_cursor_theme();
|
||||
auto theme_path = String::formatted("/res/cursor-themes/{}/{}", cursor_theme, "Config.ini");
|
||||
auto theme_path = DeprecatedString::formatted("/res/cursor-themes/{}/{}", cursor_theme, "Config.ini");
|
||||
auto cursor_theme_config = TRY(Core::ConfigFile::open(theme_path));
|
||||
auto load_bitmap = [](StringView path, StringView default_path) {
|
||||
auto maybe_bitmap = Gfx::Bitmap::try_load_from_file(path);
|
||||
|
@ -31,7 +31,7 @@ ErrorOr<void> HighlightPreviewWidget::reload_cursor()
|
|||
return Gfx::Bitmap::try_load_from_file(default_path);
|
||||
};
|
||||
constexpr auto default_cursor_path = "/res/cursor-themes/Default/arrow.x2y2.png"sv;
|
||||
auto cursor_path = String::formatted("/res/cursor-themes/{}/{}",
|
||||
auto cursor_path = DeprecatedString::formatted("/res/cursor-themes/{}/{}",
|
||||
cursor_theme, cursor_theme_config->read_entry("Cursor", "Arrow"));
|
||||
m_cursor_bitmap = TRY(load_bitmap(cursor_path, default_cursor_path));
|
||||
m_cursor_params = Gfx::CursorParams::parse_from_filename(cursor_path, m_cursor_bitmap->rect().center()).constrained(*m_cursor_bitmap);
|
||||
|
|
|
@ -89,10 +89,10 @@ void MouseWidget::reset_default_values()
|
|||
|
||||
void MouseWidget::update_speed_label()
|
||||
{
|
||||
m_speed_label->set_text(String::formatted("{} %", m_speed_slider->value()));
|
||||
m_speed_label->set_text(DeprecatedString::formatted("{} %", m_speed_slider->value()));
|
||||
}
|
||||
|
||||
void MouseWidget::update_double_click_speed_label()
|
||||
{
|
||||
m_double_click_speed_label->set_text(String::formatted("{} ms", m_double_click_speed_slider->value()));
|
||||
m_double_click_speed_label->set_text(DeprecatedString::formatted("{} ms", m_double_click_speed_slider->value()));
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <LibGUI/SortingProxyModel.h>
|
||||
#include <LibGUI/TableView.h>
|
||||
|
||||
String MouseCursorModel::column_name(int column_index) const
|
||||
DeprecatedString MouseCursorModel::column_name(int column_index) const
|
||||
{
|
||||
switch (column_index) {
|
||||
case Column::Bitmap:
|
||||
|
@ -50,7 +50,7 @@ void MouseCursorModel::invalidate()
|
|||
return;
|
||||
|
||||
m_cursors.clear();
|
||||
Core::DirIterator iterator(String::formatted("/res/cursor-themes/{}", m_theme_name), Core::DirIterator::Flags::SkipDots);
|
||||
Core::DirIterator iterator(DeprecatedString::formatted("/res/cursor-themes/{}", m_theme_name), Core::DirIterator::Flags::SkipDots);
|
||||
|
||||
while (iterator.has_next()) {
|
||||
auto path = iterator.next_full_path();
|
||||
|
@ -90,7 +90,7 @@ void ThemeModel::invalidate()
|
|||
|
||||
while (iterator.has_next()) {
|
||||
auto path = iterator.next_path();
|
||||
if (access(String::formatted("/res/cursor-themes/{}/Config.ini", path).characters(), R_OK) == 0)
|
||||
if (access(DeprecatedString::formatted("/res/cursor-themes/{}/Config.ini", path).characters(), R_OK) == 0)
|
||||
m_themes.append(path);
|
||||
}
|
||||
Model::invalidate();
|
||||
|
@ -119,7 +119,7 @@ ThemeWidget::ThemeWidget()
|
|||
m_mouse_cursor_model->change_theme(theme_name);
|
||||
|
||||
m_theme_name_box = find_descendant_of_type_named<GUI::ComboBox>("theme_name_box");
|
||||
m_theme_name_box->on_change = [this](String const& value, GUI::ModelIndex const&) {
|
||||
m_theme_name_box->on_change = [this](DeprecatedString const& value, GUI::ModelIndex const&) {
|
||||
m_mouse_cursor_model->change_theme(value);
|
||||
set_modified(true);
|
||||
};
|
||||
|
|
|
@ -25,11 +25,11 @@ public:
|
|||
virtual int row_count(const GUI::ModelIndex&) const override { return m_cursors.size(); }
|
||||
virtual int column_count(const GUI::ModelIndex&) const override { return Column::__Count; }
|
||||
|
||||
virtual String column_name(int column_index) const override;
|
||||
virtual DeprecatedString column_name(int column_index) const override;
|
||||
virtual GUI::Variant data(const GUI::ModelIndex& index, GUI::ModelRole role) const override;
|
||||
virtual void invalidate() override;
|
||||
|
||||
void change_theme(String const& name)
|
||||
void change_theme(DeprecatedString const& name)
|
||||
{
|
||||
m_theme_name = name;
|
||||
invalidate();
|
||||
|
@ -40,13 +40,13 @@ private:
|
|||
|
||||
struct Cursor {
|
||||
RefPtr<Gfx::Bitmap> bitmap;
|
||||
String path;
|
||||
String name;
|
||||
DeprecatedString path;
|
||||
DeprecatedString name;
|
||||
Gfx::CursorParams params;
|
||||
};
|
||||
|
||||
Vector<Cursor> m_cursors;
|
||||
String m_theme_name;
|
||||
DeprecatedString m_theme_name;
|
||||
};
|
||||
|
||||
class ThemeModel final : public GUI::Model {
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
virtual void invalidate() override;
|
||||
|
||||
private:
|
||||
Vector<String> m_themes;
|
||||
Vector<DeprecatedString> m_themes;
|
||||
};
|
||||
|
||||
class ThemeWidget final : public GUI::SettingsWindow::Tab {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue