mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:57:35 +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
|
@ -24,7 +24,7 @@ AboutDialog::AboutDialog(StringView name, StringView version, Gfx::Bitmap const*
|
|||
, m_version_string(version)
|
||||
{
|
||||
resize(413, 204);
|
||||
set_title(String::formatted("About {}", m_name));
|
||||
set_title(DeprecatedString::formatted("About {}", m_name));
|
||||
set_resizable(false);
|
||||
|
||||
if (parent_window)
|
||||
|
|
|
@ -28,8 +28,8 @@ public:
|
|||
private:
|
||||
AboutDialog(StringView name, StringView version, Gfx::Bitmap const* icon = nullptr, Window* parent_window = nullptr);
|
||||
|
||||
String m_name;
|
||||
DeprecatedString m_name;
|
||||
RefPtr<Gfx::Bitmap> m_icon;
|
||||
String m_version_string;
|
||||
DeprecatedString m_version_string;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
AbstractButton::AbstractButton(String text)
|
||||
AbstractButton::AbstractButton(DeprecatedString text)
|
||||
{
|
||||
set_text(move(text));
|
||||
|
||||
|
@ -34,7 +34,7 @@ AbstractButton::AbstractButton(String text)
|
|||
REGISTER_BOOL_PROPERTY("exclusive", is_exclusive, set_exclusive);
|
||||
}
|
||||
|
||||
void AbstractButton::set_text(String text)
|
||||
void AbstractButton::set_text(DeprecatedString text)
|
||||
{
|
||||
if (m_text == text)
|
||||
return;
|
||||
|
|
|
@ -20,8 +20,8 @@ public:
|
|||
|
||||
Function<void(bool)> on_checked;
|
||||
|
||||
virtual void set_text(String);
|
||||
String const& text() const { return m_text; }
|
||||
virtual void set_text(DeprecatedString);
|
||||
DeprecatedString const& text() const { return m_text; }
|
||||
|
||||
bool is_exclusive() const { return m_exclusive; }
|
||||
void set_exclusive(bool b) { m_exclusive = b; }
|
||||
|
@ -46,7 +46,7 @@ public:
|
|||
void set_auto_repeat_interval(int interval) { m_auto_repeat_interval = interval; }
|
||||
|
||||
protected:
|
||||
explicit AbstractButton(String = {});
|
||||
explicit AbstractButton(DeprecatedString = {});
|
||||
|
||||
virtual void mousedown_event(MouseEvent&) override;
|
||||
virtual void mousemove_event(MouseEvent&) override;
|
||||
|
@ -61,7 +61,7 @@ protected:
|
|||
void paint_text(Painter&, Gfx::IntRect const&, Gfx::Font const&, Gfx::TextAlignment, Gfx::TextWrapping = Gfx::TextWrapping::DontWrap);
|
||||
|
||||
private:
|
||||
String m_text;
|
||||
DeprecatedString m_text;
|
||||
bool m_checked { false };
|
||||
bool m_checkable { false };
|
||||
bool m_hovered { false };
|
||||
|
|
|
@ -39,14 +39,14 @@ AbstractThemePreview::AbstractThemePreview(Gfx::Palette const& preview_palette)
|
|||
|
||||
void AbstractThemePreview::load_theme_bitmaps()
|
||||
{
|
||||
auto load_bitmap = [](String const& path, String& last_path, RefPtr<Gfx::Bitmap>& bitmap) {
|
||||
auto load_bitmap = [](DeprecatedString const& path, DeprecatedString& last_path, RefPtr<Gfx::Bitmap>& bitmap) {
|
||||
if (path.is_empty()) {
|
||||
last_path = String::empty();
|
||||
last_path = DeprecatedString::empty();
|
||||
bitmap = nullptr;
|
||||
} else if (last_path != path) {
|
||||
auto bitmap_or_error = Gfx::Bitmap::try_load_from_file(path);
|
||||
if (bitmap_or_error.is_error()) {
|
||||
last_path = String::empty();
|
||||
last_path = DeprecatedString::empty();
|
||||
bitmap = nullptr;
|
||||
} else {
|
||||
last_path = path;
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
void paint_window(StringView title, Gfx::IntRect const& rect, Gfx::WindowTheme::WindowState, Gfx::Bitmap const& icon, int button_count = 3);
|
||||
|
||||
Function<void(String const&)> on_theme_load_from_file;
|
||||
Function<void(DeprecatedString const&)> on_theme_load_from_file;
|
||||
Function<void()> on_palette_change;
|
||||
|
||||
struct Window {
|
||||
|
@ -71,20 +71,20 @@ private:
|
|||
RefPtr<Gfx::Bitmap> m_close_bitmap;
|
||||
RefPtr<Gfx::Bitmap> m_maximize_bitmap;
|
||||
RefPtr<Gfx::Bitmap> m_minimize_bitmap;
|
||||
String m_last_close_path;
|
||||
String m_last_maximize_path;
|
||||
String m_last_minimize_path;
|
||||
DeprecatedString m_last_close_path;
|
||||
DeprecatedString m_last_maximize_path;
|
||||
DeprecatedString m_last_minimize_path;
|
||||
|
||||
RefPtr<Gfx::Bitmap> m_active_window_shadow;
|
||||
RefPtr<Gfx::Bitmap> m_inactive_window_shadow;
|
||||
RefPtr<Gfx::Bitmap> m_menu_shadow;
|
||||
RefPtr<Gfx::Bitmap> m_taskbar_shadow;
|
||||
RefPtr<Gfx::Bitmap> m_tooltip_shadow;
|
||||
String m_last_active_window_shadow_path;
|
||||
String m_last_inactive_window_shadow_path;
|
||||
String m_last_menu_shadow_path;
|
||||
String m_last_taskbar_shadow_path;
|
||||
String m_last_tooltip_shadow_path;
|
||||
DeprecatedString m_last_active_window_shadow_path;
|
||||
DeprecatedString m_last_inactive_window_shadow_path;
|
||||
DeprecatedString m_last_menu_shadow_path;
|
||||
DeprecatedString m_last_taskbar_shadow_path;
|
||||
DeprecatedString m_last_tooltip_shadow_path;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ private:
|
|||
|
||||
RefPtr<Model> m_model;
|
||||
ModelSelection m_selection;
|
||||
String m_highlighted_search;
|
||||
DeprecatedString m_highlighted_search;
|
||||
RefPtr<Core::Timer> m_highlighted_search_timer;
|
||||
SelectionBehavior m_selection_behavior { SelectionBehavior::SelectItems };
|
||||
SelectionMode m_selection_mode { SelectionMode::SingleSelection };
|
||||
|
|
|
@ -13,57 +13,57 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
NonnullRefPtr<Action> Action::create(String text, Function<void(Action&)> callback, Core::Object* parent)
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create(String text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), move(icon), move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent)
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> callback, Core::Object* parent)
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, alternate_shortcut, move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create(String text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, Shortcut {}, move(icon), move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, alternate_shortcut, move(icon), move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create_checkable(String text, Function<void(Action&)> callback, Core::Object* parent)
|
||||
NonnullRefPtr<Action> Action::create_checkable(DeprecatedString text, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), move(callback), parent, true));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create_checkable(String text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
|
||||
NonnullRefPtr<Action> Action::create_checkable(DeprecatedString text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), move(icon), move(callback), parent, true));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create_checkable(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent)
|
||||
NonnullRefPtr<Action> Action::create_checkable(DeprecatedString text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, move(callback), parent, true));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create_checkable(String text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
|
||||
NonnullRefPtr<Action> Action::create_checkable(DeprecatedString text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, Shortcut {}, move(icon), move(callback), parent, true));
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Action>> Action::try_create_checkable(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent)
|
||||
ErrorOr<NonnullRefPtr<Action>> Action::try_create_checkable(DeprecatedString text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Action(move(text), shortcut, Shortcut {}, move(callback), parent, true));
|
||||
}
|
||||
|
@ -81,27 +81,27 @@ RefPtr<Action> Action::find_action_for_shortcut(Core::Object& object, Shortcut c
|
|||
return found_action;
|
||||
}
|
||||
|
||||
Action::Action(String text, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
|
||||
Action::Action(DeprecatedString text, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
|
||||
: Action(move(text), Shortcut {}, Shortcut {}, nullptr, move(on_activation_callback), parent, checkable)
|
||||
{
|
||||
}
|
||||
|
||||
Action::Action(String text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
|
||||
Action::Action(DeprecatedString text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
|
||||
: Action(move(text), Shortcut {}, Shortcut {}, move(icon), move(on_activation_callback), parent, checkable)
|
||||
{
|
||||
}
|
||||
|
||||
Action::Action(String text, Shortcut const& shortcut, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
|
||||
Action::Action(DeprecatedString text, Shortcut const& shortcut, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
|
||||
: Action(move(text), shortcut, Shortcut {}, nullptr, move(on_activation_callback), parent, checkable)
|
||||
{
|
||||
}
|
||||
|
||||
Action::Action(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
|
||||
Action::Action(DeprecatedString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
|
||||
: Action(move(text), shortcut, alternate_shortcut, nullptr, move(on_activation_callback), parent, checkable)
|
||||
{
|
||||
}
|
||||
|
||||
Action::Action(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
|
||||
Action::Action(DeprecatedString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> on_activation_callback, Core::Object* parent, bool checkable)
|
||||
: Core::Object(parent)
|
||||
, on_activation(move(on_activation_callback))
|
||||
, m_text(move(text))
|
||||
|
@ -270,7 +270,7 @@ void Action::set_icon(Gfx::Bitmap const* icon)
|
|||
});
|
||||
}
|
||||
|
||||
void Action::set_text(String text)
|
||||
void Action::set_text(DeprecatedString text)
|
||||
{
|
||||
if (m_text == text)
|
||||
return;
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/HashTable.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <AK/Weakable.h>
|
||||
#include <LibCore/Object.h>
|
||||
|
@ -23,7 +23,7 @@
|
|||
namespace GUI {
|
||||
|
||||
namespace CommonActions {
|
||||
NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_icon, Window* parent = nullptr);
|
||||
NonnullRefPtr<Action> make_about_action(DeprecatedString const& app_name, Icon const& app_icon, Window* parent = nullptr);
|
||||
NonnullRefPtr<Action> make_open_action(Function<void(Action&)>, Core::Object* parent = nullptr);
|
||||
NonnullRefPtr<Action> make_save_action(Function<void(Action&)>, Core::Object* parent = nullptr);
|
||||
NonnullRefPtr<Action> make_save_as_action(Function<void(Action&)>, Core::Object* parent = nullptr);
|
||||
|
@ -65,28 +65,28 @@ public:
|
|||
WindowLocal,
|
||||
ApplicationGlobal,
|
||||
};
|
||||
static NonnullRefPtr<Action> create(String text, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(String text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(String text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(String text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create_checkable(String text, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create_checkable(String text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create_checkable(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create_checkable(String text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(DeprecatedString text, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(DeprecatedString text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(DeprecatedString text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(DeprecatedString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(DeprecatedString text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create(DeprecatedString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create_checkable(DeprecatedString text, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create_checkable(DeprecatedString text, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create_checkable(DeprecatedString text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static NonnullRefPtr<Action> create_checkable(DeprecatedString text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
|
||||
static ErrorOr<NonnullRefPtr<Action>> try_create_checkable(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
static ErrorOr<NonnullRefPtr<Action>> try_create_checkable(DeprecatedString text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
|
||||
|
||||
static RefPtr<Action> find_action_for_shortcut(Core::Object& object, Shortcut const& shortcut);
|
||||
|
||||
virtual ~Action() override;
|
||||
|
||||
String text() const { return m_text; }
|
||||
void set_text(String);
|
||||
DeprecatedString text() const { return m_text; }
|
||||
void set_text(DeprecatedString);
|
||||
|
||||
String const& status_tip() const { return m_status_tip; }
|
||||
void set_status_tip(String status_tip) { m_status_tip = move(status_tip); }
|
||||
DeprecatedString const& status_tip() const { return m_status_tip; }
|
||||
void set_status_tip(DeprecatedString status_tip) { m_status_tip = move(status_tip); }
|
||||
|
||||
Shortcut const& shortcut() const { return m_shortcut; }
|
||||
Shortcut const& alternate_shortcut() const { return m_alternate_shortcut; }
|
||||
|
@ -129,19 +129,19 @@ public:
|
|||
HashTable<MenuItem*> menu_items() const { return m_menu_items; }
|
||||
|
||||
private:
|
||||
Action(String, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
|
||||
Action(String, Shortcut const&, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
|
||||
Action(String, Shortcut const&, Shortcut const&, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
|
||||
Action(String, Shortcut const&, Shortcut const&, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
|
||||
Action(String, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
|
||||
Action(DeprecatedString, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
|
||||
Action(DeprecatedString, Shortcut const&, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
|
||||
Action(DeprecatedString, Shortcut const&, Shortcut const&, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
|
||||
Action(DeprecatedString, Shortcut const&, Shortcut const&, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
|
||||
Action(DeprecatedString, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> = nullptr, Core::Object* = nullptr, bool checkable = false);
|
||||
|
||||
template<typename Callback>
|
||||
void for_each_toolbar_button(Callback);
|
||||
template<typename Callback>
|
||||
void for_each_menu_item(Callback);
|
||||
|
||||
String m_text;
|
||||
String m_status_tip;
|
||||
DeprecatedString m_text;
|
||||
DeprecatedString m_status_tip;
|
||||
RefPtr<Gfx::Bitmap> m_icon;
|
||||
Shortcut m_shortcut;
|
||||
Shortcut m_alternate_shortcut;
|
||||
|
|
|
@ -24,7 +24,7 @@ class Application::TooltipWindow final : public Window {
|
|||
C_OBJECT(TooltipWindow);
|
||||
|
||||
public:
|
||||
void set_tooltip(String const& tooltip)
|
||||
void set_tooltip(DeprecatedString const& tooltip)
|
||||
{
|
||||
m_label->set_text(Gfx::parse_ampersand_string(tooltip));
|
||||
int tooltip_width = m_label->effective_min_size().width().as_int() + 10;
|
||||
|
@ -89,7 +89,7 @@ Application::Application(int argc, char** argv, Core::EventLoop::MakeInspectable
|
|||
m_dnd_debugging_enabled = true;
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
String arg(argv[i]);
|
||||
DeprecatedString arg(argv[i]);
|
||||
m_args.append(move(arg));
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ Action* Application::action_for_shortcut(Shortcut const& shortcut) const
|
|||
return (*it).value;
|
||||
}
|
||||
|
||||
void Application::show_tooltip(String tooltip, Widget const* tooltip_source_widget)
|
||||
void Application::show_tooltip(DeprecatedString tooltip, Widget const* tooltip_source_widget)
|
||||
{
|
||||
if (!Desktop::the().system_effects().tooltips())
|
||||
return;
|
||||
|
@ -166,7 +166,7 @@ void Application::show_tooltip(String tooltip, Widget const* tooltip_source_widg
|
|||
}
|
||||
}
|
||||
|
||||
void Application::show_tooltip_immediately(String tooltip, Widget const* tooltip_source_widget)
|
||||
void Application::show_tooltip_immediately(DeprecatedString tooltip, Widget const* tooltip_source_widget)
|
||||
{
|
||||
if (!Desktop::the().system_effects().tooltips())
|
||||
return;
|
||||
|
@ -276,7 +276,7 @@ void Application::set_pending_drop_widget(Widget* widget)
|
|||
m_pending_drop_widget->update();
|
||||
}
|
||||
|
||||
void Application::set_drag_hovered_widget_impl(Widget* widget, Gfx::IntPoint const& position, Vector<String> mime_types)
|
||||
void Application::set_drag_hovered_widget_impl(Widget* widget, Gfx::IntPoint const& position, Vector<DeprecatedString> mime_types)
|
||||
{
|
||||
if (widget == m_drag_hovered_widget)
|
||||
return;
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/Object.h>
|
||||
|
@ -38,8 +38,8 @@ public:
|
|||
void register_global_shortcut_action(Badge<Action>, Action&);
|
||||
void unregister_global_shortcut_action(Badge<Action>, Action&);
|
||||
|
||||
void show_tooltip(String, Widget const* tooltip_source_widget);
|
||||
void show_tooltip_immediately(String, Widget const* tooltip_source_widget);
|
||||
void show_tooltip(DeprecatedString, Widget const* tooltip_source_widget);
|
||||
void show_tooltip_immediately(DeprecatedString, Widget const* tooltip_source_widget);
|
||||
void hide_tooltip();
|
||||
Widget* tooltip_source_widget() { return m_tooltip_source_widget; };
|
||||
|
||||
|
@ -49,8 +49,8 @@ public:
|
|||
void did_create_window(Badge<Window>);
|
||||
void did_delete_last_window(Badge<Window>);
|
||||
|
||||
String const& invoked_as() const { return m_invoked_as; }
|
||||
Vector<String> const& args() const { return m_args; }
|
||||
DeprecatedString const& invoked_as() const { return m_invoked_as; }
|
||||
Vector<DeprecatedString> const& args() const { return m_args; }
|
||||
|
||||
Gfx::Palette palette() const;
|
||||
void set_palette(Gfx::Palette const&);
|
||||
|
@ -75,7 +75,7 @@ public:
|
|||
Widget* pending_drop_widget() { return m_pending_drop_widget.ptr(); }
|
||||
Widget const* pending_drop_widget() const { return m_pending_drop_widget.ptr(); }
|
||||
|
||||
void set_drag_hovered_widget(Badge<Window>, Widget* widget, Gfx::IntPoint const& position = {}, Vector<String> mime_types = {})
|
||||
void set_drag_hovered_widget(Badge<Window>, Widget* widget, Gfx::IntPoint const& position = {}, Vector<DeprecatedString> mime_types = {})
|
||||
{
|
||||
set_drag_hovered_widget_impl(widget, position, move(mime_types));
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ private:
|
|||
void request_tooltip_show();
|
||||
void tooltip_hide_timer_did_fire();
|
||||
|
||||
void set_drag_hovered_widget_impl(Widget*, Gfx::IntPoint const& = {}, Vector<String> = {});
|
||||
void set_drag_hovered_widget_impl(Widget*, Gfx::IntPoint const& = {}, Vector<DeprecatedString> = {});
|
||||
void set_pending_drop_widget(Widget*);
|
||||
|
||||
OwnPtr<Core::EventLoop> m_event_loop;
|
||||
|
@ -116,8 +116,8 @@ private:
|
|||
bool m_focus_debugging_enabled { false };
|
||||
bool m_hover_debugging_enabled { false };
|
||||
bool m_dnd_debugging_enabled { false };
|
||||
String m_invoked_as;
|
||||
Vector<String> m_args;
|
||||
DeprecatedString m_invoked_as;
|
||||
Vector<DeprecatedString> m_args;
|
||||
WeakPtr<Widget> m_drag_hovered_widget;
|
||||
WeakPtr<Widget> m_pending_drop_widget;
|
||||
};
|
||||
|
|
|
@ -71,7 +71,7 @@ void Breadcrumbbar::clear_segments()
|
|||
m_selected_segment = {};
|
||||
}
|
||||
|
||||
void Breadcrumbbar::append_segment(String text, Gfx::Bitmap const* icon, String data, String tooltip)
|
||||
void Breadcrumbbar::append_segment(DeprecatedString text, Gfx::Bitmap const* icon, DeprecatedString data, DeprecatedString tooltip)
|
||||
{
|
||||
auto& button = add<BreadcrumbButton>();
|
||||
button.set_button_style(Gfx::ButtonStyle::Coolbar);
|
||||
|
@ -128,7 +128,7 @@ void Breadcrumbbar::remove_end_segments(size_t start_segment_index)
|
|||
m_selected_segment = {};
|
||||
}
|
||||
|
||||
Optional<size_t> Breadcrumbbar::find_segment_with_data(String const& data)
|
||||
Optional<size_t> Breadcrumbbar::find_segment_with_data(DeprecatedString const& data)
|
||||
{
|
||||
for (size_t i = 0; i < segment_count(); ++i) {
|
||||
if (segment_data(i) == data)
|
||||
|
|
|
@ -18,13 +18,13 @@ public:
|
|||
virtual ~Breadcrumbbar() override = default;
|
||||
|
||||
void clear_segments();
|
||||
void append_segment(String text, Gfx::Bitmap const* icon = nullptr, String data = {}, String tooltip = {});
|
||||
void append_segment(DeprecatedString text, Gfx::Bitmap const* icon = nullptr, DeprecatedString data = {}, DeprecatedString tooltip = {});
|
||||
void remove_end_segments(size_t segment_index);
|
||||
void relayout();
|
||||
|
||||
size_t segment_count() const { return m_segments.size(); }
|
||||
String segment_data(size_t index) const { return m_segments[index].data; }
|
||||
Optional<size_t> find_segment_with_data(String const& data);
|
||||
DeprecatedString segment_data(size_t index) const { return m_segments[index].data; }
|
||||
Optional<size_t> find_segment_with_data(DeprecatedString const& data);
|
||||
|
||||
void set_selected_segment(Optional<size_t> index);
|
||||
Optional<size_t> selected_segment() const { return m_selected_segment; }
|
||||
|
@ -42,8 +42,8 @@ private:
|
|||
|
||||
struct Segment {
|
||||
RefPtr<const Gfx::Bitmap> icon;
|
||||
String text;
|
||||
String data;
|
||||
DeprecatedString text;
|
||||
DeprecatedString data;
|
||||
int width { 0 };
|
||||
int shrunken_width { 0 };
|
||||
WeakPtr<GUI::Button> button;
|
||||
|
|
|
@ -20,7 +20,7 @@ REGISTER_WIDGET(GUI, DialogButton)
|
|||
|
||||
namespace GUI {
|
||||
|
||||
Button::Button(String text)
|
||||
Button::Button(DeprecatedString text)
|
||||
: AbstractButton(move(text))
|
||||
{
|
||||
set_min_size({ 40, 22 });
|
||||
|
@ -179,7 +179,7 @@ void Button::set_icon(RefPtr<Gfx::Bitmap> icon)
|
|||
update();
|
||||
}
|
||||
|
||||
void Button::set_icon_from_path(String const& path)
|
||||
void Button::set_icon_from_path(DeprecatedString const& path)
|
||||
{
|
||||
auto maybe_bitmap = Gfx::Bitmap::try_load_from_file(path);
|
||||
if (maybe_bitmap.is_error()) {
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
virtual ~Button() override;
|
||||
|
||||
void set_icon(RefPtr<Gfx::Bitmap>);
|
||||
void set_icon_from_path(String const&);
|
||||
void set_icon_from_path(DeprecatedString const&);
|
||||
Gfx::Bitmap const* icon() const { return m_icon.ptr(); }
|
||||
Gfx::Bitmap* icon() { return m_icon.ptr(); }
|
||||
|
||||
|
@ -69,7 +69,7 @@ public:
|
|||
virtual Optional<UISize> calculated_min_size() const override;
|
||||
|
||||
protected:
|
||||
explicit Button(String text = {});
|
||||
explicit Button(DeprecatedString text = {});
|
||||
virtual void mousedown_event(MouseEvent&) override;
|
||||
virtual void mousemove_event(MouseEvent&) override;
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
|
@ -92,7 +92,7 @@ class DialogButton final : public Button {
|
|||
|
||||
public:
|
||||
virtual ~DialogButton() override {};
|
||||
explicit DialogButton(String text = {})
|
||||
explicit DialogButton(DeprecatedString text = {})
|
||||
: Button(move(text))
|
||||
{
|
||||
set_fixed_width(80);
|
||||
|
|
|
@ -332,17 +332,17 @@ void Calendar::update_tiles(unsigned view_year, unsigned view_month)
|
|||
update();
|
||||
}
|
||||
|
||||
String Calendar::formatted_date(Format format)
|
||||
DeprecatedString Calendar::formatted_date(Format format)
|
||||
{
|
||||
switch (format) {
|
||||
case ShortMonthYear:
|
||||
return String::formatted("{} {}", short_month_names[view_month() - 1], view_year());
|
||||
return DeprecatedString::formatted("{} {}", short_month_names[view_month() - 1], view_year());
|
||||
case LongMonthYear:
|
||||
return String::formatted("{} {}", long_month_names[view_month() - 1], view_year());
|
||||
return DeprecatedString::formatted("{} {}", long_month_names[view_month() - 1], view_year());
|
||||
case MonthOnly:
|
||||
return String::formatted("{}", long_month_names[view_month() - 1]);
|
||||
return DeprecatedString::formatted("{}", long_month_names[view_month() - 1]);
|
||||
case YearOnly:
|
||||
return String::number(view_year());
|
||||
return DeprecatedString::number(view_year());
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ void Calendar::paint_event(GUI::PaintEvent& event)
|
|||
text_rect = Gfx::IntRect(tile_rect);
|
||||
}
|
||||
|
||||
auto display_date = String::number(m_tiles[0][i].day);
|
||||
auto display_date = DeprecatedString::number(m_tiles[0][i].day);
|
||||
if (m_tiles[0][i].is_selected && (width < 30 || height < 30))
|
||||
painter.draw_rect(tile_rect, palette().base_text());
|
||||
|
||||
|
@ -609,7 +609,7 @@ void Calendar::paint_event(GUI::PaintEvent& event)
|
|||
set_font(small_font);
|
||||
}
|
||||
|
||||
auto display_date = String::number(m_tiles[l][i].day);
|
||||
auto display_date = DeprecatedString::number(m_tiles[l][i].day);
|
||||
if (m_tiles[l][i].is_selected)
|
||||
painter.draw_rect(tile_rect, palette().base_text());
|
||||
|
||||
|
@ -763,13 +763,13 @@ void Calendar::doubleclick_event(GUI::MouseEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
size_t Calendar::day_of_week_index(String const& day_name)
|
||||
size_t Calendar::day_of_week_index(DeprecatedString const& day_name)
|
||||
{
|
||||
auto const& day_names = AK::long_day_names;
|
||||
return AK::find_index(day_names.begin(), day_names.end(), day_name);
|
||||
}
|
||||
|
||||
void Calendar::config_string_did_change(String const& domain, String const& group, String const& key, String const& value)
|
||||
void Calendar::config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value)
|
||||
{
|
||||
if (domain == "Calendar" && group == "View" && key == "FirstDayOfWeek") {
|
||||
m_first_day_of_week = static_cast<DayOfWeek>(day_of_week_index(value));
|
||||
|
@ -780,7 +780,7 @@ void Calendar::config_string_did_change(String const& domain, String const& grou
|
|||
}
|
||||
}
|
||||
|
||||
void Calendar::config_i32_did_change(String const& domain, String const& group, String const& key, i32 value)
|
||||
void Calendar::config_i32_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, i32 value)
|
||||
{
|
||||
if (domain == "Calendar" && group == "View" && key == "WeekendLength") {
|
||||
m_weekend_length = value;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <LibConfig/Listener.h>
|
||||
#include <LibCore/DateTime.h>
|
||||
#include <LibGUI/Frame.h>
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
unsigned view_year() const { return m_view_year; }
|
||||
unsigned view_month() const { return m_view_month; }
|
||||
|
||||
String formatted_date(Format format = LongMonthYear);
|
||||
DeprecatedString formatted_date(Format format = LongMonthYear);
|
||||
|
||||
Mode mode() const { return m_mode; }
|
||||
void toggle_mode();
|
||||
|
@ -71,8 +71,8 @@ public:
|
|||
m_unadjusted_tile_size.set_height(height);
|
||||
}
|
||||
|
||||
virtual void config_string_did_change(String const&, String const&, String const&, String const&) override;
|
||||
virtual void config_i32_did_change(String const&, String const&, String const&, i32 value) override;
|
||||
virtual void config_string_did_change(DeprecatedString const&, DeprecatedString const&, DeprecatedString const&, DeprecatedString const&) override;
|
||||
virtual void config_i32_did_change(DeprecatedString const&, DeprecatedString const&, DeprecatedString const&, i32 value) override;
|
||||
|
||||
Function<void()> on_tile_click;
|
||||
Function<void()> on_tile_doubleclick;
|
||||
|
@ -82,7 +82,7 @@ private:
|
|||
Calendar(Core::DateTime date_time = Core::DateTime::now(), Mode mode = Month);
|
||||
virtual ~Calendar() override = default;
|
||||
|
||||
static size_t day_of_week_index(String const&);
|
||||
static size_t day_of_week_index(DeprecatedString const&);
|
||||
|
||||
virtual void resize_event(GUI::ResizeEvent&) override;
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
|
@ -105,14 +105,14 @@ private:
|
|||
bool is_day_in_weekend(DayOfWeek);
|
||||
|
||||
struct Day {
|
||||
String name;
|
||||
DeprecatedString name;
|
||||
int width { 0 };
|
||||
int height { 16 };
|
||||
};
|
||||
Vector<Day> m_days;
|
||||
|
||||
struct MonthTile {
|
||||
String name;
|
||||
DeprecatedString name;
|
||||
Gfx::IntRect rect;
|
||||
int width { 0 };
|
||||
int height { 0 };
|
||||
|
|
|
@ -20,7 +20,7 @@ static constexpr int s_box_width = 13;
|
|||
static constexpr int s_box_height = 13;
|
||||
static constexpr int s_horizontal_padding = 6;
|
||||
|
||||
CheckBox::CheckBox(String text)
|
||||
CheckBox::CheckBox(DeprecatedString text)
|
||||
: AbstractButton(move(text))
|
||||
{
|
||||
REGISTER_BOOL_PROPERTY("autosize", is_autosize, set_autosize);
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
void set_checkbox_position(CheckBoxPosition value) { m_checkbox_position = value; }
|
||||
|
||||
protected:
|
||||
explicit CheckBox(String = {});
|
||||
explicit CheckBox(DeprecatedString = {});
|
||||
|
||||
private:
|
||||
void size_to_fit();
|
||||
|
|
|
@ -24,7 +24,7 @@ private:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void clipboard_data_changed(String const& mime_type) override
|
||||
virtual void clipboard_data_changed(DeprecatedString const& mime_type) override
|
||||
{
|
||||
Clipboard::the().clipboard_data_changed({}, mime_type);
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ RefPtr<Gfx::Bitmap> Clipboard::DataAndType::as_bitmap() const
|
|||
return bitmap;
|
||||
}
|
||||
|
||||
void Clipboard::set_data(ReadonlyBytes data, String const& type, HashMap<String, String> const& metadata)
|
||||
void Clipboard::set_data(ReadonlyBytes data, DeprecatedString const& type, HashMap<DeprecatedString, DeprecatedString> const& metadata)
|
||||
{
|
||||
auto buffer_or_error = Core::AnonymousBuffer::create_with_size(data.size());
|
||||
if (buffer_or_error.is_error()) {
|
||||
|
@ -139,12 +139,12 @@ void Clipboard::set_data(ReadonlyBytes data, String const& type, HashMap<String,
|
|||
|
||||
void Clipboard::set_bitmap(Gfx::Bitmap const& bitmap)
|
||||
{
|
||||
HashMap<String, String> metadata;
|
||||
metadata.set("width", String::number(bitmap.width()));
|
||||
metadata.set("height", String::number(bitmap.height()));
|
||||
metadata.set("scale", String::number(bitmap.scale()));
|
||||
metadata.set("format", String::number((int)bitmap.format()));
|
||||
metadata.set("pitch", String::number(bitmap.pitch()));
|
||||
HashMap<DeprecatedString, DeprecatedString> metadata;
|
||||
metadata.set("width", DeprecatedString::number(bitmap.width()));
|
||||
metadata.set("height", DeprecatedString::number(bitmap.height()));
|
||||
metadata.set("scale", DeprecatedString::number(bitmap.scale()));
|
||||
metadata.set("format", DeprecatedString::number((int)bitmap.format()));
|
||||
metadata.set("pitch", DeprecatedString::number(bitmap.pitch()));
|
||||
set_data({ bitmap.scanline(0), bitmap.size_in_bytes() }, "image/x-serenityos", metadata);
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ void Clipboard::clear()
|
|||
connection().async_set_clipboard_data({}, {}, {});
|
||||
}
|
||||
|
||||
void Clipboard::clipboard_data_changed(Badge<ConnectionToClipboardServer>, String const& mime_type)
|
||||
void Clipboard::clipboard_data_changed(Badge<ConnectionToClipboardServer>, DeprecatedString const& mime_type)
|
||||
{
|
||||
if (on_change)
|
||||
on_change(mime_type);
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibGUI/Forward.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
|
||||
|
@ -25,13 +25,13 @@ public:
|
|||
ClipboardClient();
|
||||
virtual ~ClipboardClient();
|
||||
|
||||
virtual void clipboard_content_did_change(String const& mime_type) = 0;
|
||||
virtual void clipboard_content_did_change(DeprecatedString const& mime_type) = 0;
|
||||
};
|
||||
|
||||
struct DataAndType {
|
||||
ByteBuffer data;
|
||||
String mime_type;
|
||||
HashMap<String, String> metadata;
|
||||
DeprecatedString mime_type;
|
||||
HashMap<DeprecatedString, DeprecatedString> metadata;
|
||||
|
||||
RefPtr<Gfx::Bitmap> as_bitmap() const;
|
||||
};
|
||||
|
@ -40,19 +40,19 @@ public:
|
|||
static Clipboard& the();
|
||||
|
||||
DataAndType fetch_data_and_type() const;
|
||||
String fetch_mime_type() const { return fetch_data_and_type().mime_type; }
|
||||
DeprecatedString fetch_mime_type() const { return fetch_data_and_type().mime_type; }
|
||||
|
||||
void set_data(ReadonlyBytes data, String const& mime_type = "text/plain", HashMap<String, String> const& metadata = {});
|
||||
void set_plain_text(String const& text) { set_data(text.bytes()); }
|
||||
void set_data(ReadonlyBytes data, DeprecatedString const& mime_type = "text/plain", HashMap<DeprecatedString, DeprecatedString> const& metadata = {});
|
||||
void set_plain_text(DeprecatedString const& text) { set_data(text.bytes()); }
|
||||
void set_bitmap(Gfx::Bitmap const&);
|
||||
void clear();
|
||||
|
||||
void clipboard_data_changed(Badge<ConnectionToClipboardServer>, String const& mime_type);
|
||||
void clipboard_data_changed(Badge<ConnectionToClipboardServer>, DeprecatedString const& mime_type);
|
||||
|
||||
void register_client(Badge<ClipboardClient>, ClipboardClient& client) { m_clients.set(&client); }
|
||||
void unregister_client(Badge<ClipboardClient>, ClipboardClient& client) { m_clients.remove(&client); }
|
||||
|
||||
Function<void(String const& mime_type)> on_change;
|
||||
Function<void(DeprecatedString const& mime_type)> on_change;
|
||||
|
||||
private:
|
||||
Clipboard() = default;
|
||||
|
|
|
@ -24,8 +24,8 @@ public:
|
|||
void set_color(Color, AllowCallback = AllowCallback::Yes);
|
||||
Color color() { return m_color; }
|
||||
|
||||
void set_color_picker_title(String title) { m_color_picker_title = move(title); }
|
||||
String color_picker_title() { return m_color_picker_title; }
|
||||
void set_color_picker_title(DeprecatedString title) { m_color_picker_title = move(title); }
|
||||
DeprecatedString color_picker_title() { return m_color_picker_title; }
|
||||
|
||||
Function<void()> on_change;
|
||||
|
||||
|
@ -42,7 +42,7 @@ private:
|
|||
void set_color_internal(Color, AllowCallback, bool change_text);
|
||||
|
||||
Color m_color;
|
||||
String m_color_picker_title { "Select color" };
|
||||
DeprecatedString m_color_picker_title { "Select color" };
|
||||
bool m_color_has_alpha_channel { true };
|
||||
bool m_may_be_color_rect_click { false };
|
||||
};
|
||||
|
|
|
@ -182,7 +182,7 @@ private:
|
|||
Color m_col;
|
||||
};
|
||||
|
||||
ColorPicker::ColorPicker(Color color, Window* parent_window, String title)
|
||||
ColorPicker::ColorPicker(Color color, Window* parent_window, DeprecatedString title)
|
||||
: Dialog(parent_window)
|
||||
, m_color(color)
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
Color color() const { return m_color; }
|
||||
|
||||
private:
|
||||
explicit ColorPicker(Color, Window* parent_window = nullptr, String title = "Edit Color");
|
||||
explicit ColorPicker(Color, Window* parent_window = nullptr, DeprecatedString title = "Edit Color");
|
||||
|
||||
void build_ui();
|
||||
void build_ui_custom(Widget& root_container);
|
||||
|
|
|
@ -151,7 +151,7 @@ void ComboBox::set_editor_placeholder(StringView placeholder)
|
|||
m_editor->set_placeholder(placeholder);
|
||||
}
|
||||
|
||||
String const& ComboBox::editor_placeholder() const
|
||||
DeprecatedString const& ComboBox::editor_placeholder() const
|
||||
{
|
||||
return m_editor->placeholder();
|
||||
}
|
||||
|
@ -269,12 +269,12 @@ void ComboBox::close()
|
|||
m_list_window->hide();
|
||||
}
|
||||
|
||||
String ComboBox::text() const
|
||||
DeprecatedString ComboBox::text() const
|
||||
{
|
||||
return m_editor->text();
|
||||
}
|
||||
|
||||
void ComboBox::set_text(String const& text, AllowCallback allow_callback)
|
||||
void ComboBox::set_text(DeprecatedString const& text, AllowCallback allow_callback)
|
||||
{
|
||||
m_editor->set_text(text, allow_callback);
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ class ComboBox : public Frame {
|
|||
public:
|
||||
virtual ~ComboBox() override;
|
||||
|
||||
String text() const;
|
||||
void set_text(String const&, AllowCallback = AllowCallback::Yes);
|
||||
DeprecatedString text() const;
|
||||
void set_text(DeprecatedString const&, AllowCallback = AllowCallback::Yes);
|
||||
|
||||
void open();
|
||||
void close();
|
||||
|
@ -42,12 +42,12 @@ public:
|
|||
void set_model_column(int);
|
||||
|
||||
void set_editor_placeholder(StringView placeholder);
|
||||
String const& editor_placeholder() const;
|
||||
DeprecatedString const& editor_placeholder() const;
|
||||
|
||||
int max_visible_items() const { return m_max_visible_items; }
|
||||
void set_max_visible_items(int max) { m_max_visible_items = max; }
|
||||
|
||||
Function<void(String const&, ModelIndex const&)> on_change;
|
||||
Function<void(DeprecatedString const&, ModelIndex const&)> on_change;
|
||||
Function<void()> on_return_pressed;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
|
@ -18,7 +18,7 @@ public:
|
|||
virtual void undo() { }
|
||||
virtual void redo() { }
|
||||
|
||||
virtual String action_text() const { return {}; }
|
||||
virtual DeprecatedString action_text() const { return {}; }
|
||||
virtual bool merge_with(Command const&) { return false; }
|
||||
|
||||
protected:
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
return Column::__Count;
|
||||
}
|
||||
|
||||
virtual String column_name(int) const override { return {}; }
|
||||
virtual DeprecatedString column_name(int) const override { return {}; }
|
||||
|
||||
virtual ModelIndex index(int row, int column = 0, ModelIndex const& = ModelIndex()) const override
|
||||
{
|
||||
|
@ -141,20 +141,20 @@ public:
|
|||
if (needle.is_empty())
|
||||
return TriState::True;
|
||||
|
||||
auto haystack = String::formatted("{} {}", menu_name(index), action_text(index));
|
||||
auto haystack = DeprecatedString::formatted("{} {}", menu_name(index), action_text(index));
|
||||
if (fuzzy_match(needle, haystack).score > 0)
|
||||
return TriState::True;
|
||||
return TriState::False;
|
||||
}
|
||||
|
||||
static String action_text(ModelIndex const& index)
|
||||
static DeprecatedString action_text(ModelIndex const& index)
|
||||
{
|
||||
auto& action = *static_cast<GUI::Action*>(index.internal_data());
|
||||
|
||||
return Gfx::parse_ampersand_string(action.text());
|
||||
}
|
||||
|
||||
static String menu_name(ModelIndex const& index)
|
||||
static DeprecatedString menu_name(ModelIndex const& index)
|
||||
{
|
||||
auto& action = *static_cast<GUI::Action*>(index.internal_data());
|
||||
if (action.menu_items().is_empty())
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/Version.h>
|
||||
#include <LibGUI/AboutDialog.h>
|
||||
|
@ -17,10 +17,10 @@ namespace GUI {
|
|||
|
||||
namespace CommonActions {
|
||||
|
||||
NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_icon, Window* parent)
|
||||
NonnullRefPtr<Action> make_about_action(DeprecatedString const& app_name, Icon const& app_icon, Window* parent)
|
||||
{
|
||||
auto weak_parent = AK::make_weak_ptr_if_nonnull<Window>(parent);
|
||||
auto action = Action::create(String::formatted("&About {}", app_name), app_icon.bitmap_for_size(16), [=](auto&) {
|
||||
auto action = Action::create(DeprecatedString::formatted("&About {}", app_name), app_icon.bitmap_for_size(16), [=](auto&) {
|
||||
AboutDialog::show(app_name, Core::Version::read_long_version_string(), app_icon.bitmap_for_size(32), weak_parent.ptr());
|
||||
});
|
||||
action->set_status_tip("Show application about box");
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/JsonArray.h>
|
||||
#include <AK/JsonObject.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/StandardPaths.h>
|
||||
|
@ -23,7 +23,7 @@ static void initialize_if_needed()
|
|||
if (s_initialized)
|
||||
return;
|
||||
|
||||
auto user_config = String::formatted("{}/CommonLocations.json", Core::StandardPaths::config_directory());
|
||||
auto user_config = DeprecatedString::formatted("{}/CommonLocations.json", Core::StandardPaths::config_directory());
|
||||
if (Core::File::exists(user_config)) {
|
||||
CommonLocationsProvider::load_from_json(user_config);
|
||||
return;
|
||||
|
@ -36,7 +36,7 @@ static void initialize_if_needed()
|
|||
s_initialized = true;
|
||||
}
|
||||
|
||||
void CommonLocationsProvider::load_from_json(String const& json_path)
|
||||
void CommonLocationsProvider::load_from_json(DeprecatedString const& json_path)
|
||||
{
|
||||
auto file = Core::File::construct(json_path);
|
||||
if (!file->open(Core::OpenMode::ReadOnly)) {
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibGUI/Forward.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
@ -16,11 +16,11 @@ namespace GUI {
|
|||
class CommonLocationsProvider {
|
||||
public:
|
||||
struct CommonLocation {
|
||||
String name;
|
||||
String path;
|
||||
DeprecatedString name;
|
||||
DeprecatedString path;
|
||||
};
|
||||
|
||||
static void load_from_json(String const& json_path);
|
||||
static void load_from_json(DeprecatedString const& json_path);
|
||||
static Vector<CommonLocation> const& common_locations();
|
||||
};
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ ConnectionToWindowManagerServer& ConnectionToWindowManagerServer::the()
|
|||
|
||||
void ConnectionToWindowManagerServer::window_state_changed(i32 wm_id, i32 client_id, i32 window_id,
|
||||
u32 workspace_row, u32 workspace_column, bool is_active, bool is_blocked, bool is_minimized, bool is_frameless,
|
||||
i32 window_type, String const& title, Gfx::IntRect const& rect, Optional<i32> const& progress)
|
||||
i32 window_type, DeprecatedString const& title, Gfx::IntRect const& rect, Optional<i32> const& progress)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(wm_id))
|
||||
Core::EventLoop::current().post_event(*window, make<WMWindowStateChangedEvent>(client_id, window_id, title, rect, workspace_row, workspace_column, is_active, is_blocked, static_cast<WindowType>(window_type), is_minimized, is_frameless, progress));
|
||||
|
@ -81,7 +81,7 @@ void ConnectionToWindowManagerServer::workspace_changed(i32 wm_id, u32 row, u32
|
|||
Core::EventLoop::current().post_event(*window, make<WMWorkspaceChangedEvent>(wm_id, row, column));
|
||||
}
|
||||
|
||||
void ConnectionToWindowManagerServer::keymap_changed(i32 wm_id, String const& keymap)
|
||||
void ConnectionToWindowManagerServer::keymap_changed(i32 wm_id, DeprecatedString const& keymap)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(wm_id))
|
||||
Core::EventLoop::current().post_event(*window, make<WMKeymapChangedEvent>(wm_id, keymap));
|
||||
|
|
|
@ -28,7 +28,7 @@ private:
|
|||
}
|
||||
|
||||
virtual void window_removed(i32, i32, i32) override;
|
||||
virtual void window_state_changed(i32, i32, i32, u32, u32, bool, bool, bool, bool, i32, String const&, Gfx::IntRect const&, Optional<i32> const&) override;
|
||||
virtual void window_state_changed(i32, i32, i32, u32, u32, bool, bool, bool, bool, i32, DeprecatedString const&, Gfx::IntRect const&, Optional<i32> const&) override;
|
||||
virtual void window_icon_bitmap_changed(i32, i32, i32, Gfx::ShareableBitmap const&) override;
|
||||
virtual void window_rect_changed(i32, i32, i32, Gfx::IntRect const&) override;
|
||||
virtual void applet_area_size_changed(i32, Gfx::IntSize const&) override;
|
||||
|
@ -37,7 +37,7 @@ private:
|
|||
virtual void super_d_key_pressed(i32) override;
|
||||
virtual void super_digit_key_pressed(i32, u8) override;
|
||||
virtual void workspace_changed(i32, u32, u32) override;
|
||||
virtual void keymap_changed(i32, String const&) override;
|
||||
virtual void keymap_changed(i32, DeprecatedString const&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ ConnectionToWindowServer::ConnectionToWindowServer(NonnullOwnPtr<Core::Stream::L
|
|||
m_client_id = message->client_id();
|
||||
}
|
||||
|
||||
void ConnectionToWindowServer::fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, String const&, String const&, String const&, Vector<bool> const&, i32)
|
||||
void ConnectionToWindowServer::fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, DeprecatedString const&, DeprecatedString const&, DeprecatedString const&, Vector<bool> const&, i32)
|
||||
{
|
||||
// NOTE: This message is handled in the constructor.
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ void ConnectionToWindowServer::update_system_theme(Core::AnonymousBuffer const&
|
|||
Application::the()->dispatch_event(*make<ThemeChangeEvent>());
|
||||
}
|
||||
|
||||
void ConnectionToWindowServer::update_system_fonts(String const& default_font_query, String const& fixed_width_font_query, String const& window_title_font_query)
|
||||
void ConnectionToWindowServer::update_system_fonts(DeprecatedString const& default_font_query, DeprecatedString const& fixed_width_font_query, DeprecatedString const& window_title_font_query)
|
||||
{
|
||||
Gfx::FontDatabase::set_default_font_query(default_font_query);
|
||||
Gfx::FontDatabase::set_fixed_width_font_query(fixed_width_font_query);
|
||||
|
@ -259,7 +259,7 @@ void ConnectionToWindowServer::mouse_up(i32 window_id, Gfx::IntPoint const& mous
|
|||
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseUp, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y, wheel_raw_delta_x, wheel_raw_delta_y));
|
||||
}
|
||||
|
||||
void ConnectionToWindowServer::mouse_move(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y, bool is_drag, Vector<String> const& mime_types)
|
||||
void ConnectionToWindowServer::mouse_move(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, i32 wheel_raw_delta_x, i32 wheel_raw_delta_y, bool is_drag, Vector<DeprecatedString> const& mime_types)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(window_id)) {
|
||||
if (is_drag)
|
||||
|
@ -349,7 +349,7 @@ void ConnectionToWindowServer::applet_area_rect_changed(Gfx::IntRect const& rect
|
|||
});
|
||||
}
|
||||
|
||||
void ConnectionToWindowServer::drag_dropped(i32 window_id, Gfx::IntPoint const& mouse_position, String const& text, HashMap<String, ByteBuffer> const& mime_data)
|
||||
void ConnectionToWindowServer::drag_dropped(i32 window_id, Gfx::IntPoint const& mouse_position, DeprecatedString const& text, HashMap<DeprecatedString, ByteBuffer> const& mime_data)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(window_id)) {
|
||||
auto mime_data_obj = Core::MimeData::construct(mime_data);
|
||||
|
|
|
@ -24,9 +24,9 @@ public:
|
|||
private:
|
||||
ConnectionToWindowServer(NonnullOwnPtr<Core::Stream::LocalSocket>);
|
||||
|
||||
virtual void fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, String const&, String const&, String const&, Vector<bool> const&, i32) override;
|
||||
virtual void fast_greet(Vector<Gfx::IntRect> const&, u32, u32, u32, Core::AnonymousBuffer const&, DeprecatedString const&, DeprecatedString const&, DeprecatedString const&, Vector<bool> const&, i32) override;
|
||||
virtual void paint(i32, Gfx::IntSize const&, Vector<Gfx::IntRect> const&) override;
|
||||
virtual void mouse_move(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, i32, i32, bool, Vector<String> const&) override;
|
||||
virtual void mouse_move(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, i32, i32, bool, Vector<DeprecatedString> const&) override;
|
||||
virtual void mouse_down(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, i32, i32) override;
|
||||
virtual void mouse_double_click(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, i32, i32) override;
|
||||
virtual void mouse_up(i32, Gfx::IntPoint const&, u32, u32, u32, i32, i32, i32, i32) override;
|
||||
|
@ -48,11 +48,11 @@ private:
|
|||
virtual void menu_visibility_did_change(i32, bool) override;
|
||||
virtual void screen_rects_changed(Vector<Gfx::IntRect> const&, u32, u32, u32) override;
|
||||
virtual void applet_area_rect_changed(Gfx::IntRect const&) override;
|
||||
virtual void drag_dropped(i32, Gfx::IntPoint const&, String const&, HashMap<String, ByteBuffer> const&) override;
|
||||
virtual void drag_dropped(i32, Gfx::IntPoint const&, DeprecatedString const&, HashMap<DeprecatedString, ByteBuffer> const&) override;
|
||||
virtual void drag_accepted() override;
|
||||
virtual void drag_cancelled() override;
|
||||
virtual void update_system_theme(Core::AnonymousBuffer const&) override;
|
||||
virtual void update_system_fonts(String const&, String const&, String const&) override;
|
||||
virtual void update_system_fonts(DeprecatedString const&, DeprecatedString const&, DeprecatedString const&) override;
|
||||
virtual void update_system_effects(Vector<bool> const&) override;
|
||||
virtual void window_state_changed(i32, bool, bool, bool) override;
|
||||
virtual void display_link_notification() override;
|
||||
|
|
|
@ -49,7 +49,7 @@ void Desktop::set_wallpaper_mode(StringView mode)
|
|||
ConnectionToWindowServer::the().async_set_wallpaper_mode(mode);
|
||||
}
|
||||
|
||||
String Desktop::wallpaper_path() const
|
||||
DeprecatedString Desktop::wallpaper_path() const
|
||||
{
|
||||
return Config::read_string("WindowManager"sv, "Background"sv, "Wallpaper"sv);
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ RefPtr<Gfx::Bitmap> Desktop::wallpaper_bitmap() const
|
|||
return ConnectionToWindowServer::the().get_wallpaper().bitmap();
|
||||
}
|
||||
|
||||
bool Desktop::set_wallpaper(RefPtr<Gfx::Bitmap> wallpaper_bitmap, Optional<String> path)
|
||||
bool Desktop::set_wallpaper(RefPtr<Gfx::Bitmap> wallpaper_bitmap, Optional<DeprecatedString> path)
|
||||
{
|
||||
if (m_is_setting_desktop_wallpaper)
|
||||
return false;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibGUI/Forward.h>
|
||||
#include <LibGUI/SystemEffects.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
|
@ -31,9 +31,9 @@ public:
|
|||
|
||||
void set_wallpaper_mode(StringView mode);
|
||||
|
||||
String wallpaper_path() const;
|
||||
DeprecatedString wallpaper_path() const;
|
||||
RefPtr<Gfx::Bitmap> wallpaper_bitmap() const;
|
||||
bool set_wallpaper(RefPtr<Gfx::Bitmap> wallpaper_bitmap, Optional<String> path);
|
||||
bool set_wallpaper(RefPtr<Gfx::Bitmap> wallpaper_bitmap, Optional<DeprecatedString> path);
|
||||
|
||||
void set_system_effects(Vector<bool> effects) { m_system_effects = { effects }; };
|
||||
SystemEffects const& system_effects() const { return m_system_effects; }
|
||||
|
|
|
@ -73,7 +73,7 @@ void DragOperation::notify_cancelled(Badge<ConnectionToWindowServer>)
|
|||
s_current_drag_operation->done(Outcome::Cancelled);
|
||||
}
|
||||
|
||||
void DragOperation::set_text(String const& text)
|
||||
void DragOperation::set_text(DeprecatedString const& text)
|
||||
{
|
||||
if (!m_mime_data)
|
||||
m_mime_data = Core::MimeData::construct();
|
||||
|
@ -86,7 +86,7 @@ void DragOperation::set_bitmap(Gfx::Bitmap const* bitmap)
|
|||
if (bitmap)
|
||||
m_mime_data->set_data("image/x-raw-bitmap", bitmap->serialize_to_byte_buffer());
|
||||
}
|
||||
void DragOperation::set_data(String const& data_type, String const& data)
|
||||
void DragOperation::set_data(DeprecatedString const& data_type, DeprecatedString const& data)
|
||||
{
|
||||
if (!m_mime_data)
|
||||
m_mime_data = Core::MimeData::construct();
|
||||
|
|
|
@ -27,9 +27,9 @@ public:
|
|||
virtual ~DragOperation() override = default;
|
||||
|
||||
void set_mime_data(RefPtr<Core::MimeData> mime_data) { m_mime_data = move(mime_data); }
|
||||
void set_text(String const& text);
|
||||
void set_text(DeprecatedString const& text);
|
||||
void set_bitmap(Gfx::Bitmap const* bitmap);
|
||||
void set_data(String const& data_type, String const& data);
|
||||
void set_data(DeprecatedString const& data_type, DeprecatedString const& data);
|
||||
|
||||
Outcome exec();
|
||||
Outcome outcome() const { return m_outcome; }
|
||||
|
|
|
@ -452,7 +452,7 @@ bool MoveLineUpOrDownCommand::merge_with(GUI::Command const&)
|
|||
return false;
|
||||
}
|
||||
|
||||
String MoveLineUpOrDownCommand::action_text() const
|
||||
DeprecatedString MoveLineUpOrDownCommand::action_text() const
|
||||
{
|
||||
return "Move a line";
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
virtual void undo() override;
|
||||
virtual void redo() override;
|
||||
bool merge_with(GUI::Command const&) override;
|
||||
String action_text() const override;
|
||||
DeprecatedString action_text() const override;
|
||||
|
||||
static bool valid_operation(EditingEngine& engine, VerticalDirection direction);
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ class EmojiInputDialog final : public Dialog {
|
|||
struct Emoji {
|
||||
RefPtr<Button> button;
|
||||
Unicode::Emoji emoji;
|
||||
String text;
|
||||
DeprecatedString text;
|
||||
};
|
||||
|
||||
public:
|
||||
String const& selected_emoji_text() const { return m_selected_emoji_text; }
|
||||
DeprecatedString const& selected_emoji_text() const { return m_selected_emoji_text; }
|
||||
|
||||
private:
|
||||
explicit EmojiInputDialog(Window* parent_window);
|
||||
|
@ -40,7 +40,7 @@ private:
|
|||
RefPtr<Widget> m_emojis_widget;
|
||||
Vector<Emoji> m_emojis;
|
||||
Emoji const* m_first_displayed_emoji { nullptr };
|
||||
String m_selected_emoji_text;
|
||||
DeprecatedString m_selected_emoji_text;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
DropEvent::DropEvent(Gfx::IntPoint const& position, String const& text, NonnullRefPtr<Core::MimeData> mime_data)
|
||||
DropEvent::DropEvent(Gfx::IntPoint const& position, DeprecatedString const& text, NonnullRefPtr<Core::MimeData> mime_data)
|
||||
: Event(Event::Drop)
|
||||
, m_position(position)
|
||||
, m_text(text)
|
||||
|
@ -20,9 +20,9 @@ DropEvent::DropEvent(Gfx::IntPoint const& position, String const& text, NonnullR
|
|||
{
|
||||
}
|
||||
|
||||
String KeyEvent::to_string() const
|
||||
DeprecatedString KeyEvent::to_string() const
|
||||
{
|
||||
Vector<String, 8> parts;
|
||||
Vector<DeprecatedString, 8> parts;
|
||||
|
||||
if (m_modifiers & Mod_Ctrl)
|
||||
parts.append("Ctrl");
|
||||
|
|
|
@ -180,7 +180,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
String const& title() const { return m_title; }
|
||||
DeprecatedString const& title() const { return m_title; }
|
||||
Gfx::IntRect const& rect() const { return m_rect; }
|
||||
bool is_active() const { return m_active; }
|
||||
bool is_blocked() const { return m_blocked; }
|
||||
|
@ -192,7 +192,7 @@ public:
|
|||
unsigned workspace_column() const { return m_workspace_column; }
|
||||
|
||||
private:
|
||||
String m_title;
|
||||
DeprecatedString m_title;
|
||||
Gfx::IntRect m_rect;
|
||||
WindowType m_window_type;
|
||||
unsigned m_workspace_row;
|
||||
|
@ -251,16 +251,16 @@ private:
|
|||
|
||||
class WMKeymapChangedEvent : public WMEvent {
|
||||
public:
|
||||
explicit WMKeymapChangedEvent(int client_id, String const& keymap)
|
||||
explicit WMKeymapChangedEvent(int client_id, DeprecatedString const& keymap)
|
||||
: WMEvent(Event::Type::WM_KeymapChanged, client_id, 0)
|
||||
, m_keymap(keymap)
|
||||
{
|
||||
}
|
||||
|
||||
String const& keymap() const { return m_keymap; }
|
||||
DeprecatedString const& keymap() const { return m_keymap; }
|
||||
|
||||
private:
|
||||
const String m_keymap;
|
||||
const DeprecatedString m_keymap;
|
||||
};
|
||||
|
||||
class MultiPaintEvent final : public Event {
|
||||
|
@ -386,7 +386,7 @@ public:
|
|||
bool super() const { return m_modifiers & Mod_Super; }
|
||||
u8 modifiers() const { return m_modifiers; }
|
||||
u32 code_point() const { return m_code_point; }
|
||||
String text() const
|
||||
DeprecatedString text() const
|
||||
{
|
||||
StringBuilder sb;
|
||||
sb.append_code_point(m_code_point);
|
||||
|
@ -394,7 +394,7 @@ public:
|
|||
}
|
||||
u32 scancode() const { return m_scancode; }
|
||||
|
||||
String to_string() const;
|
||||
DeprecatedString to_string() const;
|
||||
|
||||
bool is_arrow_key() const
|
||||
{
|
||||
|
@ -460,7 +460,7 @@ private:
|
|||
|
||||
class DragEvent final : public Event {
|
||||
public:
|
||||
DragEvent(Type type, Gfx::IntPoint const& position, Vector<String> mime_types)
|
||||
DragEvent(Type type, Gfx::IntPoint const& position, Vector<DeprecatedString> mime_types)
|
||||
: Event(type)
|
||||
, m_position(position)
|
||||
, m_mime_types(move(mime_types))
|
||||
|
@ -468,26 +468,26 @@ public:
|
|||
}
|
||||
|
||||
Gfx::IntPoint const& position() const { return m_position; }
|
||||
Vector<String> const& mime_types() const { return m_mime_types; }
|
||||
Vector<DeprecatedString> const& mime_types() const { return m_mime_types; }
|
||||
|
||||
private:
|
||||
Gfx::IntPoint m_position;
|
||||
Vector<String> m_mime_types;
|
||||
Vector<DeprecatedString> m_mime_types;
|
||||
};
|
||||
|
||||
class DropEvent final : public Event {
|
||||
public:
|
||||
DropEvent(Gfx::IntPoint const&, String const& text, NonnullRefPtr<Core::MimeData> mime_data);
|
||||
DropEvent(Gfx::IntPoint const&, DeprecatedString const& text, NonnullRefPtr<Core::MimeData> mime_data);
|
||||
|
||||
~DropEvent() = default;
|
||||
|
||||
Gfx::IntPoint const& position() const { return m_position; }
|
||||
String const& text() const { return m_text; }
|
||||
DeprecatedString const& text() const { return m_text; }
|
||||
Core::MimeData const& mime_data() const { return m_mime_data; }
|
||||
|
||||
private:
|
||||
Gfx::IntPoint m_position;
|
||||
String m_text;
|
||||
DeprecatedString m_text;
|
||||
NonnullRefPtr<Core::MimeData> m_mime_data;
|
||||
};
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
*/
|
||||
|
||||
#include <AK/Array.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibCore/ConfigFile.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/MappedFile.h>
|
||||
|
@ -41,8 +41,8 @@ static Icon s_filetype_image_icon;
|
|||
static RefPtr<Gfx::Bitmap> s_symlink_emblem;
|
||||
static RefPtr<Gfx::Bitmap> s_symlink_emblem_small;
|
||||
|
||||
static HashMap<String, Icon> s_filetype_icons;
|
||||
static HashMap<String, Vector<String>> s_filetype_patterns;
|
||||
static HashMap<DeprecatedString, Icon> s_filetype_icons;
|
||||
static HashMap<DeprecatedString, Vector<DeprecatedString>> s_filetype_patterns;
|
||||
|
||||
static void initialize_executable_icon_if_needed()
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ static void initialize_if_needed()
|
|||
initialize_executable_icon_if_needed();
|
||||
|
||||
for (auto& filetype : config->keys("Icons")) {
|
||||
s_filetype_icons.set(filetype, Icon::default_icon(String::formatted("filetype-{}", filetype)));
|
||||
s_filetype_icons.set(filetype, Icon::default_icon(DeprecatedString::formatted("filetype-{}", filetype)));
|
||||
s_filetype_patterns.set(filetype, config->read_entry("Icons", filetype).split(','));
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ Icon FileIconProvider::filetype_image_icon()
|
|||
return s_filetype_image_icon;
|
||||
}
|
||||
|
||||
Icon FileIconProvider::icon_for_path(String const& path)
|
||||
Icon FileIconProvider::icon_for_path(DeprecatedString const& path)
|
||||
{
|
||||
struct stat stat;
|
||||
if (::stat(path.characters(), &stat) < 0)
|
||||
|
@ -153,9 +153,9 @@ Icon FileIconProvider::icon_for_path(String const& path)
|
|||
return icon_for_path(path, stat.st_mode);
|
||||
}
|
||||
|
||||
Icon FileIconProvider::icon_for_executable(String const& path)
|
||||
Icon FileIconProvider::icon_for_executable(DeprecatedString const& path)
|
||||
{
|
||||
static HashMap<String, Icon> app_icon_cache;
|
||||
static HashMap<DeprecatedString, Icon> app_icon_cache;
|
||||
|
||||
if (auto it = app_icon_cache.find(path); it != app_icon_cache.end())
|
||||
return it->value;
|
||||
|
@ -233,7 +233,7 @@ Icon FileIconProvider::icon_for_executable(String const& path)
|
|||
return icon;
|
||||
}
|
||||
|
||||
Icon FileIconProvider::icon_for_path(String const& path, mode_t mode)
|
||||
Icon FileIconProvider::icon_for_path(DeprecatedString const& path, mode_t mode)
|
||||
{
|
||||
initialize_if_needed();
|
||||
if (path == "/")
|
||||
|
@ -258,11 +258,11 @@ Icon FileIconProvider::icon_for_path(String const& path, mode_t mode)
|
|||
if (raw_symlink_target.is_null())
|
||||
return s_symlink_icon;
|
||||
|
||||
String target_path;
|
||||
DeprecatedString target_path;
|
||||
if (raw_symlink_target.starts_with('/')) {
|
||||
target_path = raw_symlink_target;
|
||||
} else {
|
||||
target_path = Core::File::real_path_for(String::formatted("{}/{}", LexicalPath::dirname(path), raw_symlink_target));
|
||||
target_path = Core::File::real_path_for(DeprecatedString::formatted("{}/{}", LexicalPath::dirname(path), raw_symlink_target));
|
||||
}
|
||||
auto target_icon = icon_for_path(target_path);
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@ namespace GUI {
|
|||
|
||||
class FileIconProvider {
|
||||
public:
|
||||
static Icon icon_for_path(String const&, mode_t);
|
||||
static Icon icon_for_path(String const&);
|
||||
static Icon icon_for_executable(String const&);
|
||||
static Icon icon_for_path(DeprecatedString const&, mode_t);
|
||||
static Icon icon_for_path(DeprecatedString const&);
|
||||
static Icon icon_for_executable(DeprecatedString const&);
|
||||
|
||||
static Icon filetype_image_icon();
|
||||
static Icon directory_icon();
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
Optional<String> FilePicker::get_open_filepath(Window* parent_window, String const& window_title, StringView path, bool folder, ScreenPosition screen_position)
|
||||
Optional<DeprecatedString> FilePicker::get_open_filepath(Window* parent_window, DeprecatedString const& window_title, StringView path, bool folder, ScreenPosition screen_position)
|
||||
{
|
||||
auto picker = FilePicker::construct(parent_window, folder ? Mode::OpenFolder : Mode::Open, ""sv, path, screen_position);
|
||||
|
||||
|
@ -40,7 +40,7 @@ Optional<String> FilePicker::get_open_filepath(Window* parent_window, String con
|
|||
picker->set_title(window_title);
|
||||
|
||||
if (picker->exec() == ExecResult::OK) {
|
||||
String file_path = picker->selected_file();
|
||||
DeprecatedString file_path = picker->selected_file();
|
||||
|
||||
if (file_path.is_null())
|
||||
return {};
|
||||
|
@ -50,12 +50,12 @@ Optional<String> FilePicker::get_open_filepath(Window* parent_window, String con
|
|||
return {};
|
||||
}
|
||||
|
||||
Optional<String> FilePicker::get_save_filepath(Window* parent_window, String const& title, String const& extension, StringView path, ScreenPosition screen_position)
|
||||
Optional<DeprecatedString> FilePicker::get_save_filepath(Window* parent_window, DeprecatedString const& title, DeprecatedString const& extension, StringView path, ScreenPosition screen_position)
|
||||
{
|
||||
auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension), path, screen_position);
|
||||
auto picker = FilePicker::construct(parent_window, Mode::Save, DeprecatedString::formatted("{}.{}", title, extension), path, screen_position);
|
||||
|
||||
if (picker->exec() == ExecResult::OK) {
|
||||
String file_path = picker->selected_file();
|
||||
DeprecatedString file_path = picker->selected_file();
|
||||
|
||||
if (file_path.is_null())
|
||||
return {};
|
||||
|
@ -115,7 +115,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
|
|||
|
||||
auto open_parent_directory_action = Action::create(
|
||||
"Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open-parent-directory.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) {
|
||||
set_path(String::formatted("{}/..", m_model->root_path()));
|
||||
set_path(DeprecatedString::formatted("{}/..", m_model->root_path()));
|
||||
},
|
||||
this);
|
||||
toolbar.add_action(*open_parent_directory_action);
|
||||
|
@ -129,12 +129,12 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
|
|||
|
||||
auto mkdir_action = Action::create(
|
||||
"New directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) {
|
||||
String value;
|
||||
DeprecatedString value;
|
||||
if (InputBox::show(this, value, "Enter name:"sv, "New directory"sv) == InputBox::ExecResult::OK && !value.is_empty()) {
|
||||
auto new_dir_path = LexicalPath::canonicalized_path(String::formatted("{}/{}", m_model->root_path(), value));
|
||||
auto new_dir_path = LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", m_model->root_path(), value));
|
||||
int rc = mkdir(new_dir_path.characters(), 0777);
|
||||
if (rc < 0) {
|
||||
MessageBox::show(this, String::formatted("mkdir(\"{}\") failed: {}", new_dir_path, strerror(errno)), "Error"sv, MessageBox::Type::Error);
|
||||
MessageBox::show(this, DeprecatedString::formatted("mkdir(\"{}\") failed: {}", new_dir_path, strerror(errno)), "Error"sv, MessageBox::Type::Error);
|
||||
} else {
|
||||
m_model->invalidate();
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
|
|||
};
|
||||
|
||||
m_model->on_directory_change_error = [&](int, char const* error_string) {
|
||||
m_error_label->set_text(String::formatted("Could not open {}:\n{}", m_model->root_path(), error_string));
|
||||
m_error_label->set_text(DeprecatedString::formatted("Could not open {}:\n{}", m_model->root_path(), error_string));
|
||||
m_view->set_active_widget(m_error_label);
|
||||
|
||||
m_view->view_as_icons_action().set_enabled(false);
|
||||
|
@ -239,7 +239,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
|
|||
m_view->view_as_columns_action().set_enabled(true);
|
||||
};
|
||||
|
||||
common_locations_tray.on_item_activation = [this](String const& path) {
|
||||
common_locations_tray.on_item_activation = [this](DeprecatedString const& path) {
|
||||
set_path(path);
|
||||
};
|
||||
for (auto& location : CommonLocationsProvider::common_locations()) {
|
||||
|
@ -271,7 +271,7 @@ void FilePicker::on_file_return()
|
|||
bool file_exists = Core::File::exists(path);
|
||||
|
||||
if (!file_exists && (m_mode == Mode::Open || m_mode == Mode::OpenFolder)) {
|
||||
MessageBox::show(this, String::formatted("No such file or directory: {}", m_filename_textbox->text()), "File not found"sv, MessageBox::Type::Error, MessageBox::InputType::OK);
|
||||
MessageBox::show(this, DeprecatedString::formatted("No such file or directory: {}", m_filename_textbox->text()), "File not found"sv, MessageBox::Type::Error, MessageBox::InputType::OK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -285,10 +285,10 @@ void FilePicker::on_file_return()
|
|||
done(ExecResult::OK);
|
||||
}
|
||||
|
||||
void FilePicker::set_path(String const& path)
|
||||
void FilePicker::set_path(DeprecatedString const& path)
|
||||
{
|
||||
if (access(path.characters(), R_OK | X_OK) == -1) {
|
||||
GUI::MessageBox::show(this, String::formatted("Could not open '{}':\n{}", path, strerror(errno)), "Error"sv, GUI::MessageBox::Type::Error);
|
||||
GUI::MessageBox::show(this, DeprecatedString::formatted("Could not open '{}':\n{}", path, strerror(errno)), "Error"sv, GUI::MessageBox::Type::Error);
|
||||
auto& common_locations_tray = *find_descendant_of_type_named<GUI::Tray>("common_locations_tray");
|
||||
for (auto& location_button : m_common_location_buttons)
|
||||
common_locations_tray.set_item_checked(location_button.tray_item_index, m_model->root_path() == location_button.path);
|
||||
|
|
|
@ -28,24 +28,24 @@ public:
|
|||
Save
|
||||
};
|
||||
|
||||
static Optional<String> get_open_filepath(Window* parent_window, String const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), bool folder = false, ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
static Optional<String> get_save_filepath(Window* parent_window, String const& title, String const& extension, StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
static Optional<DeprecatedString> get_open_filepath(Window* parent_window, DeprecatedString const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), bool folder = false, ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
static Optional<DeprecatedString> get_save_filepath(Window* parent_window, DeprecatedString const& title, DeprecatedString const& extension, StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
|
||||
virtual ~FilePicker() override;
|
||||
|
||||
String const& selected_file() const { return m_selected_file; }
|
||||
DeprecatedString const& selected_file() const { return m_selected_file; }
|
||||
|
||||
private:
|
||||
void on_file_return();
|
||||
|
||||
void set_path(String const&);
|
||||
void set_path(DeprecatedString const&);
|
||||
|
||||
// ^GUI::ModelClient
|
||||
virtual void model_did_update(unsigned) override;
|
||||
|
||||
FilePicker(Window* parent_window, Mode type = Mode::Open, StringView filename = "Untitled"sv, StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
|
||||
static String ok_button_name(Mode mode)
|
||||
static DeprecatedString ok_button_name(Mode mode)
|
||||
{
|
||||
switch (mode) {
|
||||
case Mode::Open:
|
||||
|
@ -60,13 +60,13 @@ private:
|
|||
}
|
||||
|
||||
struct CommonLocationButton {
|
||||
String path;
|
||||
DeprecatedString path;
|
||||
size_t tray_item_index { 0 };
|
||||
};
|
||||
|
||||
RefPtr<MultiView> m_view;
|
||||
NonnullRefPtr<FileSystemModel> m_model;
|
||||
String m_selected_file;
|
||||
DeprecatedString m_selected_file;
|
||||
|
||||
RefPtr<GUI::Label> m_error_label;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ ModelIndex FileSystemModel::Node::index(int column) const
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
bool FileSystemModel::Node::fetch_data(String const& full_path, bool is_root)
|
||||
bool FileSystemModel::Node::fetch_data(DeprecatedString const& full_path, bool is_root)
|
||||
{
|
||||
struct stat st;
|
||||
int rc;
|
||||
|
@ -104,7 +104,7 @@ void FileSystemModel::Node::traverse_if_needed()
|
|||
return;
|
||||
}
|
||||
|
||||
Vector<String> child_names;
|
||||
Vector<DeprecatedString> child_names;
|
||||
while (di.has_next()) {
|
||||
child_names.append(di.next_path());
|
||||
}
|
||||
|
@ -145,9 +145,9 @@ void FileSystemModel::Node::traverse_if_needed()
|
|||
}
|
||||
}
|
||||
|
||||
OwnPtr<FileSystemModel::Node> FileSystemModel::Node::create_child(String const& child_name)
|
||||
OwnPtr<FileSystemModel::Node> FileSystemModel::Node::create_child(DeprecatedString const& child_name)
|
||||
{
|
||||
String child_path = LexicalPath::join(full_path(), child_name).string();
|
||||
DeprecatedString child_path = LexicalPath::join(full_path(), child_name).string();
|
||||
auto child = adopt_own(*new Node(m_model));
|
||||
|
||||
bool ok = child->fetch_data(child_path, false);
|
||||
|
@ -180,9 +180,9 @@ bool FileSystemModel::Node::is_symlink_to_directory() const
|
|||
return S_ISDIR(st.st_mode);
|
||||
}
|
||||
|
||||
String FileSystemModel::Node::full_path() const
|
||||
DeprecatedString FileSystemModel::Node::full_path() const
|
||||
{
|
||||
Vector<String, 32> lineage;
|
||||
Vector<DeprecatedString, 32> lineage;
|
||||
for (auto* ancestor = m_parent; ancestor; ancestor = ancestor->m_parent) {
|
||||
lineage.append(ancestor->name);
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ String FileSystemModel::Node::full_path() const
|
|||
return LexicalPath::canonicalized_path(builder.to_string());
|
||||
}
|
||||
|
||||
ModelIndex FileSystemModel::index(String path, int column) const
|
||||
ModelIndex FileSystemModel::index(DeprecatedString path, int column) const
|
||||
{
|
||||
auto node = node_for_path(move(path));
|
||||
if (node.has_value())
|
||||
|
@ -206,9 +206,9 @@ ModelIndex FileSystemModel::index(String path, int column) const
|
|||
return {};
|
||||
}
|
||||
|
||||
Optional<FileSystemModel::Node const&> FileSystemModel::node_for_path(String const& path) const
|
||||
Optional<FileSystemModel::Node const&> FileSystemModel::node_for_path(DeprecatedString const& path) const
|
||||
{
|
||||
String resolved_path;
|
||||
DeprecatedString resolved_path;
|
||||
if (path == m_root_path)
|
||||
resolved_path = "/";
|
||||
else if (!m_root_path.is_empty() && path.starts_with(m_root_path))
|
||||
|
@ -241,14 +241,14 @@ Optional<FileSystemModel::Node const&> FileSystemModel::node_for_path(String con
|
|||
return {};
|
||||
}
|
||||
|
||||
String FileSystemModel::full_path(ModelIndex const& index) const
|
||||
DeprecatedString FileSystemModel::full_path(ModelIndex const& index) const
|
||||
{
|
||||
auto& node = this->node(index);
|
||||
const_cast<Node&>(node).reify_if_needed();
|
||||
return node.full_path();
|
||||
}
|
||||
|
||||
FileSystemModel::FileSystemModel(String root_path, Mode mode)
|
||||
FileSystemModel::FileSystemModel(DeprecatedString root_path, Mode mode)
|
||||
: m_root_path(LexicalPath::canonicalized_path(move(root_path)))
|
||||
, m_mode(mode)
|
||||
{
|
||||
|
@ -276,23 +276,23 @@ FileSystemModel::FileSystemModel(String root_path, Mode mode)
|
|||
invalidate();
|
||||
}
|
||||
|
||||
String FileSystemModel::name_for_uid(uid_t uid) const
|
||||
DeprecatedString FileSystemModel::name_for_uid(uid_t uid) const
|
||||
{
|
||||
auto it = m_user_names.find(uid);
|
||||
if (it == m_user_names.end())
|
||||
return String::number(uid);
|
||||
return DeprecatedString::number(uid);
|
||||
return (*it).value;
|
||||
}
|
||||
|
||||
String FileSystemModel::name_for_gid(gid_t gid) const
|
||||
DeprecatedString FileSystemModel::name_for_gid(gid_t gid) const
|
||||
{
|
||||
auto it = m_group_names.find(gid);
|
||||
if (it == m_group_names.end())
|
||||
return String::number(gid);
|
||||
return DeprecatedString::number(gid);
|
||||
return (*it).value;
|
||||
}
|
||||
|
||||
static String permission_string(mode_t mode)
|
||||
static DeprecatedString permission_string(mode_t mode)
|
||||
{
|
||||
StringBuilder builder;
|
||||
if (S_ISDIR(mode))
|
||||
|
@ -341,7 +341,7 @@ void FileSystemModel::update_node_on_selection(ModelIndex const& index, bool con
|
|||
node.set_selected(selected);
|
||||
}
|
||||
|
||||
void FileSystemModel::set_root_path(String root_path)
|
||||
void FileSystemModel::set_root_path(DeprecatedString root_path)
|
||||
{
|
||||
if (root_path.is_null())
|
||||
m_root_path = {};
|
||||
|
@ -629,7 +629,7 @@ Icon FileSystemModel::icon_for(Node const& node) const
|
|||
return FileIconProvider::icon_for_path(node.full_path(), node.mode);
|
||||
}
|
||||
|
||||
static HashMap<String, RefPtr<Gfx::Bitmap>> s_thumbnail_cache;
|
||||
static HashMap<DeprecatedString, RefPtr<Gfx::Bitmap>> s_thumbnail_cache;
|
||||
|
||||
static ErrorOr<NonnullRefPtr<Gfx::Bitmap>> render_thumbnail(StringView path)
|
||||
{
|
||||
|
@ -702,7 +702,7 @@ int FileSystemModel::column_count(ModelIndex const&) const
|
|||
return Column::__Count;
|
||||
}
|
||||
|
||||
String FileSystemModel::column_name(int column) const
|
||||
DeprecatedString FileSystemModel::column_name(int column) const
|
||||
{
|
||||
switch (column) {
|
||||
case Column::Icon:
|
||||
|
@ -727,7 +727,7 @@ String FileSystemModel::column_name(int column) const
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
bool FileSystemModel::accepts_drag(ModelIndex const& index, Vector<String> const& mime_types) const
|
||||
bool FileSystemModel::accepts_drag(ModelIndex const& index, Vector<DeprecatedString> const& mime_types) const
|
||||
{
|
||||
if (!mime_types.contains_slow("text/uri-list"))
|
||||
return false;
|
||||
|
@ -761,7 +761,7 @@ void FileSystemModel::set_data(ModelIndex const& index, Variant const& data)
|
|||
VERIFY(is_editable(index));
|
||||
Node& node = const_cast<Node&>(this->node(index));
|
||||
auto dirname = LexicalPath::dirname(node.full_path());
|
||||
auto new_full_path = String::formatted("{}/{}", dirname, data.to_string());
|
||||
auto new_full_path = DeprecatedString::formatted("{}/{}", dirname, data.to_string());
|
||||
int rc = rename(node.full_path().characters(), new_full_path.characters());
|
||||
if (rc < 0) {
|
||||
if (on_rename_error)
|
||||
|
|
|
@ -46,8 +46,8 @@ public:
|
|||
struct Node {
|
||||
~Node() = default;
|
||||
|
||||
String name;
|
||||
String symlink_target;
|
||||
DeprecatedString name;
|
||||
DeprecatedString symlink_target;
|
||||
size_t size { 0 };
|
||||
mode_t mode { 0 };
|
||||
uid_t uid { 0 };
|
||||
|
@ -70,7 +70,7 @@ public:
|
|||
int error() const { return m_error; }
|
||||
char const* error_string() const { return strerror(m_error); }
|
||||
|
||||
String full_path() const;
|
||||
DeprecatedString full_path() const;
|
||||
|
||||
private:
|
||||
friend class FileSystemModel;
|
||||
|
@ -94,21 +94,21 @@ public:
|
|||
ModelIndex index(int column) const;
|
||||
void traverse_if_needed();
|
||||
void reify_if_needed();
|
||||
bool fetch_data(String const& full_path, bool is_root);
|
||||
bool fetch_data(DeprecatedString const& full_path, bool is_root);
|
||||
|
||||
OwnPtr<Node> create_child(String const& child_name);
|
||||
OwnPtr<Node> create_child(DeprecatedString const& child_name);
|
||||
};
|
||||
|
||||
static NonnullRefPtr<FileSystemModel> create(String root_path = "/", Mode mode = Mode::FilesAndDirectories)
|
||||
static NonnullRefPtr<FileSystemModel> create(DeprecatedString root_path = "/", Mode mode = Mode::FilesAndDirectories)
|
||||
{
|
||||
return adopt_ref(*new FileSystemModel(root_path, mode));
|
||||
}
|
||||
virtual ~FileSystemModel() override = default;
|
||||
|
||||
String root_path() const { return m_root_path; }
|
||||
void set_root_path(String);
|
||||
String full_path(ModelIndex const&) const;
|
||||
ModelIndex index(String path, int column) const;
|
||||
DeprecatedString root_path() const { return m_root_path; }
|
||||
void set_root_path(DeprecatedString);
|
||||
DeprecatedString full_path(ModelIndex const&) const;
|
||||
ModelIndex index(DeprecatedString path, int column) const;
|
||||
|
||||
void update_node_on_selection(ModelIndex const&, bool const);
|
||||
ModelIndex m_previously_selected_index {};
|
||||
|
@ -119,18 +119,18 @@ public:
|
|||
Function<void()> on_complete;
|
||||
Function<void(int error, char const* error_string)> on_directory_change_error;
|
||||
Function<void(int error, char const* error_string)> on_rename_error;
|
||||
Function<void(String const& old_name, String const& new_name)> on_rename_successful;
|
||||
Function<void(DeprecatedString const& old_name, DeprecatedString const& new_name)> on_rename_successful;
|
||||
Function<void()> on_root_path_removed;
|
||||
|
||||
virtual int tree_column() const override { return Column::Name; }
|
||||
virtual int row_count(ModelIndex const& = ModelIndex()) const override;
|
||||
virtual int column_count(ModelIndex const& = ModelIndex()) const override;
|
||||
virtual String column_name(int column) const override;
|
||||
virtual DeprecatedString column_name(int column) const override;
|
||||
virtual Variant data(ModelIndex const&, ModelRole = ModelRole::Display) const override;
|
||||
virtual ModelIndex parent_index(ModelIndex const&) const override;
|
||||
virtual ModelIndex index(int row, int column = 0, ModelIndex const& parent = ModelIndex()) const override;
|
||||
virtual StringView drag_data_type() const override { return "text/uri-list"sv; }
|
||||
virtual bool accepts_drag(ModelIndex const&, Vector<String> const& mime_types) const override;
|
||||
virtual bool accepts_drag(ModelIndex const&, Vector<DeprecatedString> const& mime_types) const override;
|
||||
virtual bool is_column_sortable(int column_index) const override { return column_index != Column::Icon; }
|
||||
virtual bool is_editable(ModelIndex const&) const override;
|
||||
virtual bool is_searchable() const override { return true; }
|
||||
|
@ -138,7 +138,7 @@ public:
|
|||
virtual Vector<ModelIndex> matches(StringView, unsigned = MatchesFlag::AllMatching, ModelIndex const& = ModelIndex()) override;
|
||||
virtual void invalidate() override;
|
||||
|
||||
static String timestamp_string(time_t timestamp)
|
||||
static DeprecatedString timestamp_string(time_t timestamp)
|
||||
{
|
||||
return Core::DateTime::from_timestamp(timestamp).to_string();
|
||||
}
|
||||
|
@ -147,22 +147,22 @@ public:
|
|||
void set_should_show_dotfiles(bool);
|
||||
|
||||
private:
|
||||
FileSystemModel(String root_path, Mode);
|
||||
FileSystemModel(DeprecatedString root_path, Mode);
|
||||
|
||||
String name_for_uid(uid_t) const;
|
||||
String name_for_gid(gid_t) const;
|
||||
DeprecatedString name_for_uid(uid_t) const;
|
||||
DeprecatedString name_for_gid(gid_t) const;
|
||||
|
||||
Optional<Node const&> node_for_path(String const&) const;
|
||||
Optional<Node const&> node_for_path(DeprecatedString const&) const;
|
||||
|
||||
HashMap<uid_t, String> m_user_names;
|
||||
HashMap<gid_t, String> m_group_names;
|
||||
HashMap<uid_t, DeprecatedString> m_user_names;
|
||||
HashMap<gid_t, DeprecatedString> m_group_names;
|
||||
|
||||
bool fetch_thumbnail_for(Node const& node);
|
||||
GUI::Icon icon_for(Node const& node) const;
|
||||
|
||||
void handle_file_event(Core::FileWatcherEvent const& event);
|
||||
|
||||
String m_root_path;
|
||||
DeprecatedString m_root_path;
|
||||
Mode m_mode { Invalid };
|
||||
OwnPtr<Node> m_root { nullptr };
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ int FilteringProxyModel::column_count(ModelIndex const& index) const
|
|||
return m_model->column_count(m_matching_indices[index.row()]);
|
||||
}
|
||||
|
||||
String FilteringProxyModel::column_name(int column) const
|
||||
DeprecatedString FilteringProxyModel::column_name(int column) const
|
||||
{
|
||||
return m_model->column_name(column);
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/TextBox.h>
|
||||
|
||||
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
virtual int row_count(ModelIndex const& = ModelIndex()) const override;
|
||||
virtual int column_count(ModelIndex const& = ModelIndex()) const override;
|
||||
virtual String column_name(int) const override;
|
||||
virtual DeprecatedString column_name(int) const override;
|
||||
virtual Variant data(ModelIndex const&, ModelRole = ModelRole::Display) const override;
|
||||
virtual void invalidate() override;
|
||||
virtual ModelIndex index(int row, int column = 0, ModelIndex const& parent = ModelIndex()) const override;
|
||||
|
@ -56,7 +56,7 @@ private:
|
|||
// Maps row to actual model index.
|
||||
Vector<ModelIndex> m_matching_indices;
|
||||
|
||||
String m_filter_term;
|
||||
DeprecatedString m_filter_term;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -31,11 +31,11 @@ FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, boo
|
|||
VERIFY_NOT_REACHED();
|
||||
|
||||
m_family_list_view = *widget.find_descendant_of_type_named<ListView>("family_list_view");
|
||||
m_family_list_view->set_model(ItemListModel<String>::create(m_families));
|
||||
m_family_list_view->set_model(ItemListModel<DeprecatedString>::create(m_families));
|
||||
m_family_list_view->horizontal_scrollbar().set_visible(false);
|
||||
|
||||
m_variant_list_view = *widget.find_descendant_of_type_named<ListView>("variant_list_view");
|
||||
m_variant_list_view->set_model(ItemListModel<String>::create(m_variants));
|
||||
m_variant_list_view->set_model(ItemListModel<DeprecatedString>::create(m_variants));
|
||||
m_variant_list_view->horizontal_scrollbar().set_visible(false);
|
||||
|
||||
m_size_spin_box = *widget.find_descendant_of_type_named<SpinBox>("size_spin_box");
|
||||
|
|
|
@ -37,12 +37,12 @@ private:
|
|||
RefPtr<SpinBox> m_size_spin_box;
|
||||
RefPtr<Label> m_sample_text_label;
|
||||
|
||||
Vector<String> m_families;
|
||||
Vector<String> m_variants;
|
||||
Vector<DeprecatedString> m_families;
|
||||
Vector<DeprecatedString> m_variants;
|
||||
Vector<int> m_sizes;
|
||||
|
||||
Optional<String> m_family;
|
||||
Optional<String> m_variant;
|
||||
Optional<DeprecatedString> m_family;
|
||||
Optional<DeprecatedString> m_variant;
|
||||
Optional<int> m_size;
|
||||
};
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Concepts.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Error.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/HashMap.h>
|
||||
|
@ -17,7 +18,6 @@
|
|||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/TypeCasts.h>
|
||||
#include <LibGUI/GML/Lexer.h>
|
||||
|
@ -37,7 +37,7 @@ public:
|
|||
return try_make_ref_counted<NodeT>(token.m_view);
|
||||
}
|
||||
|
||||
String to_string() const
|
||||
DeprecatedString to_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
format(builder, 0, false);
|
||||
|
@ -66,7 +66,7 @@ public:
|
|||
// Single line comments with //.
|
||||
class Comment : public Node {
|
||||
public:
|
||||
Comment(String text)
|
||||
Comment(DeprecatedString text)
|
||||
: m_text(move(text))
|
||||
{
|
||||
}
|
||||
|
@ -84,13 +84,13 @@ public:
|
|||
virtual ~Comment() override = default;
|
||||
|
||||
private:
|
||||
String m_text {};
|
||||
DeprecatedString m_text {};
|
||||
};
|
||||
|
||||
// Any JSON-like key: value pair.
|
||||
class KeyValuePair : public Node {
|
||||
public:
|
||||
KeyValuePair(String key, NonnullRefPtr<ValueNode> value)
|
||||
KeyValuePair(DeprecatedString key, NonnullRefPtr<ValueNode> value)
|
||||
: m_key(move(key))
|
||||
, m_value(move(value))
|
||||
{
|
||||
|
@ -106,11 +106,11 @@ public:
|
|||
builder.append('\n');
|
||||
}
|
||||
|
||||
String key() const { return m_key; }
|
||||
DeprecatedString key() const { return m_key; }
|
||||
NonnullRefPtr<ValueNode> value() const { return m_value; }
|
||||
|
||||
private:
|
||||
String m_key;
|
||||
DeprecatedString m_key;
|
||||
NonnullRefPtr<ValueNode> m_value;
|
||||
};
|
||||
|
||||
|
@ -153,7 +153,7 @@ public:
|
|||
class Object : public ValueNode {
|
||||
public:
|
||||
Object() = default;
|
||||
Object(String name, NonnullRefPtrVector<Node> properties, NonnullRefPtrVector<Node> sub_objects)
|
||||
Object(DeprecatedString name, NonnullRefPtrVector<Node> properties, NonnullRefPtrVector<Node> sub_objects)
|
||||
: m_properties(move(properties))
|
||||
, m_sub_objects(move(sub_objects))
|
||||
, m_name(move(name))
|
||||
|
@ -163,7 +163,7 @@ public:
|
|||
virtual ~Object() override = default;
|
||||
|
||||
StringView name() const { return m_name; }
|
||||
void set_name(String name) { m_name = move(name); }
|
||||
void set_name(DeprecatedString name) { m_name = move(name); }
|
||||
|
||||
ErrorOr<void> add_sub_object_child(NonnullRefPtr<Node> child)
|
||||
{
|
||||
|
@ -279,7 +279,7 @@ private:
|
|||
NonnullRefPtrVector<Node> m_properties;
|
||||
// Sub objects and comments
|
||||
NonnullRefPtrVector<Node> m_sub_objects;
|
||||
String m_name {};
|
||||
DeprecatedString m_name {};
|
||||
};
|
||||
|
||||
class GMLFile : public Node {
|
||||
|
|
|
@ -25,8 +25,8 @@ void AutocompleteProvider::provide_completions(Function<void(Vector<CodeComprehe
|
|||
InIdentifier,
|
||||
AfterIdentifier, // Can we introspect this?
|
||||
} state { Free };
|
||||
String identifier_string;
|
||||
Vector<String> class_names;
|
||||
DeprecatedString identifier_string;
|
||||
Vector<DeprecatedString> class_names;
|
||||
Vector<State> previous_states;
|
||||
bool should_push_state { true };
|
||||
Token* last_seen_token { nullptr };
|
||||
|
@ -123,21 +123,21 @@ void AutocompleteProvider::provide_completions(Function<void(Vector<CodeComprehe
|
|||
|
||||
Vector<CodeComprehension::AutocompleteResultEntry> class_entries, identifier_entries;
|
||||
|
||||
auto register_layouts_matching_pattern = [&](String pattern, size_t partial_input_length) {
|
||||
auto register_layouts_matching_pattern = [&](DeprecatedString pattern, size_t partial_input_length) {
|
||||
Core::ObjectClassRegistration::for_each([&](const Core::ObjectClassRegistration& registration) {
|
||||
if (registration.is_derived_from(layout_class) && ®istration != &layout_class && registration.class_name().matches(pattern))
|
||||
class_entries.empend(String::formatted("@{}", registration.class_name()), partial_input_length);
|
||||
class_entries.empend(DeprecatedString::formatted("@{}", registration.class_name()), partial_input_length);
|
||||
});
|
||||
};
|
||||
|
||||
auto register_widgets_matching_pattern = [&](String pattern, size_t partial_input_length) {
|
||||
auto register_widgets_matching_pattern = [&](DeprecatedString pattern, size_t partial_input_length) {
|
||||
Core::ObjectClassRegistration::for_each([&](const Core::ObjectClassRegistration& registration) {
|
||||
if (registration.is_derived_from(widget_class) && registration.class_name().matches(pattern))
|
||||
class_entries.empend(String::formatted("@{}", registration.class_name()), partial_input_length);
|
||||
class_entries.empend(DeprecatedString::formatted("@{}", registration.class_name()), partial_input_length);
|
||||
});
|
||||
};
|
||||
|
||||
auto register_class_properties_matching_pattern = [&](String pattern, size_t partial_input_length) {
|
||||
auto register_class_properties_matching_pattern = [&](DeprecatedString pattern, size_t partial_input_length) {
|
||||
auto class_name = class_names.last();
|
||||
|
||||
// FIXME: Don't show properties that are already specified in the scope.
|
||||
|
@ -146,7 +146,7 @@ void AutocompleteProvider::provide_completions(Function<void(Vector<CodeComprehe
|
|||
if (auto instance = registration->construct()) {
|
||||
for (auto& it : instance->properties()) {
|
||||
if (!it.value->is_readonly() && it.key.matches(pattern))
|
||||
identifier_entries.empend(String::formatted("{}: ", it.key), partial_input_length, CodeComprehension::Language::Unspecified, it.key);
|
||||
identifier_entries.empend(DeprecatedString::formatted("{}: ", it.key), partial_input_length, CodeComprehension::Language::Unspecified, it.key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ void AutocompleteProvider::provide_completions(Function<void(Vector<CodeComprehe
|
|||
identifier_entries.empend("content_widget: ", partial_input_length, CodeComprehension::Language::Unspecified, "content_widget", CodeComprehension::AutocompleteResultEntry::HideAutocompleteAfterApplying::No);
|
||||
};
|
||||
|
||||
auto register_properties_and_widgets_matching_pattern = [&](String pattern, size_t partial_input_length) {
|
||||
auto register_properties_and_widgets_matching_pattern = [&](DeprecatedString pattern, size_t partial_input_length) {
|
||||
if (!class_names.is_empty()) {
|
||||
register_class_properties_matching_pattern(pattern, partial_input_length);
|
||||
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibGUI/GML/AST.h>
|
||||
#include <LibGUI/GML/Parser.h>
|
||||
|
||||
namespace GUI::GML {
|
||||
|
||||
inline ErrorOr<String> format_gml(StringView string)
|
||||
inline ErrorOr<DeprecatedString> format_gml(StringView string)
|
||||
{
|
||||
return TRY(parse_gml(string))->to_string();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class GroupBox : public Widget {
|
|||
public:
|
||||
virtual ~GroupBox() override = default;
|
||||
|
||||
String title() const { return m_title; }
|
||||
DeprecatedString title() const { return m_title; }
|
||||
void set_title(StringView);
|
||||
virtual Margins content_margins() const override;
|
||||
|
||||
|
@ -27,7 +27,7 @@ protected:
|
|||
virtual void fonts_change_event(FontsChangeEvent&) override;
|
||||
|
||||
private:
|
||||
String m_title;
|
||||
DeprecatedString m_title;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -304,7 +304,7 @@ void HeaderView::paint_vertical(Painter& painter)
|
|||
bool pressed = section == m_pressed_section && m_pressed_section_is_pressed;
|
||||
bool hovered = false;
|
||||
Gfx::StylePainter::paint_button(painter, cell_rect, palette(), Gfx::ButtonStyle::Normal, pressed, hovered);
|
||||
String text = String::number(section);
|
||||
DeprecatedString text = DeprecatedString::number(section);
|
||||
auto text_rect = cell_rect.shrunken(m_table_view.horizontal_padding() * 2, 0);
|
||||
if (pressed)
|
||||
text_rect.translate_by(1, 1);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <LibGUI/Icon.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
|
||||
|
@ -82,9 +82,9 @@ ErrorOr<Icon> Icon::try_create_default_icon(StringView name)
|
|||
{
|
||||
RefPtr<Gfx::Bitmap> bitmap16;
|
||||
RefPtr<Gfx::Bitmap> bitmap32;
|
||||
if (auto bitmap_or_error = Gfx::Bitmap::try_load_from_file(String::formatted("/res/icons/16x16/{}.png", name)); !bitmap_or_error.is_error())
|
||||
if (auto bitmap_or_error = Gfx::Bitmap::try_load_from_file(DeprecatedString::formatted("/res/icons/16x16/{}.png", name)); !bitmap_or_error.is_error())
|
||||
bitmap16 = bitmap_or_error.release_value();
|
||||
if (auto bitmap_or_error = Gfx::Bitmap::try_load_from_file(String::formatted("/res/icons/32x32/{}.png", name)); !bitmap_or_error.is_error())
|
||||
if (auto bitmap_or_error = Gfx::Bitmap::try_load_from_file(DeprecatedString::formatted("/res/icons/32x32/{}.png", name)); !bitmap_or_error.is_error())
|
||||
bitmap32 = bitmap_or_error.release_value();
|
||||
|
||||
if (!bitmap16 && !bitmap32) {
|
||||
|
|
|
@ -70,7 +70,7 @@ private:
|
|||
Gfx::IntRect icon_rect;
|
||||
int icon_offset_y;
|
||||
int text_offset_y;
|
||||
String text;
|
||||
DeprecatedString text;
|
||||
Vector<StringView> wrapped_text_lines;
|
||||
ModelIndex index;
|
||||
bool valid { false };
|
||||
|
|
|
@ -93,7 +93,7 @@ void IncrementalSearchBanner::search(TextEditor::SearchDirection direction)
|
|||
auto needle = m_search_textbox->text();
|
||||
if (needle.is_empty()) {
|
||||
m_editor->reset_search_results();
|
||||
m_index_label->set_text(String::empty());
|
||||
m_index_label->set_text(DeprecatedString::empty());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -107,9 +107,9 @@ void IncrementalSearchBanner::search(TextEditor::SearchDirection direction)
|
|||
auto result = m_editor->find_text(needle, direction, m_wrap_search, false, m_match_case);
|
||||
index = m_editor->search_result_index().value_or(0) + 1;
|
||||
if (result.is_valid())
|
||||
m_index_label->set_text(String::formatted("{} of {}", index, m_editor->search_results().size()));
|
||||
m_index_label->set_text(DeprecatedString::formatted("{} of {}", index, m_editor->search_results().size()));
|
||||
else
|
||||
m_index_label->set_text(String::empty());
|
||||
m_index_label->set_text(DeprecatedString::empty());
|
||||
}
|
||||
|
||||
void IncrementalSearchBanner::paint_event(PaintEvent& event)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
InputBox::InputBox(Window* parent_window, String text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type)
|
||||
InputBox::InputBox(Window* parent_window, DeprecatedString text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type)
|
||||
: Dialog(parent_window)
|
||||
, m_text_value(move(text_value))
|
||||
, m_prompt(prompt)
|
||||
|
@ -25,7 +25,7 @@ InputBox::InputBox(Window* parent_window, String text_value, StringView prompt,
|
|||
build(input_type);
|
||||
}
|
||||
|
||||
Dialog::ExecResult InputBox::show(Window* parent_window, String& text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type)
|
||||
Dialog::ExecResult InputBox::show(Window* parent_window, DeprecatedString& text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type)
|
||||
{
|
||||
auto box = InputBox::construct(parent_window, text_value, prompt, title, placeholder, input_type);
|
||||
box->set_resizable(false);
|
||||
|
@ -36,7 +36,7 @@ Dialog::ExecResult InputBox::show(Window* parent_window, String& text_value, Str
|
|||
return result;
|
||||
}
|
||||
|
||||
void InputBox::set_text_value(String text_value)
|
||||
void InputBox::set_text_value(DeprecatedString text_value)
|
||||
{
|
||||
m_text_editor->set_text(move(text_value));
|
||||
}
|
||||
|
|
|
@ -22,20 +22,20 @@ class InputBox : public Dialog {
|
|||
public:
|
||||
virtual ~InputBox() override = default;
|
||||
|
||||
static ExecResult show(Window* parent_window, String& text_value, StringView prompt, StringView title, StringView placeholder = {}, InputType input_type = InputType::Text);
|
||||
static ExecResult show(Window* parent_window, DeprecatedString& text_value, StringView prompt, StringView title, StringView placeholder = {}, InputType input_type = InputType::Text);
|
||||
|
||||
String const& text_value() const { return m_text_value; }
|
||||
void set_text_value(String text_value);
|
||||
DeprecatedString const& text_value() const { return m_text_value; }
|
||||
void set_text_value(DeprecatedString text_value);
|
||||
|
||||
private:
|
||||
explicit InputBox(Window* parent_window, String text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type);
|
||||
explicit InputBox(Window* parent_window, DeprecatedString text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type);
|
||||
|
||||
virtual void on_done(ExecResult) override;
|
||||
void build(InputType input_type);
|
||||
|
||||
String m_text_value;
|
||||
String m_prompt;
|
||||
String m_placeholder;
|
||||
DeprecatedString m_text_value;
|
||||
DeprecatedString m_prompt;
|
||||
DeprecatedString m_placeholder;
|
||||
|
||||
RefPtr<Button> m_ok_button;
|
||||
RefPtr<Button> m_cancel_button;
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
return 1;
|
||||
}
|
||||
|
||||
virtual String column_name(int index) const override
|
||||
virtual DeprecatedString column_name(int index) const override
|
||||
{
|
||||
if constexpr (IsTwoDimensional)
|
||||
return m_column_names[index];
|
||||
|
|
|
@ -142,7 +142,7 @@ Variant JsonArrayModel::data(ModelIndex const& index, ModelRole role) const
|
|||
return {};
|
||||
}
|
||||
|
||||
void JsonArrayModel::set_json_path(String const& json_path)
|
||||
void JsonArrayModel::set_json_path(DeprecatedString const& json_path)
|
||||
{
|
||||
if (m_json_path == json_path)
|
||||
return;
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace GUI {
|
|||
class JsonArrayModel final : public Model {
|
||||
public:
|
||||
struct FieldSpec {
|
||||
FieldSpec(String const& a_column_name, Gfx::TextAlignment a_text_alignment, Function<Variant(JsonObject const&)>&& a_massage_for_display, Function<Variant(JsonObject const&)>&& a_massage_for_sort = {}, Function<Variant(JsonObject const&)>&& a_massage_for_custom = {})
|
||||
FieldSpec(DeprecatedString const& a_column_name, Gfx::TextAlignment a_text_alignment, Function<Variant(JsonObject const&)>&& a_massage_for_display, Function<Variant(JsonObject const&)>&& a_massage_for_sort = {}, Function<Variant(JsonObject const&)>&& a_massage_for_custom = {})
|
||||
: column_name(a_column_name)
|
||||
, text_alignment(a_text_alignment)
|
||||
, massage_for_display(move(a_massage_for_display))
|
||||
|
@ -25,22 +25,22 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
FieldSpec(String const& a_json_field_name, String const& a_column_name, Gfx::TextAlignment a_text_alignment)
|
||||
FieldSpec(DeprecatedString const& a_json_field_name, DeprecatedString const& a_column_name, Gfx::TextAlignment a_text_alignment)
|
||||
: json_field_name(a_json_field_name)
|
||||
, column_name(a_column_name)
|
||||
, text_alignment(a_text_alignment)
|
||||
{
|
||||
}
|
||||
|
||||
String json_field_name;
|
||||
String column_name;
|
||||
DeprecatedString json_field_name;
|
||||
DeprecatedString column_name;
|
||||
Gfx::TextAlignment text_alignment;
|
||||
Function<Variant(JsonObject const&)> massage_for_display;
|
||||
Function<Variant(JsonObject const&)> massage_for_sort;
|
||||
Function<Variant(JsonObject const&)> massage_for_custom;
|
||||
};
|
||||
|
||||
static NonnullRefPtr<JsonArrayModel> create(String const& json_path, Vector<FieldSpec>&& fields)
|
||||
static NonnullRefPtr<JsonArrayModel> create(DeprecatedString const& json_path, Vector<FieldSpec>&& fields)
|
||||
{
|
||||
return adopt_ref(*new JsonArrayModel(json_path, move(fields)));
|
||||
}
|
||||
|
@ -49,13 +49,13 @@ public:
|
|||
|
||||
virtual int row_count(ModelIndex const& = ModelIndex()) const override { return m_array.size(); }
|
||||
virtual int column_count(ModelIndex const& = ModelIndex()) const override { return m_fields.size(); }
|
||||
virtual String column_name(int column) const override { return m_fields[column].column_name; }
|
||||
virtual DeprecatedString column_name(int column) const override { return m_fields[column].column_name; }
|
||||
virtual Variant data(ModelIndex const&, ModelRole = ModelRole::Display) const override;
|
||||
virtual void invalidate() override;
|
||||
virtual void update();
|
||||
|
||||
String const& json_path() const { return m_json_path; }
|
||||
void set_json_path(String const& json_path);
|
||||
DeprecatedString const& json_path() const { return m_json_path; }
|
||||
void set_json_path(DeprecatedString const& json_path);
|
||||
|
||||
bool add(Vector<JsonValue> const&& fields);
|
||||
bool set(int row, Vector<JsonValue>&& fields);
|
||||
|
@ -63,13 +63,13 @@ public:
|
|||
bool store();
|
||||
|
||||
private:
|
||||
JsonArrayModel(String const& json_path, Vector<FieldSpec>&& fields)
|
||||
JsonArrayModel(DeprecatedString const& json_path, Vector<FieldSpec>&& fields)
|
||||
: m_json_path(json_path)
|
||||
, m_fields(move(fields))
|
||||
{
|
||||
}
|
||||
|
||||
String m_json_path;
|
||||
DeprecatedString m_json_path;
|
||||
Vector<FieldSpec> m_fields;
|
||||
JsonArray m_array;
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ REGISTER_WIDGET(GUI, Label)
|
|||
|
||||
namespace GUI {
|
||||
|
||||
Label::Label(String text)
|
||||
Label::Label(DeprecatedString text)
|
||||
: m_text(move(text))
|
||||
{
|
||||
REGISTER_TEXT_ALIGNMENT_PROPERTY("text_alignment", text_alignment, set_text_alignment);
|
||||
|
@ -55,7 +55,7 @@ void Label::set_icon(Gfx::Bitmap const* icon)
|
|||
update();
|
||||
}
|
||||
|
||||
void Label::set_icon_from_path(String const& path)
|
||||
void Label::set_icon_from_path(DeprecatedString const& path)
|
||||
{
|
||||
auto maybe_bitmap = Gfx::Bitmap::try_load_from_file(path);
|
||||
if (maybe_bitmap.is_error()) {
|
||||
|
@ -65,7 +65,7 @@ void Label::set_icon_from_path(String const& path)
|
|||
set_icon(maybe_bitmap.release_value());
|
||||
}
|
||||
|
||||
void Label::set_text(String text)
|
||||
void Label::set_text(DeprecatedString text)
|
||||
{
|
||||
if (text == m_text)
|
||||
return;
|
||||
|
|
|
@ -19,11 +19,11 @@ class Label : public Frame {
|
|||
public:
|
||||
virtual ~Label() override = default;
|
||||
|
||||
String text() const { return m_text; }
|
||||
void set_text(String);
|
||||
DeprecatedString text() const { return m_text; }
|
||||
void set_text(DeprecatedString);
|
||||
|
||||
void set_icon(Gfx::Bitmap const*);
|
||||
void set_icon_from_path(String const&);
|
||||
void set_icon_from_path(DeprecatedString const&);
|
||||
Gfx::Bitmap const* icon() const { return m_icon.ptr(); }
|
||||
Gfx::Bitmap* icon() { return m_icon.ptr(); }
|
||||
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
Gfx::IntRect text_rect() const;
|
||||
|
||||
protected:
|
||||
explicit Label(String text = {});
|
||||
explicit Label(DeprecatedString text = {});
|
||||
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
virtual void did_change_text() { }
|
||||
|
@ -53,7 +53,7 @@ protected:
|
|||
private:
|
||||
void size_to_fit();
|
||||
|
||||
String m_text;
|
||||
DeprecatedString m_text;
|
||||
RefPtr<Gfx::Bitmap> m_icon;
|
||||
Gfx::TextAlignment m_text_alignment { Gfx::TextAlignment::Center };
|
||||
Gfx::TextWrapping m_text_wrapping { Gfx::TextWrapping::Wrap };
|
||||
|
|
|
@ -19,7 +19,7 @@ REGISTER_WIDGET(GUI, LinkLabel)
|
|||
|
||||
namespace GUI {
|
||||
|
||||
LinkLabel::LinkLabel(String text)
|
||||
LinkLabel::LinkLabel(DeprecatedString text)
|
||||
: Label(move(text))
|
||||
{
|
||||
set_foreground_role(Gfx::ColorRole::Link);
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
Function<void()> on_click;
|
||||
|
||||
private:
|
||||
explicit LinkLabel(String text = {});
|
||||
explicit LinkLabel(DeprecatedString text = {});
|
||||
|
||||
virtual void mousemove_event(MouseEvent&) override;
|
||||
virtual void mousedown_event(MouseEvent&) override;
|
||||
|
|
|
@ -32,7 +32,7 @@ Menu* Menu::from_menu_id(int menu_id)
|
|||
return (*it).value;
|
||||
}
|
||||
|
||||
Menu::Menu(String name)
|
||||
Menu::Menu(DeprecatedString name)
|
||||
: m_name(move(name))
|
||||
{
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ void Menu::remove_all_actions()
|
|||
m_items.clear();
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Menu>> Menu::try_add_submenu(String name)
|
||||
ErrorOr<NonnullRefPtr<Menu>> Menu::try_add_submenu(DeprecatedString name)
|
||||
{
|
||||
// NOTE: We grow the vector first, to get allocation failure handled immediately.
|
||||
TRY(m_items.try_ensure_capacity(m_items.size() + 1));
|
||||
|
@ -87,7 +87,7 @@ ErrorOr<NonnullRefPtr<Menu>> Menu::try_add_submenu(String name)
|
|||
return submenu;
|
||||
}
|
||||
|
||||
Menu& Menu::add_submenu(String name)
|
||||
Menu& Menu::add_submenu(DeprecatedString name)
|
||||
{
|
||||
auto menu = MUST(try_add_submenu(move(name)));
|
||||
return menu;
|
||||
|
@ -197,7 +197,7 @@ void Menu::realize_menu_item(MenuItem& item, int item_id)
|
|||
break;
|
||||
case MenuItem::Type::Action: {
|
||||
auto& action = *item.action();
|
||||
auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : String();
|
||||
auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : DeprecatedString();
|
||||
bool exclusive = action.group() && action.group()->is_exclusive() && action.is_checkable();
|
||||
bool is_default = (m_current_default_action.ptr() == &action);
|
||||
auto icon = action.icon() ? action.icon()->to_shareable_bitmap() : Gfx::ShareableBitmap();
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
static Menu* from_menu_id(int);
|
||||
int menu_id() const { return m_menu_id; }
|
||||
|
||||
String const& name() const { return m_name; }
|
||||
DeprecatedString const& name() const { return m_name; }
|
||||
Gfx::Bitmap const* icon() const { return m_icon.ptr(); }
|
||||
void set_icon(Gfx::Bitmap const*);
|
||||
|
||||
|
@ -41,11 +41,11 @@ public:
|
|||
|
||||
ErrorOr<void> try_add_action(NonnullRefPtr<Action>);
|
||||
ErrorOr<void> try_add_separator();
|
||||
ErrorOr<NonnullRefPtr<Menu>> try_add_submenu(String name);
|
||||
ErrorOr<NonnullRefPtr<Menu>> try_add_submenu(DeprecatedString name);
|
||||
|
||||
void add_action(NonnullRefPtr<Action>);
|
||||
void add_separator();
|
||||
Menu& add_submenu(String name);
|
||||
Menu& add_submenu(DeprecatedString name);
|
||||
void remove_all_actions();
|
||||
|
||||
void popup(Gfx::IntPoint const& screen_position, RefPtr<Action> const& default_action = nullptr, Gfx::IntRect const& button_rect = {});
|
||||
|
@ -64,7 +64,7 @@ public:
|
|||
private:
|
||||
friend class Menubar;
|
||||
|
||||
explicit Menu(String name = "");
|
||||
explicit Menu(DeprecatedString name = "");
|
||||
|
||||
int realize_menu(RefPtr<Action> default_action = nullptr);
|
||||
void unrealize_menu();
|
||||
|
@ -73,7 +73,7 @@ private:
|
|||
void realize_menu_item(MenuItem&, int item_id);
|
||||
|
||||
int m_menu_id { -1 };
|
||||
String m_name;
|
||||
DeprecatedString m_name;
|
||||
RefPtr<Gfx::Bitmap> m_icon;
|
||||
NonnullOwnPtrVector<MenuItem> m_items;
|
||||
WeakPtr<Action> m_current_default_action;
|
||||
|
|
|
@ -73,7 +73,7 @@ void MenuItem::update_window_server()
|
|||
if (m_menu_id < 0)
|
||||
return;
|
||||
auto& action = *m_action;
|
||||
auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : String();
|
||||
auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : DeprecatedString();
|
||||
auto icon = action.icon() ? action.icon()->to_shareable_bitmap() : Gfx::ShareableBitmap();
|
||||
ConnectionToWindowServer::the().async_update_menu_item(m_menu_id, m_identifier, -1, action.text(), action.is_enabled(), action.is_checkable(), action.is_checkable() ? action.is_checked() : false, m_default, shortcut_text, icon);
|
||||
}
|
||||
|
|
|
@ -16,14 +16,14 @@ ErrorOr<void> Menubar::try_add_menu(Badge<Window>, NonnullRefPtr<Menu> menu)
|
|||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Menu>> Menubar::try_add_menu(Badge<Window>, String name)
|
||||
ErrorOr<NonnullRefPtr<Menu>> Menubar::try_add_menu(Badge<Window>, DeprecatedString name)
|
||||
{
|
||||
auto menu = TRY(try_add<Menu>(move(name)));
|
||||
TRY(m_menus.try_append(menu));
|
||||
return menu;
|
||||
}
|
||||
|
||||
Menu& Menubar::add_menu(Badge<Window>, String name)
|
||||
Menu& Menubar::add_menu(Badge<Window>, DeprecatedString name)
|
||||
{
|
||||
auto& menu = add<Menu>(move(name));
|
||||
m_menus.append(menu);
|
||||
|
|
|
@ -24,8 +24,8 @@ public:
|
|||
virtual ~Menubar() override = default;
|
||||
|
||||
ErrorOr<void> try_add_menu(Badge<Window>, NonnullRefPtr<Menu>);
|
||||
ErrorOr<NonnullRefPtr<Menu>> try_add_menu(Badge<Window>, String name);
|
||||
Menu& add_menu(Badge<Window>, String name);
|
||||
ErrorOr<NonnullRefPtr<Menu>> try_add_menu(Badge<Window>, DeprecatedString name);
|
||||
Menu& add_menu(Badge<Window>, DeprecatedString name);
|
||||
|
||||
void for_each_menu(Function<IterationDecision(Menu&)>);
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ Dialog::ExecResult MessageBox::ask_about_unsaved_changes(Window* parent_window,
|
|||
return box->exec();
|
||||
}
|
||||
|
||||
void MessageBox::set_text(String text)
|
||||
void MessageBox::set_text(DeprecatedString text)
|
||||
{
|
||||
m_text = move(text);
|
||||
build();
|
||||
|
@ -151,7 +151,7 @@ void MessageBox::build()
|
|||
constexpr int button_width = 80;
|
||||
int button_count = 0;
|
||||
|
||||
auto add_button = [&](String label, ExecResult result) -> GUI::Button& {
|
||||
auto add_button = [&](DeprecatedString label, ExecResult result) -> GUI::Button& {
|
||||
auto& button = button_container.add<Button>();
|
||||
button.set_fixed_width(button_width);
|
||||
button.set_text(label);
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
static ExecResult show_error(Window* parent_window, StringView text);
|
||||
static ExecResult ask_about_unsaved_changes(Window* parent_window, StringView path, Optional<Time> last_unmodified_timestamp = {});
|
||||
|
||||
void set_text(String text);
|
||||
void set_text(DeprecatedString text);
|
||||
|
||||
private:
|
||||
explicit MessageBox(Window* parent_window, StringView text, StringView title, Type type = Type::None, InputType input_type = InputType::OK);
|
||||
|
@ -48,7 +48,7 @@ private:
|
|||
void build();
|
||||
RefPtr<Gfx::Bitmap> icon() const;
|
||||
|
||||
String m_text;
|
||||
DeprecatedString m_text;
|
||||
Type m_type { Type::None };
|
||||
InputType m_input_type { InputType::OK };
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ ModelIndex Model::index(int row, int column, ModelIndex const&) const
|
|||
return create_index(row, column);
|
||||
}
|
||||
|
||||
bool Model::accepts_drag(ModelIndex const&, Vector<String> const&) const
|
||||
bool Model::accepts_drag(ModelIndex const&, Vector<DeprecatedString> const&) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/HashTable.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/MimeData.h>
|
||||
#include <LibGUI/Forward.h>
|
||||
|
@ -65,7 +65,7 @@ public:
|
|||
|
||||
virtual int row_count(ModelIndex const& = ModelIndex()) const = 0;
|
||||
virtual int column_count(ModelIndex const& = ModelIndex()) const = 0;
|
||||
virtual String column_name(int) const { return {}; }
|
||||
virtual DeprecatedString column_name(int) const { return {}; }
|
||||
virtual Variant data(ModelIndex const&, ModelRole = ModelRole::Display) const = 0;
|
||||
virtual TriState data_matches(ModelIndex const&, Variant const&) const { return TriState::Unknown; }
|
||||
virtual void invalidate();
|
||||
|
@ -75,7 +75,7 @@ public:
|
|||
virtual bool is_searchable() const { return false; }
|
||||
virtual void set_data(ModelIndex const&, Variant const&) { }
|
||||
virtual int tree_column() const { return 0; }
|
||||
virtual bool accepts_drag(ModelIndex const&, Vector<String> const& mime_types) const;
|
||||
virtual bool accepts_drag(ModelIndex const&, Vector<DeprecatedString> const& mime_types) const;
|
||||
virtual Vector<ModelIndex> matches(StringView, unsigned = MatchesFlag::AllMatching, ModelIndex const& = ModelIndex()) { return {}; }
|
||||
|
||||
virtual bool is_column_sortable([[maybe_unused]] int column_index) const { return true; }
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/Variant.h>
|
||||
|
||||
|
|
|
@ -21,15 +21,15 @@ class Notification : public Core::Object {
|
|||
public:
|
||||
virtual ~Notification() override;
|
||||
|
||||
String const& text() const { return m_text; }
|
||||
void set_text(String const& text)
|
||||
DeprecatedString const& text() const { return m_text; }
|
||||
void set_text(DeprecatedString const& text)
|
||||
{
|
||||
m_text_dirty = true;
|
||||
m_text = text;
|
||||
}
|
||||
|
||||
String const& title() const { return m_title; }
|
||||
void set_title(String const& title)
|
||||
DeprecatedString const& title() const { return m_title; }
|
||||
void set_title(DeprecatedString const& title)
|
||||
{
|
||||
m_title_dirty = true;
|
||||
m_title = title;
|
||||
|
@ -53,9 +53,9 @@ private:
|
|||
|
||||
void connection_closed();
|
||||
|
||||
String m_title;
|
||||
DeprecatedString m_title;
|
||||
bool m_title_dirty;
|
||||
String m_text;
|
||||
DeprecatedString m_text;
|
||||
bool m_text_dirty;
|
||||
RefPtr<Gfx::Bitmap> m_icon;
|
||||
bool m_icon_dirty;
|
||||
|
|
|
@ -87,7 +87,7 @@ void OpacitySlider::paint_event(PaintEvent& event)
|
|||
painter.draw_line({ notch_x - 1, notch_y_top }, { notch_x - 1, notch_y_bottom }, Color(h, h, h, 255));
|
||||
|
||||
// Text label
|
||||
auto percent_text = String::formatted("{}%", (int)((float)value() / (float)max() * 100.0f));
|
||||
auto percent_text = DeprecatedString::formatted("{}%", (int)((float)value() / (float)max() * 100.0f));
|
||||
painter.draw_text(inner_rect.translated(1, 1), percent_text, Gfx::TextAlignment::Center, Color::Black);
|
||||
painter.draw_text(inner_rect, percent_text, Gfx::TextAlignment::Center, Color::White);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
PasswordInputDialog::PasswordInputDialog(Window* parent_window, String title, String server, String username)
|
||||
PasswordInputDialog::PasswordInputDialog(Window* parent_window, DeprecatedString title, DeprecatedString server, DeprecatedString username)
|
||||
: Dialog(parent_window)
|
||||
{
|
||||
if (parent_window)
|
||||
|
@ -60,7 +60,7 @@ PasswordInputDialog::PasswordInputDialog(Window* parent_window, String title, St
|
|||
password_box.set_focus(true);
|
||||
}
|
||||
|
||||
Dialog::ExecResult PasswordInputDialog::show(Window* parent_window, String& text_value, String title, String server, String username)
|
||||
Dialog::ExecResult PasswordInputDialog::show(Window* parent_window, DeprecatedString& text_value, DeprecatedString title, DeprecatedString server, DeprecatedString username)
|
||||
{
|
||||
auto box = PasswordInputDialog::construct(parent_window, move(title), move(server), move(username));
|
||||
auto result = box->exec();
|
||||
|
|
|
@ -17,12 +17,12 @@ class PasswordInputDialog : public Dialog {
|
|||
public:
|
||||
virtual ~PasswordInputDialog() override = default;
|
||||
|
||||
static ExecResult show(Window* parent_window, String& text_value, String title, String server, String username);
|
||||
static ExecResult show(Window* parent_window, DeprecatedString& text_value, DeprecatedString title, DeprecatedString server, DeprecatedString username);
|
||||
|
||||
private:
|
||||
explicit PasswordInputDialog(Window* parent_window, String title, String server, String username);
|
||||
explicit PasswordInputDialog(Window* parent_window, DeprecatedString title, DeprecatedString server, DeprecatedString username);
|
||||
|
||||
String m_password;
|
||||
DeprecatedString m_password;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -14,14 +14,14 @@ void spawn_or_show_error(GUI::Window* parent_window, StringView path, Span<Strin
|
|||
{
|
||||
auto spawn_result = Core::Process::spawn(path, arguments);
|
||||
if (spawn_result.is_error())
|
||||
GUI::MessageBox::show_error(parent_window, String::formatted("Failed to spawn {}: {}", path, spawn_result.error()));
|
||||
GUI::MessageBox::show_error(parent_window, DeprecatedString::formatted("Failed to spawn {}: {}", path, spawn_result.error()));
|
||||
}
|
||||
|
||||
namespace GUI {
|
||||
|
||||
void Process::spawn_or_show_error(Window* parent_window, StringView path, Span<String const> arguments)
|
||||
void Process::spawn_or_show_error(Window* parent_window, StringView path, Span<DeprecatedString const> arguments)
|
||||
{
|
||||
::spawn_or_show_error<String>(parent_window, path, arguments);
|
||||
::spawn_or_show_error<DeprecatedString>(parent_window, path, arguments);
|
||||
}
|
||||
|
||||
void Process::spawn_or_show_error(Window* parent_window, StringView path, Span<StringView const> arguments)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace GUI {
|
||||
|
||||
struct Process {
|
||||
static void spawn_or_show_error(Window* parent_window, StringView path, Span<String const> arguments);
|
||||
static void spawn_or_show_error(Window* parent_window, StringView path, Span<DeprecatedString const> arguments);
|
||||
static void spawn_or_show_error(Window* parent_window, StringView path, Span<StringView const> arguments);
|
||||
static void spawn_or_show_error(Window* parent_window, StringView path, Span<char const* const> arguments = {});
|
||||
};
|
||||
|
|
|
@ -28,8 +28,8 @@ private:
|
|||
|
||||
pid_t m_pid { 0 };
|
||||
|
||||
String m_window_title;
|
||||
String m_button_label;
|
||||
DeprecatedString m_window_title;
|
||||
DeprecatedString m_button_label;
|
||||
RefPtr<Gfx::Bitmap> m_window_icon;
|
||||
RefPtr<TableView> m_table_view;
|
||||
RefPtr<RunningProcessesModel> m_process_model;
|
||||
|
|
|
@ -54,7 +54,7 @@ void Progressbar::paint_event(PaintEvent& event)
|
|||
painter.add_clip_rect(rect);
|
||||
painter.add_clip_rect(event.rect());
|
||||
|
||||
String progress_text;
|
||||
DeprecatedString progress_text;
|
||||
if (m_format != Format::NoText) {
|
||||
// Then we draw the progress text over the gradient.
|
||||
// We draw it twice, once offset (1, 1) for a drop shadow look.
|
||||
|
|
|
@ -28,8 +28,8 @@ public:
|
|||
void set_orientation(Orientation value);
|
||||
Orientation orientation() const { return m_orientation; }
|
||||
|
||||
String text() const { return m_text; }
|
||||
void set_text(String text) { m_text = move(text); }
|
||||
DeprecatedString text() const { return m_text; }
|
||||
void set_text(DeprecatedString text) { m_text = move(text); }
|
||||
|
||||
enum Format {
|
||||
NoText,
|
||||
|
@ -49,7 +49,7 @@ private:
|
|||
int m_min { 0 };
|
||||
int m_max { 100 };
|
||||
int m_value { 0 };
|
||||
String m_text;
|
||||
DeprecatedString m_text;
|
||||
Orientation m_orientation { Orientation::Horizontal };
|
||||
};
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ REGISTER_WIDGET(GUI, RadioButton)
|
|||
|
||||
namespace GUI {
|
||||
|
||||
RadioButton::RadioButton(String text)
|
||||
RadioButton::RadioButton(DeprecatedString text)
|
||||
: AbstractButton(move(text))
|
||||
{
|
||||
set_exclusive(true);
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
virtual Optional<UISize> calculated_min_size() const override;
|
||||
|
||||
protected:
|
||||
explicit RadioButton(String text = {});
|
||||
explicit RadioButton(DeprecatedString text = {});
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -45,7 +45,7 @@ int RunningProcessesModel::column_count(const GUI::ModelIndex&) const
|
|||
return Column::__Count;
|
||||
}
|
||||
|
||||
String RunningProcessesModel::column_name(int column_index) const
|
||||
DeprecatedString RunningProcessesModel::column_name(int column_index) const
|
||||
{
|
||||
switch (column_index) {
|
||||
case Column::Icon:
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
virtual int row_count(const GUI::ModelIndex&) const override;
|
||||
virtual int column_count(const GUI::ModelIndex&) const override;
|
||||
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&, GUI::ModelRole) const override;
|
||||
|
||||
void update();
|
||||
|
@ -39,7 +39,7 @@ private:
|
|||
pid_t pid;
|
||||
uid_t uid;
|
||||
RefPtr<Gfx::Bitmap> icon;
|
||||
String name;
|
||||
DeprecatedString name;
|
||||
};
|
||||
Vector<Process> m_processes;
|
||||
};
|
||||
|
|
|
@ -102,7 +102,7 @@ void ScrollableContainerWidget::set_widget(GUI::Widget* widget)
|
|||
update_widget_position();
|
||||
}
|
||||
|
||||
bool ScrollableContainerWidget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(String const&))
|
||||
bool ScrollableContainerWidget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(DeprecatedString const&))
|
||||
{
|
||||
if (is<GUI::GML::GMLFile>(ast.ptr()))
|
||||
return load_from_gml_ast(static_ptr_cast<GUI::GML::GMLFile>(ast)->main_class(), unregistered_child_handler);
|
||||
|
|
|
@ -30,7 +30,7 @@ private:
|
|||
void update_widget_size();
|
||||
void update_widget_position();
|
||||
void update_widget_min_size();
|
||||
virtual bool load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(String const&)) override;
|
||||
virtual bool load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(DeprecatedString const&)) override;
|
||||
|
||||
ScrollableContainerWidget();
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ void SettingsWindow::set_modified(bool modified)
|
|||
m_apply_button->set_enabled(modified);
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(String title, ShowDefaultsButton show_defaults_button)
|
||||
ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(DeprecatedString title, ShowDefaultsButton show_defaults_button)
|
||||
{
|
||||
auto window = TRY(SettingsWindow::try_create());
|
||||
|
||||
|
|
|
@ -42,12 +42,12 @@ public:
|
|||
No,
|
||||
};
|
||||
|
||||
static ErrorOr<NonnullRefPtr<SettingsWindow>> create(String title, ShowDefaultsButton = ShowDefaultsButton::No);
|
||||
static ErrorOr<NonnullRefPtr<SettingsWindow>> create(DeprecatedString title, ShowDefaultsButton = ShowDefaultsButton::No);
|
||||
|
||||
virtual ~SettingsWindow() override = default;
|
||||
|
||||
template<class T, class... Args>
|
||||
ErrorOr<NonnullRefPtr<T>> add_tab(String title, StringView id, Args&&... args)
|
||||
ErrorOr<NonnullRefPtr<T>> add_tab(DeprecatedString title, StringView id, Args&&... args)
|
||||
{
|
||||
auto tab = TRY(m_tab_widget->try_add_tab<T>(move(title), forward<Args>(args)...));
|
||||
TRY(m_tabs.try_set(id, tab));
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGUI/Shortcut.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
String Shortcut::to_string() const
|
||||
DeprecatedString Shortcut::to_string() const
|
||||
{
|
||||
Vector<String, 8> parts;
|
||||
Vector<DeprecatedString, 8> parts;
|
||||
|
||||
if (m_modifiers & Mod_Ctrl)
|
||||
parts.append("Ctrl");
|
||||
|
@ -34,7 +34,7 @@ String Shortcut::to_string() const
|
|||
parts.append("(Invalid)");
|
||||
} else {
|
||||
if (m_mouse_button != MouseButton::None)
|
||||
parts.append(String::formatted("Mouse {}", mouse_button_to_string(m_mouse_button)));
|
||||
parts.append(DeprecatedString::formatted("Mouse {}", mouse_button_to_string(m_mouse_button)));
|
||||
else
|
||||
parts.append("(Invalid)");
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
Mouse,
|
||||
};
|
||||
|
||||
String to_string() const;
|
||||
DeprecatedString to_string() const;
|
||||
Type type() const { return m_type; }
|
||||
bool is_valid() const { return m_type == Type::Keyboard ? (m_keyboard_key != Key_Invalid) : (m_mouse_button != MouseButton::None); }
|
||||
u8 modifiers() const { return m_modifiers; }
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue