diff --git a/pcsx2-qt/GameList/GameListModel.cpp b/pcsx2-qt/GameList/GameListModel.cpp index 9c8d4c89b5..3f5ebb9e88 100644 --- a/pcsx2-qt/GameList/GameListModel.cpp +++ b/pcsx2-qt/GameList/GameListModel.cpp @@ -215,20 +215,6 @@ int GameListModel::columnCount(const QModelIndex& parent) const return parent.isValid() ? 0 : Column_Count; } -QString GameListModel::formatTimespan(const time_t timespan) -{ - // Avoid an extra string conversion over calling QString::fromStdString(GameList::FormatTimespan). - const u32 hours = static_cast(timespan / 3600); - if (hours > 0) - return qApp->translate("GameList", "%n hours", "", hours); - - const u32 minutes = static_cast((timespan % 3600) / 60); - if (minutes > 0) - return qApp->translate("GameList", "%n minutes", "", minutes); - else - return qApp->translate("GameList", "%n seconds", "", static_cast((timespan % 3600) % 60)); -} - QVariant GameListModel::data(const QModelIndex& index, const int role) const { if (!index.isValid()) @@ -267,7 +253,7 @@ QVariant GameListModel::data(const QModelIndex& index, const int role) const return QString::fromStdString(fmt::format("{:08X}", ge->crc)); case Column_TimePlayed: - return ge->total_played_time ? formatTimespan(ge->total_played_time) : QVariant(); + return QString::fromStdString(GameList::FormatTimespan(ge->total_played_time)); case Column_LastPlayed: return QString::fromStdString(GameList::FormatTimestamp(ge->last_played_time)); diff --git a/pcsx2-qt/GameList/GameListModel.h b/pcsx2-qt/GameList/GameListModel.h index 921914c810..de786a60f0 100644 --- a/pcsx2-qt/GameList/GameListModel.h +++ b/pcsx2-qt/GameList/GameListModel.h @@ -90,8 +90,6 @@ private: void loadOrGenerateCover(const GameList::Entry* ge); void invalidateCoverForPath(const std::string& path); - static QString formatTimespan(const time_t timespan); - float m_cover_scale = 0.0f; std::atomic m_cover_scale_counter{0}; bool m_show_titles_for_covers = false;