From f14ac36ac894a0ec3198c799574b9344946683ca Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Mon, 17 Mar 2025 19:14:41 -0700 Subject: [PATCH] REVIEW COMMIT Update every 10 seconds and display seconds in GameList to make it easier to test the timing changes. Will delete this commit before merging. --- Source/Core/Core/HW/CPU.cpp | 2 +- Source/Core/DolphinQt/GameList/GameListModel.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/HW/CPU.cpp b/Source/Core/Core/HW/CPU.cpp index 6b76e3199c..08eda74e9f 100644 --- a/Source/Core/Core/HW/CPU.cpp +++ b/Source/Core/Core/HW/CPU.cpp @@ -79,7 +79,7 @@ void CPUManager::StartTimePlayedTimer() while (m_state != State::PowerDown) { - m_time_played_finish_sync.WaitFor(std::chrono::seconds(30)); + m_time_played_finish_sync.WaitFor(std::chrono::seconds(10)); auto curr_time = timer.now(); const std::string game_id = SConfig::GetInstance().GetGameID(); diff --git a/Source/Core/DolphinQt/GameList/GameListModel.cpp b/Source/Core/DolphinQt/GameList/GameListModel.cpp index e0961c47ba..6d2363e0ed 100644 --- a/Source/Core/DolphinQt/GameList/GameListModel.cpp +++ b/Source/Core/DolphinQt/GameList/GameListModel.cpp @@ -222,10 +222,13 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const const std::chrono::milliseconds total_time = m_time_played_manager.GetTimePlayed(game_id); const auto total_minutes = std::chrono::duration_cast(total_time); const auto total_hours = std::chrono::duration_cast(total_time); + const auto total_seconds = std::chrono::duration_cast(total_time); // i18n: A time displayed as hours and minutes - QString formatted_time = - tr("%1h %2m").arg(total_hours.count()).arg(total_minutes.count() % 60); + QString formatted_time = tr("%1h %2m %3s") + .arg(total_hours.count()) + .arg(total_minutes.count() % 60) + .arg(total_seconds.count() % 60); return formatted_time; } if (role == SORT_ROLE)