summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/MinecraftVersionList.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-03-02 03:03:44 +0100
committerPetr Mrázek <peterix@gmail.com>2016-03-02 09:16:58 +0100
commitb54839b8976b5c1455c838828f2bc92cdeb178eb (patch)
tree35919484c98a541aff87622aef30bee37ef464cf /logic/minecraft/MinecraftVersionList.cpp
parent80b81c2c1e2185b457d167d3d446ac2e1ca95579 (diff)
downloadMultiMC-b54839b8976b5c1455c838828f2bc92cdeb178eb.tar
MultiMC-b54839b8976b5c1455c838828f2bc92cdeb178eb.tar.gz
MultiMC-b54839b8976b5c1455c838828f2bc92cdeb178eb.tar.lz
MultiMC-b54839b8976b5c1455c838828f2bc92cdeb178eb.tar.xz
MultiMC-b54839b8976b5c1455c838828f2bc92cdeb178eb.zip
NOISSUE eliminate timestamp strings
Diffstat (limited to 'logic/minecraft/MinecraftVersionList.cpp')
-rw-r--r--logic/minecraft/MinecraftVersionList.cpp29
1 files changed, 5 insertions, 24 deletions
diff --git a/logic/minecraft/MinecraftVersionList.cpp b/logic/minecraft/MinecraftVersionList.cpp
index 578432cb..507d8254 100644
--- a/logic/minecraft/MinecraftVersionList.cpp
+++ b/logic/minecraft/MinecraftVersionList.cpp
@@ -184,14 +184,7 @@ void MinecraftVersionList::loadBuiltinList()
mcVersion->m_name = mcVersion->m_descriptor = versionID;
// Parse the timestamp.
- if (!parse_timestamp(versionObj.value("releaseTime").toString(""),
- mcVersion->m_releaseTimeString, mcVersion->m_releaseTime))
- {
- qCritical() << "Error while parsing version" << versionID
- << ": invalid version timestamp";
- continue;
- }
-
+ mcVersion->m_releaseTime = timeFromS3Time(versionObj.value("releaseTime").toString(""));
mcVersion->m_versionFileURL = QString();
mcVersion->m_versionSource = Builtin;
mcVersion->m_type = versionTypeStr;
@@ -270,20 +263,8 @@ void MinecraftVersionList::loadMojangList(QJsonDocument jsonDoc, VersionSource s
std::shared_ptr<MinecraftVersion> mcVersion(new MinecraftVersion());
mcVersion->m_name = mcVersion->m_descriptor = versionID;
- if (!parse_timestamp(versionObj.value("releaseTime").toString(""),
- mcVersion->m_releaseTimeString, mcVersion->m_releaseTime))
- {
- qCritical() << "Error while parsing version" << versionID
- << ": invalid release timestamp";
- continue;
- }
- if (!parse_timestamp(versionObj.value("time").toString(""),
- mcVersion->m_updateTimeString, mcVersion->m_updateTime))
- {
- qCritical() << "Error while parsing version" << versionID
- << ": invalid update timestamp";
- continue;
- }
+ mcVersion->m_releaseTime = timeFromS3Time(versionObj.value("releaseTime").toString(""));
+ mcVersion->m_updateTime = timeFromS3Time(versionObj.value("time").toString(""));
if (mcVersion->m_releaseTime < g_VersionFilterData.legacyCutoffDate)
{
@@ -593,8 +574,8 @@ void MinecraftVersionList::saveCachedList()
entryObj.insert("id", mcversion->descriptor());
entryObj.insert("version", mcversion->descriptor());
- entryObj.insert("time", mcversion->m_updateTimeString);
- entryObj.insert("releaseTime", mcversion->m_releaseTimeString);
+ entryObj.insert("time", timeToS3Time(mcversion->m_updateTime));
+ entryObj.insert("releaseTime", timeToS3Time(mcversion->m_releaseTime));
entryObj.insert("url", mcversion->m_versionFileURL);
entryObj.insert("type", mcversion->m_type);
entriesArr.append(entryObj);