diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 3d97ff2896..eb72097a40 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -2013,7 +2013,7 @@ void game_list_frame::PopulateGameList() m_game_list->setItem(row, gui::column_sound, new custom_table_widget_item(GetStringFromU32(game->info.sound_format, localized.sound.format, true))); m_game_list->setItem(row, gui::column_parental, new custom_table_widget_item(GetStringFromU32(game->info.parental_lvl, localized.parental.level), Qt::UserRole, game->info.parental_lvl)); m_game_list->setItem(row, gui::column_last_play, new custom_table_widget_item(locale.toString(last_played, gui::persistent::last_played_date_format_new), Qt::UserRole, last_played)); - m_game_list->setItem(row, gui::column_playtime, new custom_table_widget_item(localized.GetVerboseTimeByMs(elapsed_ms), Qt::UserRole, elapsed_ms)); + m_game_list->setItem(row, gui::column_playtime, new custom_table_widget_item(elapsed_ms == 0 ? tr("Never played") : localized.GetVerboseTimeByMs(elapsed_ms), Qt::UserRole, elapsed_ms)); m_game_list->setItem(row, gui::column_compat, compat_item); if (selected_item == game->info.path + game->info.icon_path) diff --git a/rpcs3/rpcs3qt/localized.cpp b/rpcs3/rpcs3qt/localized.cpp index 3b4ddadc97..2b4d92cc59 100644 --- a/rpcs3/rpcs3qt/localized.cpp +++ b/rpcs3/rpcs3qt/localized.cpp @@ -4,29 +4,24 @@ Localized::Localized() { } -QString Localized::GetVerboseTimeByMs(qint64 elapsed_ms, bool show_days) const +QString Localized::GetVerboseTimeByMs(quint64 elapsed_ms, bool show_days) const { - if (elapsed_ms <= 0) - { - return tr("Never played"); - } + const quint64 elapsed_seconds = (elapsed_ms / 1000) + ((elapsed_ms % 1000) > 0 ? 1 : 0); + quint64 hours = elapsed_seconds / 3600; - const qint64 elapsed_seconds = (elapsed_ms / 1000) + ((elapsed_ms % 1000) > 0 ? 1 : 0); - qint64 hours = elapsed_seconds / 3600; - - qint64 days = 0; + quint64 days = 0; if (show_days) { days = hours / 24; hours = hours % 24; } - const qint64 minutes = (elapsed_seconds % 3600) / 60; - const qint64 seconds = (elapsed_seconds % 3600) % 60; + const quint64 minutes = (elapsed_seconds % 3600) / 60; + const quint64 seconds = (elapsed_seconds % 3600) % 60; - QString str_days = tr("%Ln day(s)", "", days); - QString str_hours = tr("%Ln hour(s)", "", hours); - QString str_minutes = tr("%Ln minute(s)", "", minutes); - QString str_seconds = tr("%Ln second(s)", "", seconds); + const QString str_days = tr("%Ln day(s)", "", days); + const QString str_hours = tr("%Ln hour(s)", "", hours); + const QString str_minutes = tr("%Ln minute(s)", "", minutes); + const QString str_seconds = tr("%Ln second(s)", "", seconds); if (days != 0) { diff --git a/rpcs3/rpcs3qt/localized.h b/rpcs3/rpcs3qt/localized.h index f357e4f3d7..61d7d393b1 100644 --- a/rpcs3/rpcs3qt/localized.h +++ b/rpcs3/rpcs3qt/localized.h @@ -17,7 +17,7 @@ public: Localized(); - QString GetVerboseTimeByMs(qint64 elapsed_ms, bool show_days = false) const; + QString GetVerboseTimeByMs(quint64 elapsed_ms, bool show_days = false) const; const struct category // (see PARAM.SFO in psdevwiki.com) TODO: Disc Categories { diff --git a/rpcs3/rpcs3qt/update_manager.cpp b/rpcs3/rpcs3qt/update_manager.cpp index 4c3c7a625f..e52f4a7d8e 100644 --- a/rpcs3/rpcs3qt/update_manager.cpp +++ b/rpcs3/rpcs3qt/update_manager.cpp @@ -175,12 +175,24 @@ bool update_manager::handle_json(bool automatic, bool check_only, const QByteArr if (hash_found) { - m_update_message = tr("A new version of RPCS3 is available!\n\nCurrent version: %0 (%1)\nLatest version: %2 (%3)\nYour version is %4 old.\n\nDo you want to update?") - .arg(current["version"].toString()) - .arg(cur_str) - .arg(latest["version"].toString()) - .arg(lts_str) - .arg(localized.GetVerboseTimeByMs(diff_msec, true)); + if (diff_msec < 0) + { + // This usually means that the current version was marked as broken and won't be shipped anymore, so we need to downgrade to avoid certain bugs. + m_update_message = tr("A better version of RPCS3 is available!\n\nCurrent version: %0 (%1)\nBetter version: %2 (%3)\n\nDo you want to update?") + .arg(current["version"].toString()) + .arg(cur_str) + .arg(latest["version"].toString()) + .arg(lts_str); + } + else + { + m_update_message = tr("A new version of RPCS3 is available!\n\nCurrent version: %0 (%1)\nLatest version: %2 (%3)\nYour version is %4 old.\n\nDo you want to update?") + .arg(current["version"].toString()) + .arg(cur_str) + .arg(latest["version"].toString()) + .arg(lts_str) + .arg(localized.GetVerboseTimeByMs(diff_msec, true)); + } } else {