|
|
@ -223,18 +223,20 @@ bool Config::LauncherSettings::isEqual(const QStringList& list1, const QStringLi
|
|
|
|
QString Config::LauncherSettings::makeNewContentListName()
|
|
|
|
QString Config::LauncherSettings::makeNewContentListName()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// basically, use date and time as the name e.g. YYYY-MM-DDThh:mm:ss
|
|
|
|
// basically, use date and time as the name e.g. YYYY-MM-DDThh:mm:ss
|
|
|
|
time_t rawtime;
|
|
|
|
auto rawtime = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
|
|
|
|
struct tm* timeinfo;
|
|
|
|
tm timeinfo{};
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
time(&rawtime);
|
|
|
|
(void)localtime_s(&timeinfo, &rawtime);
|
|
|
|
timeinfo = localtime(&rawtime);
|
|
|
|
#else
|
|
|
|
|
|
|
|
(void)localtime_r(&rawtime, &timeinfo);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
int base = 10;
|
|
|
|
int base = 10;
|
|
|
|
QChar zeroPad('0');
|
|
|
|
QChar zeroPad('0');
|
|
|
|
return QString("%1-%2-%3T%4:%5:%6")
|
|
|
|
return QString("%1-%2-%3T%4:%5:%6")
|
|
|
|
.arg(timeinfo->tm_year + 1900, 4)
|
|
|
|
.arg(timeinfo.tm_year + 1900, 4)
|
|
|
|
.arg(timeinfo->tm_mon + 1, 2, base, zeroPad)
|
|
|
|
.arg(timeinfo.tm_mon + 1, 2, base, zeroPad)
|
|
|
|
.arg(timeinfo->tm_mday, 2, base, zeroPad)
|
|
|
|
.arg(timeinfo.tm_mday, 2, base, zeroPad)
|
|
|
|
.arg(timeinfo->tm_hour, 2, base, zeroPad)
|
|
|
|
.arg(timeinfo.tm_hour, 2, base, zeroPad)
|
|
|
|
.arg(timeinfo->tm_min, 2, base, zeroPad)
|
|
|
|
.arg(timeinfo.tm_min, 2, base, zeroPad)
|
|
|
|
.arg(timeinfo->tm_sec, 2, base, zeroPad);
|
|
|
|
.arg(timeinfo.tm_sec, 2, base, zeroPad);
|
|
|
|
}
|
|
|
|
}
|
|
|
|