This commit is contained in:
Petr Mrázek 2014-05-08 19:00:48 +02:00
parent 0902fd5bec
commit cf616efb5d
2 changed files with 6 additions and 0 deletions

View File

@ -164,6 +164,7 @@ void Mod::ReadMCModInfo(QByteArray contents)
m_name = firstObj.value("name").toString(); m_name = firstObj.value("name").toString();
m_version = firstObj.value("version").toString(); m_version = firstObj.value("version").toString();
m_homeurl = firstObj.value("url").toString(); m_homeurl = firstObj.value("url").toString();
m_updateurl = firstObj.value("updateUrl").toString();
m_homeurl = m_homeurl.trimmed(); m_homeurl = m_homeurl.trimmed();
if(!m_homeurl.isEmpty()) if(!m_homeurl.isEmpty())
{ {
@ -203,6 +204,8 @@ void Mod::ReadMCModInfo(QByteArray contents)
else if (jsonDoc.isObject()) else if (jsonDoc.isObject())
{ {
auto val = jsonDoc.object().value("modinfoversion"); auto val = jsonDoc.object().value("modinfoversion");
if(val.isUndefined())
val = jsonDoc.object().value("modListVersion");
int version = val.toDouble(); int version = val.toDouble();
if (version != 2) if (version != 2)
{ {
@ -211,6 +214,8 @@ void Mod::ReadMCModInfo(QByteArray contents)
return; return;
} }
auto arrVal = jsonDoc.object().value("modlist"); auto arrVal = jsonDoc.object().value("modlist");
if(arrVal.isUndefined())
arrVal = jsonDoc.object().value("modList");
if (arrVal.isArray()) if (arrVal.isArray())
{ {
getInfoFromArray(arrVal.toArray()); getInfoFromArray(arrVal.toArray());

View File

@ -121,6 +121,7 @@ protected:
QString m_version; QString m_version;
QString m_mcversion; QString m_mcversion;
QString m_homeurl; QString m_homeurl;
QString m_updateurl;
QString m_description; QString m_description;
QString m_authors; QString m_authors;
QString m_credits; QString m_credits;