Instance Description displays the last launch date

Initial Draft using the Standard C++ Library, still requires testing.

Signed-off-by: Japa <japa4551@protonmail.com>
This commit is contained in:
Japa 2023-04-21 00:30:38 -03:00 committed by GitHub
parent 8dc3267925
commit f41426f394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -925,7 +925,18 @@ QString MinecraftInstance::getStatusbarDescription()
if(m_settings->get("ShowGameTime").toBool())
{
if (lastTimePlayed() > 0) {
description.append(tr(", last played for %1").arg(Time::prettifyDuration(lastTimePlayed())));
struct tm * localTime_format;
localTime_format = localtime(lastLaunchTime());
char lastLaunchTime_formatted[13];
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) {