mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 09:17:45 +00:00
Userland: Port Model::column_name()
to String
This commit is contained in:
parent
741f07dedf
commit
945f05ed76
70 changed files with 218 additions and 222 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 {};
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 {};
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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 {};
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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 {};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 {};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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 {};
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue