diff --git a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp index 814c4b3728..b37a0ca72c 100644 --- a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp +++ b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp @@ -23,17 +23,17 @@ ClipboardHistoryModel::ClipboardHistoryModel() { } -DeprecatedString ClipboardHistoryModel::column_name(int column) const +String ClipboardHistoryModel::column_name(int column) const { switch (column) { case Column::Data: - return "Data"; + return "Data"_short_string; case Column::Type: - return "Type"; + return "Type"_short_string; case Column::Size: - return "Size"; + return "Size"_short_string; case Column::Time: - return "Time"; + return "Time"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h index 344548b7cc..e7e45ea8fb 100644 --- a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h +++ b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.h @@ -60,7 +60,7 @@ private: // ^GUI::Model virtual int row_count(const GUI::ModelIndex&) const override { return m_history_items.size(); } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual int column_count(const GUI::ModelIndex&) const override { return Column::__Count; } // ^GUI::Clipboard::ClipboardClient diff --git a/Userland/Applications/Browser/CookiesModel.cpp b/Userland/Applications/Browser/CookiesModel.cpp index 2d16901bd5..fc2c99bb64 100644 --- a/Userland/Applications/Browser/CookiesModel.cpp +++ b/Userland/Applications/Browser/CookiesModel.cpp @@ -34,21 +34,21 @@ int CookiesModel::row_count(GUI::ModelIndex const& index) const return 0; } -DeprecatedString CookiesModel::column_name(int column) const +String CookiesModel::column_name(int column) const { switch (column) { case Column::Domain: - return "Domain"; + return "Domain"_short_string; case Column::Path: - return "Path"; + return "Path"_short_string; case Column::Name: - return "Name"; + return "Name"_short_string; case Column::Value: - return "Value"; + return "Value"_short_string; case Column::ExpiryTime: - return "Expiry time"; + return "Expiry time"_string.release_value_but_fixme_should_propagate_errors(); case Column::SameSite: - return "SameSite"; + return "SameSite"_string.release_value_but_fixme_should_propagate_errors(); case Column::__Count: return {}; } diff --git a/Userland/Applications/Browser/CookiesModel.h b/Userland/Applications/Browser/CookiesModel.h index 8b66b78856..22f6a9964a 100644 --- a/Userland/Applications/Browser/CookiesModel.h +++ b/Userland/Applications/Browser/CookiesModel.h @@ -30,7 +30,7 @@ public: void clear_items(); virtual int row_count(GUI::ModelIndex const&) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int column) const override; + virtual String column_name(int column) const override; virtual GUI::ModelIndex index(int row, int column = 0, GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual GUI::Variant data(GUI::ModelIndex const& index, GUI::ModelRole role = GUI::ModelRole::Display) const override; virtual TriState data_matches(GUI::ModelIndex const& index, GUI::Variant const& term) const override; diff --git a/Userland/Applications/Browser/History/HistoryModel.cpp b/Userland/Applications/Browser/History/HistoryModel.cpp index d40f34bae1..17b8c2f533 100644 --- a/Userland/Applications/Browser/History/HistoryModel.cpp +++ b/Userland/Applications/Browser/History/HistoryModel.cpp @@ -34,13 +34,13 @@ int HistoryModel::row_count(GUI::ModelIndex const& index) const return 0; } -DeprecatedString HistoryModel::column_name(int column) const +String HistoryModel::column_name(int column) const { switch (column) { case Column::Title: - return "Title"; + return "Title"_short_string; case Column::URL: - return "URL"; + return "URL"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/Browser/History/HistoryModel.h b/Userland/Applications/Browser/History/HistoryModel.h index 6162b28db0..dc18d8dd2e 100644 --- a/Userland/Applications/Browser/History/HistoryModel.h +++ b/Userland/Applications/Browser/History/HistoryModel.h @@ -25,7 +25,7 @@ public: void clear_items(); virtual int row_count(GUI::ModelIndex const&) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int column) const override; + virtual String column_name(int column) const override; virtual GUI::ModelIndex index(int row, int column = 0, GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual GUI::Variant data(GUI::ModelIndex const& index, GUI::ModelRole role = GUI::ModelRole::Display) const override; virtual TriState data_matches(GUI::ModelIndex const& index, GUI::Variant const& term) const override; diff --git a/Userland/Applications/Browser/StorageModel.cpp b/Userland/Applications/Browser/StorageModel.cpp index 4d68b3ee32..4dc22696a0 100644 --- a/Userland/Applications/Browser/StorageModel.cpp +++ b/Userland/Applications/Browser/StorageModel.cpp @@ -35,13 +35,13 @@ int StorageModel::row_count(GUI::ModelIndex const& index) const return 0; } -DeprecatedString StorageModel::column_name(int column) const +String StorageModel::column_name(int column) const { switch (column) { case Column::Key: - return "Key"; + return "Key"_short_string; case Column::Value: - return "Value"; + return "Value"_short_string; case Column::__Count: return {}; } diff --git a/Userland/Applications/Browser/StorageModel.h b/Userland/Applications/Browser/StorageModel.h index 6b8735e00f..c1177c8738 100644 --- a/Userland/Applications/Browser/StorageModel.h +++ b/Userland/Applications/Browser/StorageModel.h @@ -22,7 +22,7 @@ public: void clear_items(); virtual int row_count(GUI::ModelIndex const&) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int column) const override; + virtual String column_name(int column) const override; virtual GUI::ModelIndex index(int row, int column = 0, GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual GUI::Variant data(GUI::ModelIndex const& index, GUI::ModelRole role = GUI::ModelRole::Display) const override; virtual TriState data_matches(GUI::ModelIndex const& index, GUI::Variant const& term) const override; diff --git a/Userland/Applications/Calendar/AddEventDialog.cpp b/Userland/Applications/Calendar/AddEventDialog.cpp index 72466ef258..09ff89df3c 100644 --- a/Userland/Applications/Calendar/AddEventDialog.cpp +++ b/Userland/Applications/Calendar/AddEventDialog.cpp @@ -120,21 +120,21 @@ int AddEventDialog::MeridiemListModel::row_count(const GUI::ModelIndex&) const return 2; } -DeprecatedString AddEventDialog::MonthListModel::column_name(int column) const +String AddEventDialog::MonthListModel::column_name(int column) const { switch (column) { case Column::Month: - return "Month"; + return "Month"_short_string; default: VERIFY_NOT_REACHED(); } } -DeprecatedString AddEventDialog::MeridiemListModel::column_name(int column) const +String AddEventDialog::MeridiemListModel::column_name(int column) const { switch (column) { case Column::Meridiem: - return "Meridiem"; + return "Meridiem"_string.release_value_but_fixme_should_propagate_errors(); default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/Calendar/AddEventDialog.h b/Userland/Applications/Calendar/AddEventDialog.h index fab9abbef0..4f0aa162e8 100644 --- a/Userland/Applications/Calendar/AddEventDialog.h +++ b/Userland/Applications/Calendar/AddEventDialog.h @@ -38,7 +38,7 @@ private: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override; virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; private: @@ -57,7 +57,7 @@ private: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override; virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; private: diff --git a/Userland/Applications/CertificateSettings/CertificateStoreWidget.cpp b/Userland/Applications/CertificateSettings/CertificateStoreWidget.cpp index 200aea5965..fe1997f015 100644 --- a/Userland/Applications/CertificateSettings/CertificateStoreWidget.cpp +++ b/Userland/Applications/CertificateSettings/CertificateStoreWidget.cpp @@ -34,15 +34,15 @@ ErrorOr CertificateStoreModel::load() return {}; } -DeprecatedString CertificateStoreModel::column_name(int column) const +String CertificateStoreModel::column_name(int column) const { switch (column) { case Column::IssuedTo: - return "Issued To"; + return "Issued To"_string.release_value_but_fixme_should_propagate_errors(); case Column::IssuedBy: - return "Issued By"; + return "Issued By"_string.release_value_but_fixme_should_propagate_errors(); case Column::Expire: - return "Expiration Date"; + return "Expiration Date"_string.release_value_but_fixme_should_propagate_errors(); default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/CertificateSettings/CertificateStoreWidget.h b/Userland/Applications/CertificateSettings/CertificateStoreWidget.h index 412276d0ef..107305fe68 100644 --- a/Userland/Applications/CertificateSettings/CertificateStoreWidget.h +++ b/Userland/Applications/CertificateSettings/CertificateStoreWidget.h @@ -44,7 +44,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return m_certificates.size(); } virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; virtual ErrorOr load(); virtual ErrorOr add(Vector const&); diff --git a/Userland/Applications/HexEditor/SearchResultsModel.h b/Userland/Applications/HexEditor/SearchResultsModel.h index c5adfca7a5..927459990b 100644 --- a/Userland/Applications/HexEditor/SearchResultsModel.h +++ b/Userland/Applications/HexEditor/SearchResultsModel.h @@ -40,13 +40,13 @@ public: return 2; } - DeprecatedString column_name(int column) const override + String column_name(int column) const override { switch (column) { case Column::Offset: - return "Offset"; + return "Offset"_short_string; case Column::Value: - return "Value"; + return "Value"_short_string; } VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/HexEditor/ValueInspectorModel.h b/Userland/Applications/HexEditor/ValueInspectorModel.h index 27f22f853b..79d931ada1 100644 --- a/Userland/Applications/HexEditor/ValueInspectorModel.h +++ b/Userland/Applications/HexEditor/ValueInspectorModel.h @@ -63,13 +63,13 @@ public: return 2; } - DeprecatedString column_name(int column) const override + String column_name(int column) const override { switch (column) { case Column::Type: - return "Type"; + return "Type"_short_string; case Column::Value: - return m_is_little_endian ? "Value (Little Endian)" : "Value (Big Endian)"; + return m_is_little_endian ? "Value (Little Endian)"_string.release_value_but_fixme_should_propagate_errors() : "Value (Big Endian)"_string.release_value_but_fixme_should_propagate_errors(); } VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/Mail/InboxModel.cpp b/Userland/Applications/Mail/InboxModel.cpp index 9f62c7a8d4..5eee5f0e1f 100644 --- a/Userland/Applications/Mail/InboxModel.cpp +++ b/Userland/Applications/Mail/InboxModel.cpp @@ -17,13 +17,13 @@ int InboxModel::row_count(GUI::ModelIndex const&) const return m_entries.size(); } -DeprecatedString InboxModel::column_name(int column_index) const +String InboxModel::column_name(int column_index) const { switch (column_index) { case Column::From: - return "From"; + return "From"_short_string; case Subject: - return "Subject"; + return "Subject"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/Mail/InboxModel.h b/Userland/Applications/Mail/InboxModel.h index 113f739c05..ab63595130 100644 --- a/Userland/Applications/Mail/InboxModel.h +++ b/Userland/Applications/Mail/InboxModel.h @@ -32,7 +32,7 @@ public: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override; virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; private: diff --git a/Userland/Applications/MouseSettings/ThemeWidget.cpp b/Userland/Applications/MouseSettings/ThemeWidget.cpp index 9e0a73bddd..39d708a138 100644 --- a/Userland/Applications/MouseSettings/ThemeWidget.cpp +++ b/Userland/Applications/MouseSettings/ThemeWidget.cpp @@ -15,13 +15,13 @@ #include #include -DeprecatedString MouseCursorModel::column_name(int column_index) const +String MouseCursorModel::column_name(int column_index) const { switch (column_index) { case Column::Bitmap: return {}; case Column::Name: - return "Name"; + return "Name"_short_string; } VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/MouseSettings/ThemeWidget.h b/Userland/Applications/MouseSettings/ThemeWidget.h index 4b4deac025..6868df4364 100644 --- a/Userland/Applications/MouseSettings/ThemeWidget.h +++ b/Userland/Applications/MouseSettings/ThemeWidget.h @@ -25,7 +25,7 @@ public: virtual int row_count(const GUI::ModelIndex&) const override { return m_cursors.size(); } virtual int column_count(const GUI::ModelIndex&) const override { return Column::__Count; } - virtual DeprecatedString column_name(int column_index) const override; + virtual String column_name(int column_index) const override; virtual GUI::Variant data(const GUI::ModelIndex& index, GUI::ModelRole role) const override; virtual void invalidate() override; diff --git a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp index b3d0a5ea49..a7f3b789b2 100644 --- a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp +++ b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp @@ -64,13 +64,13 @@ public: return Columns::Page; } - DeprecatedString column_name(int index) const override + String column_name(int index) const override { switch (index) { case 0: - return "Page"; + return "Page"_short_string; case 1: - return "Message"; + return "Message"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/PartitionEditor/PartitionModel.cpp b/Userland/Applications/PartitionEditor/PartitionModel.cpp index 90859254e4..98d2f8a937 100644 --- a/Userland/Applications/PartitionEditor/PartitionModel.cpp +++ b/Userland/Applications/PartitionEditor/PartitionModel.cpp @@ -18,19 +18,19 @@ NonnullRefPtr PartitionModel::create() return adopt_ref(*new PartitionModel); } -DeprecatedString PartitionModel::column_name(int column) const +String PartitionModel::column_name(int column) const { switch (column) { case Column::Partition: - return "Partition"; + return "Partition"_string.release_value_but_fixme_should_propagate_errors(); case Column::StartBlock: - return "Start Block"; + return "Start Block"_string.release_value_but_fixme_should_propagate_errors(); case Column::EndBlock: - return "End Block"; + return "End Block"_string.release_value_but_fixme_should_propagate_errors(); case Column::TotalBlocks: - return "Total Blocks"; + return "Total Blocks"_string.release_value_but_fixme_should_propagate_errors(); case Column::Size: - return "Size"; + return "Size"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/PartitionEditor/PartitionModel.h b/Userland/Applications/PartitionEditor/PartitionModel.h index e7ce742a2b..7cbdde0793 100644 --- a/Userland/Applications/PartitionEditor/PartitionModel.h +++ b/Userland/Applications/PartitionEditor/PartitionModel.h @@ -27,7 +27,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return m_partition_table->partitions_count(); } virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; ErrorOr set_device_path(DeprecatedString const&); diff --git a/Userland/Applications/SoundPlayer/PlaylistWidget.cpp b/Userland/Applications/SoundPlayer/PlaylistWidget.cpp index 8ef466c6f9..61bd75e6e1 100644 --- a/Userland/Applications/SoundPlayer/PlaylistWidget.cpp +++ b/Userland/Applications/SoundPlayer/PlaylistWidget.cpp @@ -73,21 +73,21 @@ DeprecatedString PlaylistModel::format_duration(u32 duration_in_seconds) return DeprecatedString::formatted("{:02}:{:02}:{:02}", duration_in_seconds / 3600, duration_in_seconds / 60, duration_in_seconds % 60); } -DeprecatedString PlaylistModel::column_name(int column) const +String PlaylistModel::column_name(int column) const { switch (column) { case 0: - return "Title"; + return "Title"_short_string; case 1: - return "Duration"; + return "Duration"_string.release_value_but_fixme_should_propagate_errors(); case 2: - return "Group"; + return "Group"_short_string; case 3: - return "Album"; + return "Album"_short_string; case 4: - return "Artist"; + return "Artist"_short_string; case 5: - return "Filesize"; + return "Filesize"_string.release_value_but_fixme_should_propagate_errors(); } VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/SoundPlayer/PlaylistWidget.h b/Userland/Applications/SoundPlayer/PlaylistWidget.h index cc033fc5b8..fcf67bbcd8 100644 --- a/Userland/Applications/SoundPlayer/PlaylistWidget.h +++ b/Userland/Applications/SoundPlayer/PlaylistWidget.h @@ -24,7 +24,7 @@ public: int row_count(const GUI::ModelIndex&) const override { return m_playlist_items.size(); } int column_count(const GUI::ModelIndex&) const override { return 6; } GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; - DeprecatedString column_name(int column) const override; + String column_name(int column) const override; Vector& items() { return m_playlist_items; } private: diff --git a/Userland/Applications/Spreadsheet/ImportDialog.cpp b/Userland/Applications/Spreadsheet/ImportDialog.cpp index 7b07765403..849206fcc6 100644 --- a/Userland/Applications/Spreadsheet/ImportDialog.cpp +++ b/Userland/Applications/Spreadsheet/ImportDialog.cpp @@ -166,10 +166,12 @@ void CSVImportDialogPage::update_preview() return; } - auto headers = reader.headers(); + Vector headers; + for (auto const& header : reader.headers()) + headers.append(String::from_deprecated_string(header).release_value_but_fixme_should_propagate_errors()); m_data_preview_table_view->set_model( - GUI::ItemListModel>::create(reader, headers, min(8ul, reader.size()))); + GUI::ItemListModel>::create(reader, headers, min(8ul, reader.size()))); m_data_preview_widget->set_active_widget(m_data_preview_table_view); m_data_preview_table_view->update(); } diff --git a/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp b/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp index 9693de25f4..f1ca5fdf9e 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp @@ -162,12 +162,12 @@ RefPtr SheetModel::mime_data(const GUI::ModelSelection& selectio return mime_data; } -DeprecatedString SheetModel::column_name(int index) const +String SheetModel::column_name(int index) const { if (index < 0) return {}; - return m_sheet->column(index); + return String::from_deprecated_string(m_sheet->column(index)).release_value_but_fixme_should_propagate_errors(); } bool SheetModel::is_editable(const GUI::ModelIndex& index) const diff --git a/Userland/Applications/Spreadsheet/SpreadsheetModel.h b/Userland/Applications/Spreadsheet/SpreadsheetModel.h index 4227e401e5..15bd933ad7 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetModel.h +++ b/Userland/Applications/Spreadsheet/SpreadsheetModel.h @@ -23,7 +23,7 @@ public: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return m_sheet->row_count(); } virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return m_sheet->column_count(); } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; virtual RefPtr mime_data(const GUI::ModelSelection&) const override; virtual bool is_editable(const GUI::ModelIndex&) const override; diff --git a/Userland/Applications/SystemMonitor/ProcessModel.cpp b/Userland/Applications/SystemMonitor/ProcessModel.cpp index b576de6a92..a26add41ca 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.cpp +++ b/Userland/Applications/SystemMonitor/ProcessModel.cpp @@ -71,71 +71,71 @@ int ProcessModel::column_count(GUI::ModelIndex const&) const return Column::__Count; } -DeprecatedString ProcessModel::column_name(int column) const +String ProcessModel::column_name(int column) const { switch (column) { case Column::Icon: - return ""; + return {}; case Column::PID: - return "PID"; + return "PID"_short_string; case Column::TID: - return "TID"; + return "TID"_short_string; case Column::PPID: - return "PPID"; + return "PPID"_short_string; case Column::PGID: - return "PGID"; + return "PGID"_short_string; case Column::SID: - return "SID"; + return "SID"_short_string; case Column::State: - return "State"; + return "State"_short_string; case Column::User: - return "User"; + return "User"_short_string; case Column::Priority: - return "Pr"; + return "Pr"_short_string; case Column::Virtual: - return "Virtual"; + return "Virtual"_short_string; case Column::Physical: - return "Physical"; + return "Physical"_string.release_value_but_fixme_should_propagate_errors(); case Column::DirtyPrivate: - return "Private"; + return "Private"_short_string; case Column::CleanInode: - return "CleanI"; + return "CleanI"_short_string; case Column::PurgeableVolatile: - return "Purg:V"; + return "Purg:V"_short_string; case Column::PurgeableNonvolatile: - return "Purg:N"; + return "Purg:N"_short_string; case Column::CPU: - return "CPU"; + return "CPU"_short_string; case Column::Processor: - return "Processor"; + return "Processor"_string.release_value_but_fixme_should_propagate_errors(); case Column::Name: - return "Name"; + return "Name"_short_string; case Column::Syscalls: - return "Syscalls"; + return "Syscalls"_string.release_value_but_fixme_should_propagate_errors(); case Column::InodeFaults: - return "F:Inode"; + return "F:Inode"_short_string; case Column::ZeroFaults: - return "F:Zero"; + return "F:Zero"_short_string; case Column::CowFaults: - return "F:CoW"; + return "F:CoW"_short_string; case Column::IPv4SocketReadBytes: - return "IPv4 In"; + return "IPv4 In"_short_string; case Column::IPv4SocketWriteBytes: - return "IPv4 Out"; + return "IPv4 Out"_string.release_value_but_fixme_should_propagate_errors(); case Column::UnixSocketReadBytes: - return "Unix In"; + return "Unix In"_short_string; case Column::UnixSocketWriteBytes: - return "Unix Out"; + return "Unix Out"_string.release_value_but_fixme_should_propagate_errors(); case Column::FileReadBytes: - return "File In"; + return "File In"_short_string; case Column::FileWriteBytes: - return "File Out"; + return "File Out"_string.release_value_but_fixme_should_propagate_errors(); case Column::Pledge: - return "Pledge"; + return "Pledge"_short_string; case Column::Veil: - return "Veil"; + return "Veil"_short_string; case Column::Command: - return "Command"; + return "Command"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/SystemMonitor/ProcessModel.h b/Userland/Applications/SystemMonitor/ProcessModel.h index 40bda1286d..f1db941ca2 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.h +++ b/Userland/Applications/SystemMonitor/ProcessModel.h @@ -63,7 +63,7 @@ public: virtual int tree_column() const override { return Column::Name; } virtual int row_count(GUI::ModelIndex const&) const override; virtual int column_count(GUI::ModelIndex const&) const override; - virtual DeprecatedString column_name(int column) const override; + virtual String column_name(int column) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; virtual GUI::ModelIndex index(int row, int column, GUI::ModelIndex const& parent = {}) const override; virtual GUI::ModelIndex parent_index(GUI::ModelIndex const&) const override; diff --git a/Userland/Applications/SystemMonitor/ThreadStackWidget.cpp b/Userland/Applications/SystemMonitor/ThreadStackWidget.cpp index 4bb4ef6ae5..e45fb648e9 100644 --- a/Userland/Applications/SystemMonitor/ThreadStackWidget.cpp +++ b/Userland/Applications/SystemMonitor/ThreadStackWidget.cpp @@ -30,15 +30,15 @@ public: int row_count(GUI::ModelIndex const&) const override { return m_symbols.size(); }; bool is_column_sortable(int) const override { return false; } - DeprecatedString column_name(int column) const override + String column_name(int column) const override { switch (column) { case Column::Address: - return "Address"; + return "Address"_short_string; case Column::Object: - return "Object"; + return "Object"_short_string; case Column::Symbol: - return "Symbol"; + return "Symbol"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Demos/ModelGallery/BasicModel.h b/Userland/Demos/ModelGallery/BasicModel.h index 9034c9fba2..e682746b24 100644 --- a/Userland/Demos/ModelGallery/BasicModel.h +++ b/Userland/Demos/ModelGallery/BasicModel.h @@ -20,7 +20,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return m_items.size(); } virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return 1; } - virtual DeprecatedString column_name(int) const override { return "Item"; } + virtual String column_name(int) const override { return "Item"_short_string; } virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole = GUI::ModelRole::Display) const override; virtual TriState data_matches(GUI::ModelIndex const&, GUI::Variant const&) const override; diff --git a/Userland/Demos/WidgetGallery/GalleryModels.h b/Userland/Demos/WidgetGallery/GalleryModels.h index f4f3049624..166ae540e0 100644 --- a/Userland/Demos/WidgetGallery/GalleryModels.h +++ b/Userland/Demos/WidgetGallery/GalleryModels.h @@ -27,13 +27,13 @@ public: virtual int row_count(const GUI::ModelIndex&) const override { return m_cursors.size(); } virtual int column_count(const GUI::ModelIndex&) const override { return Column::__Count; } - virtual DeprecatedString column_name(int column_index) const override + virtual String column_name(int column_index) const override { switch (column_index) { case Column::Bitmap: return {}; case Column::Name: - return "Name"; + return "Name"_short_string; } VERIFY_NOT_REACHED(); } @@ -112,7 +112,7 @@ public: virtual int row_count(const GUI::ModelIndex&) const override { return m_icon_sets.size(); } virtual int column_count(const GUI::ModelIndex&) const override { return Column::__Count; } - virtual DeprecatedString column_name(int column_index) const override + virtual String column_name(int column_index) const override { switch (column_index) { case Column::BigIcon: @@ -120,7 +120,7 @@ public: case Column::LittleIcon: return {}; case Column::Name: - return "Name"; + return "Name"_short_string; } VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/HackStudio/Debugger/BacktraceModel.h b/Userland/DevTools/HackStudio/Debugger/BacktraceModel.h index 7090d28f09..bde27ab71b 100644 --- a/Userland/DevTools/HackStudio/Debugger/BacktraceModel.h +++ b/Userland/DevTools/HackStudio/Debugger/BacktraceModel.h @@ -27,10 +27,7 @@ public: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return m_frames.size(); } virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return 1; } - virtual DeprecatedString column_name(int) const override - { - return ""; - } + virtual String column_name(int) const override { return {}; } virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; diff --git a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp index 5a76c8e265..309e1b7b65 100644 --- a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp +++ b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp @@ -73,15 +73,15 @@ int DisassemblyModel::row_count(const GUI::ModelIndex&) const return m_instructions.size(); } -DeprecatedString DisassemblyModel::column_name(int column) const +String DisassemblyModel::column_name(int column) const { switch (column) { case Column::Address: - return "Address"; + return "Address"_short_string; case Column::InstructionBytes: - return "Insn Bytes"; + return "Insn Bytes"_string.release_value_but_fixme_should_propagate_errors(); case Column::Disassembly: - return "Disassembly"; + return "Disassembly"_string.release_value_but_fixme_should_propagate_errors(); default: VERIFY_NOT_REACHED(); return {}; diff --git a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.h b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.h index 67cbeb4c94..a4c867b3ba 100644 --- a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.h +++ b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.h @@ -45,7 +45,7 @@ public: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override; virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; private: diff --git a/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp b/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp index 7219b5eb70..574fa54a67 100644 --- a/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp +++ b/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp @@ -86,13 +86,13 @@ int RegistersModel::row_count(const GUI::ModelIndex&) const return m_registers.size(); } -DeprecatedString RegistersModel::column_name(int column) const +String RegistersModel::column_name(int column) const { switch (column) { case Column::Register: - return "Register"; + return "Register"_string.release_value_but_fixme_should_propagate_errors(); case Column::Value: - return "Value"; + return "Value"_short_string; default: VERIFY_NOT_REACHED(); return {}; diff --git a/Userland/DevTools/HackStudio/Debugger/RegistersModel.h b/Userland/DevTools/HackStudio/Debugger/RegistersModel.h index 3004feada8..c13621ded2 100644 --- a/Userland/DevTools/HackStudio/Debugger/RegistersModel.h +++ b/Userland/DevTools/HackStudio/Debugger/RegistersModel.h @@ -41,7 +41,7 @@ public: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override; virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; PtraceRegisters const& raw_registers() const { return m_raw_registers; } diff --git a/Userland/DevTools/HackStudio/Dialogs/ProjectTemplatesModel.cpp b/Userland/DevTools/HackStudio/Dialogs/ProjectTemplatesModel.cpp index f52b269e32..3e38967d4e 100644 --- a/Userland/DevTools/HackStudio/Dialogs/ProjectTemplatesModel.cpp +++ b/Userland/DevTools/HackStudio/Dialogs/ProjectTemplatesModel.cpp @@ -53,15 +53,15 @@ int ProjectTemplatesModel::column_count(const GUI::ModelIndex&) const return Column::__Count; } -DeprecatedString ProjectTemplatesModel::column_name(int column) const +String ProjectTemplatesModel::column_name(int column) const { switch (column) { case Column::Icon: - return "Icon"; + return "Icon"_short_string; case Column::Id: - return "ID"; + return "ID"_short_string; case Column::Name: - return "Name"; + return "Name"_short_string; } VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/HackStudio/Dialogs/ProjectTemplatesModel.h b/Userland/DevTools/HackStudio/Dialogs/ProjectTemplatesModel.h index 34eb0cf8af..f52585953d 100644 --- a/Userland/DevTools/HackStudio/Dialogs/ProjectTemplatesModel.h +++ b/Userland/DevTools/HackStudio/Dialogs/ProjectTemplatesModel.h @@ -35,7 +35,7 @@ public: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override; virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override; - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; void update(); diff --git a/Userland/DevTools/HackStudio/FindInFilesWidget.cpp b/Userland/DevTools/HackStudio/FindInFilesWidget.cpp index a950b98e3e..3a768794b4 100644 --- a/Userland/DevTools/HackStudio/FindInFilesWidget.cpp +++ b/Userland/DevTools/HackStudio/FindInFilesWidget.cpp @@ -39,15 +39,15 @@ public: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return m_matches.size(); } virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int column) const override + virtual String column_name(int column) const override { switch (column) { case Column::Filename: - return "Filename"; + return "Filename"_string.release_value_but_fixme_should_propagate_errors(); case Column::Location: - return "#"; + return "#"_short_string; case Column::MatchedText: - return "Text"; + return "Text"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/HackStudio/Git/GitFilesModel.h b/Userland/DevTools/HackStudio/Git/GitFilesModel.h index 5f3c985b6e..20719d3abd 100644 --- a/Userland/DevTools/HackStudio/Git/GitFilesModel.h +++ b/Userland/DevTools/HackStudio/Git/GitFilesModel.h @@ -19,10 +19,7 @@ public: virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return m_files.size(); } virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return 1; } - virtual DeprecatedString column_name(int) const override - { - return ""; - } + virtual String column_name(int) const override { return {}; } virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; diff --git a/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp b/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp index 4371d2a73e..466d6e69b2 100644 --- a/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp +++ b/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp @@ -30,17 +30,17 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return m_matches.size(); } virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int column) const override + virtual String column_name(int column) const override { switch (column) { case Column::Filename: - return "Filename"; + return "Filename"_string.release_value_but_fixme_should_propagate_errors(); case Column::Text: - return "Text"; + return "Text"_short_string; case Column::Line: - return "Line"; + return "Line"_short_string; case Column::Column: - return "Col"; + return "Col"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/Profiler/DisassemblyModel.cpp b/Userland/DevTools/Profiler/DisassemblyModel.cpp index 5d3c1303bc..d6211e0ba6 100644 --- a/Userland/DevTools/Profiler/DisassemblyModel.cpp +++ b/Userland/DevTools/Profiler/DisassemblyModel.cpp @@ -131,19 +131,19 @@ int DisassemblyModel::row_count(GUI::ModelIndex const&) const return m_instructions.size(); } -DeprecatedString DisassemblyModel::column_name(int column) const +String DisassemblyModel::column_name(int column) const { switch (column) { case Column::SampleCount: - return m_profile.show_percentages() ? "% Samples" : "# Samples"; + return m_profile.show_percentages() ? "% Samples"_string.release_value_but_fixme_should_propagate_errors() : "# Samples"_string.release_value_but_fixme_should_propagate_errors(); case Column::Address: - return "Address"; + return "Address"_short_string; case Column::InstructionBytes: - return "Insn Bytes"; + return "Insn Bytes"_string.release_value_but_fixme_should_propagate_errors(); case Column::Disassembly: - return "Disassembly"; + return "Disassembly"_string.release_value_but_fixme_should_propagate_errors(); case Column::SourceLocation: - return "Source Location"; + return "Source Location"_string.release_value_but_fixme_should_propagate_errors(); default: VERIFY_NOT_REACHED(); return {}; diff --git a/Userland/DevTools/Profiler/DisassemblyModel.h b/Userland/DevTools/Profiler/DisassemblyModel.h index 77dd6662a2..cd3a6f47e8 100644 --- a/Userland/DevTools/Profiler/DisassemblyModel.h +++ b/Userland/DevTools/Profiler/DisassemblyModel.h @@ -46,7 +46,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; virtual bool is_column_sortable(int) const override { return false; } diff --git a/Userland/DevTools/Profiler/FilesystemEventModel.cpp b/Userland/DevTools/Profiler/FilesystemEventModel.cpp index e952dee06a..4ab7c5ec05 100644 --- a/Userland/DevTools/Profiler/FilesystemEventModel.cpp +++ b/Userland/DevTools/Profiler/FilesystemEventModel.cpp @@ -142,15 +142,15 @@ int FileEventModel::column_count(GUI::ModelIndex const&) const return Column::__Count; } -DeprecatedString FileEventModel::column_name(int column) const +String FileEventModel::column_name(int column) const { switch (column) { case Column::Path: - return "Path"; + return "Path"_short_string; case Column::Count: - return "Event Count"; + return "Event Count"_string.release_value_but_fixme_should_propagate_errors(); case Column::Duration: - return "Duration [ms]"; + return "Duration [ms]"_string.release_value_but_fixme_should_propagate_errors(); default: VERIFY_NOT_REACHED(); return {}; diff --git a/Userland/DevTools/Profiler/FilesystemEventModel.h b/Userland/DevTools/Profiler/FilesystemEventModel.h index 697be2e3c1..27a75a4347 100644 --- a/Userland/DevTools/Profiler/FilesystemEventModel.h +++ b/Userland/DevTools/Profiler/FilesystemEventModel.h @@ -74,7 +74,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; virtual GUI::ModelIndex index(int row, int column, GUI::ModelIndex const& parent = GUI::ModelIndex()) const override; virtual GUI::ModelIndex parent_index(GUI::ModelIndex const&) const override; diff --git a/Userland/DevTools/Profiler/IndividualSampleModel.cpp b/Userland/DevTools/Profiler/IndividualSampleModel.cpp index 715a9ef4e2..9b56984f0a 100644 --- a/Userland/DevTools/Profiler/IndividualSampleModel.cpp +++ b/Userland/DevTools/Profiler/IndividualSampleModel.cpp @@ -29,15 +29,15 @@ int IndividualSampleModel::column_count(GUI::ModelIndex const&) const return Column::__Count; } -DeprecatedString IndividualSampleModel::column_name(int column) const +String IndividualSampleModel::column_name(int column) const { switch (column) { case Column::Address: - return "Address"; + return "Address"_short_string; case Column::ObjectName: - return "Object"; + return "Object"_short_string; case Column::Symbol: - return "Symbol"; + return "Symbol"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/Profiler/IndividualSampleModel.h b/Userland/DevTools/Profiler/IndividualSampleModel.h index 5487c6fd51..d499f62338 100644 --- a/Userland/DevTools/Profiler/IndividualSampleModel.h +++ b/Userland/DevTools/Profiler/IndividualSampleModel.h @@ -31,7 +31,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; private: diff --git a/Userland/DevTools/Profiler/ProfileModel.cpp b/Userland/DevTools/Profiler/ProfileModel.cpp index 3274443b59..9c98a9d6b8 100644 --- a/Userland/DevTools/Profiler/ProfileModel.cpp +++ b/Userland/DevTools/Profiler/ProfileModel.cpp @@ -74,19 +74,19 @@ int ProfileModel::column_count(GUI::ModelIndex const&) const return Column::__Count; } -DeprecatedString ProfileModel::column_name(int column) const +String ProfileModel::column_name(int column) const { switch (column) { case Column::SampleCount: - return m_profile.show_percentages() ? "% Samples" : "# Samples"; + return m_profile.show_percentages() ? "% Samples"_string.release_value_but_fixme_should_propagate_errors() : "# Samples"_string.release_value_but_fixme_should_propagate_errors(); case Column::SelfCount: - return m_profile.show_percentages() ? "% Self" : "# Self"; + return m_profile.show_percentages() ? "% Self"_short_string : "# Self"_short_string; case Column::ObjectName: - return "Object"; + return "Object"_short_string; case Column::StackFrame: - return "Stack Frame"; + return "Stack Frame"_string.release_value_but_fixme_should_propagate_errors(); case Column::SymbolAddress: - return "Symbol Address"; + return "Symbol Address"_string.release_value_but_fixme_should_propagate_errors(); default: VERIFY_NOT_REACHED(); return {}; diff --git a/Userland/DevTools/Profiler/ProfileModel.h b/Userland/DevTools/Profiler/ProfileModel.h index 70ebd1c5c1..6b05de1ca9 100644 --- a/Userland/DevTools/Profiler/ProfileModel.h +++ b/Userland/DevTools/Profiler/ProfileModel.h @@ -34,7 +34,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; virtual GUI::ModelIndex index(int row, int column, GUI::ModelIndex const& parent = GUI::ModelIndex()) const override; virtual GUI::ModelIndex parent_index(GUI::ModelIndex const&) const override; diff --git a/Userland/DevTools/Profiler/SamplesModel.cpp b/Userland/DevTools/Profiler/SamplesModel.cpp index 5e8b0b6d25..5a44a38f2d 100644 --- a/Userland/DevTools/Profiler/SamplesModel.cpp +++ b/Userland/DevTools/Profiler/SamplesModel.cpp @@ -28,25 +28,25 @@ int SamplesModel::column_count(GUI::ModelIndex const&) const return Column::__Count; } -DeprecatedString SamplesModel::column_name(int column) const +String SamplesModel::column_name(int column) const { switch (column) { case Column::SampleIndex: - return "#"; + return "#"_short_string; case Column::Timestamp: - return "Timestamp"; + return "Timestamp"_string.release_value_but_fixme_should_propagate_errors(); case Column::ProcessID: - return "PID"; + return "PID"_short_string; case Column::ThreadID: - return "TID"; + return "TID"_short_string; case Column::ExecutableName: - return "Executable"; + return "Executable"_string.release_value_but_fixme_should_propagate_errors(); case Column::LostSamples: - return "Lost Samples"; + return "Lost Samples"_string.release_value_but_fixme_should_propagate_errors(); case Column::InnermostStackFrame: - return "Innermost Frame"; + return "Innermost Frame"_string.release_value_but_fixme_should_propagate_errors(); case Column::Path: - return "Path"; + return "Path"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/Profiler/SamplesModel.h b/Userland/DevTools/Profiler/SamplesModel.h index 06ab6c6ae8..144307b5bf 100644 --- a/Userland/DevTools/Profiler/SamplesModel.h +++ b/Userland/DevTools/Profiler/SamplesModel.h @@ -36,7 +36,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; virtual bool is_column_sortable(int) const override { return false; } diff --git a/Userland/DevTools/Profiler/SignpostsModel.cpp b/Userland/DevTools/Profiler/SignpostsModel.cpp index 03737bb720..2f54720b9c 100644 --- a/Userland/DevTools/Profiler/SignpostsModel.cpp +++ b/Userland/DevTools/Profiler/SignpostsModel.cpp @@ -26,23 +26,23 @@ int SignpostsModel::column_count(GUI::ModelIndex const&) const return Column::__Count; } -DeprecatedString SignpostsModel::column_name(int column) const +String SignpostsModel::column_name(int column) const { switch (column) { case Column::SignpostIndex: - return "#"; + return "#"_short_string; case Column::Timestamp: - return "Timestamp"; + return "Timestamp"_string.release_value_but_fixme_should_propagate_errors(); case Column::ProcessID: - return "PID"; + return "PID"_short_string; case Column::ThreadID: - return "TID"; + return "TID"_short_string; case Column::ExecutableName: - return "Executable"; + return "Executable"_string.release_value_but_fixme_should_propagate_errors(); case Column::SignpostString: - return "String"; + return "String"_short_string; case Column::SignpostArgument: - return "Argument"; + return "Argument"_string.release_value_but_fixme_should_propagate_errors(); default: VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/Profiler/SignpostsModel.h b/Userland/DevTools/Profiler/SignpostsModel.h index 094c76b709..f227f3a952 100644 --- a/Userland/DevTools/Profiler/SignpostsModel.h +++ b/Userland/DevTools/Profiler/SignpostsModel.h @@ -35,7 +35,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; virtual bool is_column_sortable(int) const override { return false; } diff --git a/Userland/DevTools/Profiler/SourceModel.cpp b/Userland/DevTools/Profiler/SourceModel.cpp index 12fdd29a91..90797d1eb7 100644 --- a/Userland/DevTools/Profiler/SourceModel.cpp +++ b/Userland/DevTools/Profiler/SourceModel.cpp @@ -122,17 +122,17 @@ int SourceModel::row_count(GUI::ModelIndex const&) const return m_source_lines.size(); } -DeprecatedString SourceModel::column_name(int column) const +String SourceModel::column_name(int column) const { switch (column) { case Column::SampleCount: - return m_profile.show_percentages() ? "% Samples" : "# Samples"; + return m_profile.show_percentages() ? "% Samples"_string.release_value_but_fixme_should_propagate_errors() : "# Samples"_string.release_value_but_fixme_should_propagate_errors(); case Column::SourceCode: - return "Source Code"; + return "Source Code"_string.release_value_but_fixme_should_propagate_errors(); case Column::Location: - return "Location"; + return "Location"_string.release_value_but_fixme_should_propagate_errors(); case Column::LineNumber: - return "Line"; + return "Line"_short_string; default: VERIFY_NOT_REACHED(); return {}; diff --git a/Userland/DevTools/Profiler/SourceModel.h b/Userland/DevTools/Profiler/SourceModel.h index 0012f4e33a..0dded94fc3 100644 --- a/Userland/DevTools/Profiler/SourceModel.h +++ b/Userland/DevTools/Profiler/SourceModel.h @@ -38,7 +38,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; virtual bool is_column_sortable(int) const override { return false; } diff --git a/Userland/Libraries/LibGUI/CommandPalette.cpp b/Userland/Libraries/LibGUI/CommandPalette.cpp index 14220804c9..cf08935fcf 100644 --- a/Userland/Libraries/LibGUI/CommandPalette.cpp +++ b/Userland/Libraries/LibGUI/CommandPalette.cpp @@ -92,7 +92,7 @@ public: return Column::__Count; } - virtual DeprecatedString column_name(int) const override { return {}; } + virtual String column_name(int) const override { return {}; } virtual ModelIndex index(int row, int column = 0, ModelIndex const& = ModelIndex()) const override { diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index 761679f87d..425c9c7ad6 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -761,27 +761,27 @@ int FileSystemModel::column_count(ModelIndex const&) const return Column::__Count; } -DeprecatedString FileSystemModel::column_name(int column) const +String FileSystemModel::column_name(int column) const { switch (column) { case Column::Icon: - return ""; + return {}; case Column::Name: - return "Name"; + return "Name"_short_string; case Column::Size: - return "Size"; + return "Size"_short_string; case Column::User: - return "User"; + return "User"_short_string; case Column::Group: - return "Group"; + return "Group"_short_string; case Column::Permissions: - return "Mode"; + return "Mode"_short_string; case Column::ModificationTime: - return "Modified"; + return "Modified"_string.release_value_but_fixme_should_propagate_errors(); case Column::Inode: - return "Inode"; + return "Inode"_short_string; case Column::SymlinkTarget: - return "Symlink target"; + return "Symlink target"_string.release_value_but_fixme_should_propagate_errors(); } VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibGUI/FileSystemModel.h b/Userland/Libraries/LibGUI/FileSystemModel.h index 86b14076c0..fa2250a3cd 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.h +++ b/Userland/Libraries/LibGUI/FileSystemModel.h @@ -127,7 +127,7 @@ public: 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 DeprecatedString column_name(int column) const override; + virtual String 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; diff --git a/Userland/Libraries/LibGUI/FilteringProxyModel.cpp b/Userland/Libraries/LibGUI/FilteringProxyModel.cpp index f56e1e745b..ae9f0f9529 100644 --- a/Userland/Libraries/LibGUI/FilteringProxyModel.cpp +++ b/Userland/Libraries/LibGUI/FilteringProxyModel.cpp @@ -33,7 +33,7 @@ int FilteringProxyModel::column_count(ModelIndex const& index) const return m_model->column_count(m_matching_indices[index.row()]); } -DeprecatedString FilteringProxyModel::column_name(int column) const +String FilteringProxyModel::column_name(int column) const { return m_model->column_name(column); } diff --git a/Userland/Libraries/LibGUI/FilteringProxyModel.h b/Userland/Libraries/LibGUI/FilteringProxyModel.h index fb8ea6e76b..7557cbe7b7 100644 --- a/Userland/Libraries/LibGUI/FilteringProxyModel.h +++ b/Userland/Libraries/LibGUI/FilteringProxyModel.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 DeprecatedString column_name(int) const override; + virtual String 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; diff --git a/Userland/Libraries/LibGUI/HeaderView.cpp b/Userland/Libraries/LibGUI/HeaderView.cpp index 1998a60c4e..6a8cd170ad 100644 --- a/Userland/Libraries/LibGUI/HeaderView.cpp +++ b/Userland/Libraries/LibGUI/HeaderView.cpp @@ -358,7 +358,7 @@ Menu& HeaderView::ensure_context_menu() int section_count = this->section_count(); for (int section = 0; section < section_count; ++section) { auto& column_data = this->section_data(section); - auto name = model()->column_name(section); + auto name = model()->column_name(section).to_deprecated_string(); column_data.visibility_action = Action::create_checkable(name, [this, section](auto& action) { set_section_visible(section, action.is_checked()); }); diff --git a/Userland/Libraries/LibGUI/ItemListModel.h b/Userland/Libraries/LibGUI/ItemListModel.h index 848f3e7165..049a7a36a9 100644 --- a/Userland/Libraries/LibGUI/ItemListModel.h +++ b/Userland/Libraries/LibGUI/ItemListModel.h @@ -71,11 +71,11 @@ public: return 1; } - virtual DeprecatedString column_name(int index) const override + virtual String column_name(int index) const override { if constexpr (IsTwoDimensional) return m_column_names[index]; - return "Data"; + return "Data"_short_string; } virtual Variant data(ModelIndex const& index, ModelRole role) const override diff --git a/Userland/Libraries/LibGUI/JsonArrayModel.h b/Userland/Libraries/LibGUI/JsonArrayModel.h index 417144150c..c34a802c00 100644 --- a/Userland/Libraries/LibGUI/JsonArrayModel.h +++ b/Userland/Libraries/LibGUI/JsonArrayModel.h @@ -49,7 +49,7 @@ 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 DeprecatedString column_name(int column) const override { return m_fields[column].column_name; } + virtual String column_name(int column) const override { return String::from_deprecated_string(m_fields[column].column_name).release_value_but_fixme_should_propagate_errors(); } virtual Variant data(ModelIndex const&, ModelRole = ModelRole::Display) const override; virtual void invalidate() override; virtual void update(); diff --git a/Userland/Libraries/LibGUI/Model.h b/Userland/Libraries/LibGUI/Model.h index a767f584bf..51d3acaba1 100644 --- a/Userland/Libraries/LibGUI/Model.h +++ b/Userland/Libraries/LibGUI/Model.h @@ -9,11 +9,11 @@ #pragma once #include -#include #include #include #include #include +#include #include #include #include @@ -66,7 +66,7 @@ public: virtual int row_count(ModelIndex const& = ModelIndex()) const = 0; virtual int column_count(ModelIndex const& = ModelIndex()) const = 0; - virtual DeprecatedString column_name(int) const { return {}; } + virtual String 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(); diff --git a/Userland/Libraries/LibGUI/RunningProcessesModel.cpp b/Userland/Libraries/LibGUI/RunningProcessesModel.cpp index d0af1001a0..8df445bea9 100644 --- a/Userland/Libraries/LibGUI/RunningProcessesModel.cpp +++ b/Userland/Libraries/LibGUI/RunningProcessesModel.cpp @@ -45,17 +45,17 @@ int RunningProcessesModel::column_count(const GUI::ModelIndex&) const return Column::__Count; } -DeprecatedString RunningProcessesModel::column_name(int column_index) const +String RunningProcessesModel::column_name(int column_index) const { switch (column_index) { case Column::Icon: return {}; case Column::PID: - return "PID"; + return "PID"_short_string; case Column::UID: - return "UID"; + return "UID"_short_string; case Column::Name: - return "Name"; + return "Name"_short_string; } VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibGUI/RunningProcessesModel.h b/Userland/Libraries/LibGUI/RunningProcessesModel.h index 9d0fe48e77..5f0ed6d08a 100644 --- a/Userland/Libraries/LibGUI/RunningProcessesModel.h +++ b/Userland/Libraries/LibGUI/RunningProcessesModel.h @@ -27,7 +27,7 @@ public: virtual int row_count(const GUI::ModelIndex&) const override; virtual int column_count(const GUI::ModelIndex&) const override; - virtual DeprecatedString column_name(int column_index) const override; + virtual String column_name(int column_index) const override; virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override; void update(); diff --git a/Userland/Libraries/LibGUI/SortingProxyModel.cpp b/Userland/Libraries/LibGUI/SortingProxyModel.cpp index 6cb447d7f1..37c8509eff 100644 --- a/Userland/Libraries/LibGUI/SortingProxyModel.cpp +++ b/Userland/Libraries/LibGUI/SortingProxyModel.cpp @@ -106,7 +106,7 @@ ModelIndex SortingProxyModel::map_to_proxy(ModelIndex const& source_index) const return create_index(proxy_row, proxy_column, &mapping); } -DeprecatedString SortingProxyModel::column_name(int column) const +String SortingProxyModel::column_name(int column) const { return source().column_name(column); } diff --git a/Userland/Libraries/LibGUI/SortingProxyModel.h b/Userland/Libraries/LibGUI/SortingProxyModel.h index d0ff9e3a27..84627704f0 100644 --- a/Userland/Libraries/LibGUI/SortingProxyModel.h +++ b/Userland/Libraries/LibGUI/SortingProxyModel.h @@ -24,7 +24,7 @@ public: virtual int tree_column() const override { return m_source->tree_column(); } virtual int row_count(ModelIndex const& = ModelIndex()) const override; virtual int column_count(ModelIndex const& = ModelIndex()) const override; - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual Variant data(ModelIndex const&, ModelRole = ModelRole::Display) const override; virtual void invalidate() override; virtual StringView drag_data_type() const override; diff --git a/Userland/Libraries/LibWebView/StylePropertiesModel.cpp b/Userland/Libraries/LibWebView/StylePropertiesModel.cpp index 8484d115b7..4d903463fd 100644 --- a/Userland/Libraries/LibWebView/StylePropertiesModel.cpp +++ b/Userland/Libraries/LibWebView/StylePropertiesModel.cpp @@ -30,13 +30,13 @@ int StylePropertiesModel::row_count(GUI::ModelIndex const&) const return m_values.size(); } -DeprecatedString StylePropertiesModel::column_name(int column_index) const +String StylePropertiesModel::column_name(int column_index) const { switch (column_index) { case Column::PropertyName: - return "Name"; + return "Name"_short_string; case Column::PropertyValue: - return "Value"; + return "Value"_short_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibWebView/StylePropertiesModel.h b/Userland/Libraries/LibWebView/StylePropertiesModel.h index 839f2be88c..c92070b35d 100644 --- a/Userland/Libraries/LibWebView/StylePropertiesModel.h +++ b/Userland/Libraries/LibWebView/StylePropertiesModel.h @@ -31,7 +31,7 @@ public: virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override; virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Count; } - virtual DeprecatedString column_name(int) const override; + virtual String column_name(int) const override; virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override; virtual bool is_searchable() const override { return true; } virtual Vector matches(StringView, unsigned flags, GUI::ModelIndex const&) override;