Update launcher/minecraft/MinecraftInstance.cpp

Co-authored-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Japa <japa4551@protonmail.com>
This commit is contained in:
Japa 2023-04-21 11:18:17 -03:00 committed by GitHub
parent f41426f394
commit 92cda68480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -925,18 +925,10 @@ QString MinecraftInstance::getStatusbarDescription()
if(m_settings->get("ShowGameTime").toBool()) if(m_settings->get("ShowGameTime").toBool())
{ {
if (lastTimePlayed() > 0) { if (lastTimePlayed() > 0) {
struct tm * localTime_format; QDateTime lastLaunchTime = QDateTime::fromMSecsSinceEpoch(lastLaunch());
localTime_format = localtime(lastLaunchTime()); description.append(tr(", last played at %1 for %2")
.arg(QLocale::system().toString(lastLaunchTime, QLocale::ShortFormat))
char lastLaunchTime_formatted[13]; .arg(Time::prettifyDuration(lastTimePlayed())));
strftime(lastLaunchTime_formatted,13,"%Ex",localTime_format);
description.append(
tr(", last played at %1 for %2").arg(
lastLaunchTime_formatted,
Time::prettifyDuration(lastTimePlayed())
)
);
} }
if (totalTimePlayed() > 0) { if (totalTimePlayed() > 0) {