diff --git a/Userland/Applications/SoundPlayer/PlaylistWidget.cpp b/Userland/Applications/SoundPlayer/PlaylistWidget.cpp index 3a43ece1ce..fa885144cd 100644 --- a/Userland/Applications/SoundPlayer/PlaylistWidget.cpp +++ b/Userland/Applications/SoundPlayer/PlaylistWidget.cpp @@ -46,7 +46,7 @@ GUI::Variant PlaylistModel::data(const GUI::ModelIndex& index, GUI::ModelRole ro case 4: return m_playlist_items[index.row()].extended_info->album_artist.value_or(""); case 5: - return format_filesize(m_playlist_items[index.row()].extended_info->file_size_in_bytes.value_or(0)); + return human_readable_size(m_playlist_items[index.row()].extended_info->file_size_in_bytes.value_or(0)); } } if (role == GUI::ModelRole::Sort) @@ -57,18 +57,6 @@ GUI::Variant PlaylistModel::data(const GUI::ModelIndex& index, GUI::ModelRole ro return {}; } -DeprecatedString PlaylistModel::format_filesize(u64 size_in_bytes) -{ - if (size_in_bytes > GiB) - return DeprecatedString::formatted("{:.2f} GiB", (double)size_in_bytes / GiB); - else if (size_in_bytes > MiB) - return DeprecatedString::formatted("{:.2f} MiB", (double)size_in_bytes / MiB); - else if (size_in_bytes > KiB) - return DeprecatedString::formatted("{:.2f} KiB", (double)size_in_bytes / KiB); - else - return DeprecatedString::formatted("{} B", size_in_bytes); -} - ErrorOr PlaylistModel::column_name(int column) const { switch (column) { diff --git a/Userland/Applications/SoundPlayer/PlaylistWidget.h b/Userland/Applications/SoundPlayer/PlaylistWidget.h index 2bdf422ebe..a86fb83d8a 100644 --- a/Userland/Applications/SoundPlayer/PlaylistWidget.h +++ b/Userland/Applications/SoundPlayer/PlaylistWidget.h @@ -29,8 +29,6 @@ public: private: Vector m_playlist_items; - - static DeprecatedString format_filesize(u64 size_in_bytes); }; class PlaylistTableView : public GUI::TableView {