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.
This commit is contained in:
Dentomologist 2025-03-17 19:14:41 -07:00
parent b7ebd68cdd
commit f14ac36ac8
2 changed files with 6 additions and 3 deletions

View File

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

View File

@ -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<std::chrono::minutes>(total_time);
const auto total_hours = std::chrono::duration_cast<std::chrono::hours>(total_time);
const auto total_seconds = std::chrono::duration_cast<std::chrono::seconds>(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)