mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 03:08:13 +00:00
LibGUI+Applications: Use String in make_about_action()
This commit is contained in:
parent
e7a5a2e146
commit
ccab5ddf9b
53 changed files with 60 additions and 60 deletions
|
@ -19,7 +19,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
NonnullRefPtr<AboutDialog> AboutDialog::create(String name, String version, RefPtr<Gfx::Bitmap const> icon, Window* parent_window)
|
||||
NonnullRefPtr<AboutDialog> AboutDialog::create(String const& name, String version, RefPtr<Gfx::Bitmap const> icon, Window* parent_window)
|
||||
{
|
||||
auto dialog = adopt_ref(*new AboutDialog(name, version, icon, parent_window));
|
||||
dialog->set_title(DeprecatedString::formatted("About {}", name));
|
||||
|
@ -49,9 +49,9 @@ NonnullRefPtr<AboutDialog> AboutDialog::create(String name, String version, RefP
|
|||
return dialog;
|
||||
}
|
||||
|
||||
AboutDialog::AboutDialog(String name, String version, RefPtr<Gfx::Bitmap const> icon, Window* parent_window)
|
||||
AboutDialog::AboutDialog(String const& name, String version, RefPtr<Gfx::Bitmap const> icon, Window* parent_window)
|
||||
: Dialog(parent_window)
|
||||
, m_name(move(name))
|
||||
, m_name(name)
|
||||
, m_version_string(move(version))
|
||||
, m_icon(move(icon))
|
||||
{
|
||||
|
|
|
@ -16,13 +16,13 @@ namespace GUI {
|
|||
class AboutDialog final : public Dialog {
|
||||
C_OBJECT_ABSTRACT(AboutDialog)
|
||||
public:
|
||||
[[nodiscard]] static NonnullRefPtr<AboutDialog> create(String name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr);
|
||||
[[nodiscard]] static NonnullRefPtr<AboutDialog> create(String const& name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr);
|
||||
virtual ~AboutDialog() override = default;
|
||||
|
||||
static void show(String name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr, RefPtr<Gfx::Bitmap const> window_icon = nullptr);
|
||||
|
||||
private:
|
||||
AboutDialog(String name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr);
|
||||
AboutDialog(String const& name, String version, RefPtr<Gfx::Bitmap const> icon = nullptr, Window* parent_window = nullptr);
|
||||
|
||||
String m_name;
|
||||
String m_version_string;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
namespace GUI {
|
||||
|
||||
namespace CommonActions {
|
||||
NonnullRefPtr<Action> make_about_action(DeprecatedString const& app_name, Icon const& app_icon, Window* parent = nullptr);
|
||||
NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_icon, Window* parent = nullptr);
|
||||
NonnullRefPtr<Action> make_open_action(Function<void(Action&)>, Core::EventReceiver* parent = nullptr);
|
||||
NonnullRefPtr<Action> make_save_action(Function<void(Action&)>, Core::EventReceiver* parent = nullptr);
|
||||
NonnullRefPtr<Action> make_save_as_action(Function<void(Action&)>, Core::EventReceiver* parent = nullptr);
|
||||
|
|
|
@ -17,12 +17,12 @@ namespace GUI {
|
|||
|
||||
namespace CommonActions {
|
||||
|
||||
NonnullRefPtr<Action> make_about_action(DeprecatedString const& app_name, Icon const& app_icon, Window* parent)
|
||||
NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_icon, Window* parent)
|
||||
{
|
||||
auto weak_parent = AK::make_weak_ptr_if_nonnull<Window>(parent);
|
||||
auto action = Action::create(DeprecatedString::formatted("&About {}", app_name), app_icon.bitmap_for_size(16), [=](auto&) {
|
||||
AboutDialog::show(
|
||||
String::from_deprecated_string(app_name).release_value_but_fixme_should_propagate_errors(),
|
||||
app_name,
|
||||
Core::Version::read_long_version_string().release_value_but_fixme_should_propagate_errors(),
|
||||
app_icon.bitmap_for_size(32),
|
||||
weak_parent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue