1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:57:45 +00:00

Userland: Port Model::column_name() to String

This commit is contained in:
Karol Kosek 2023-05-14 19:02:08 +02:00 committed by Andreas Kling
parent 741f07dedf
commit 945f05ed76
70 changed files with 218 additions and 222 deletions

View file

@ -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();
}

View file

@ -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<M3UEntry>& items() { return m_playlist_items; }
private: