summaryrefslogtreecommitdiffstats
path: root/logic/Mod.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-29 04:17:52 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-29 04:17:52 +0100
commit654f444f55de58f5cf0477e3b08b8f18e8d60831 (patch)
treecc1c3fb3647502a85ac6a4bcb7a9ba5a9b0c324e /logic/Mod.cpp
parentfbf1cc2848d0e985ba72b1fe9625bc88b5fe2208 (diff)
downloadMultiMC-654f444f55de58f5cf0477e3b08b8f18e8d60831.tar
MultiMC-654f444f55de58f5cf0477e3b08b8f18e8d60831.tar.gz
MultiMC-654f444f55de58f5cf0477e3b08b8f18e8d60831.tar.lz
MultiMC-654f444f55de58f5cf0477e3b08b8f18e8d60831.tar.xz
MultiMC-654f444f55de58f5cf0477e3b08b8f18e8d60831.zip
Fix various LiteLoader related bugs.
Diffstat (limited to 'logic/Mod.cpp')
-rw-r--r--logic/Mod.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/logic/Mod.cpp b/logic/Mod.cpp
index 009a32a4..6732446d 100644
--- a/logic/Mod.cpp
+++ b/logic/Mod.cpp
@@ -227,11 +227,18 @@ void Mod::ReadLiteModInfo(QByteArray contents)
QJsonParseError jsonError;
QJsonDocument jsonDoc = QJsonDocument::fromJson(contents, &jsonError);
auto object = jsonDoc.object();
- m_mod_id = object.value("name").toString();
+ if(object.contains("name"))
+ {
+ m_mod_id = m_name = object.value("name").toString();
+ }
if(object.contains("version"))
+ {
m_version=object.value("version").toString("");
+ }
else
+ {
m_version=object.value("revision").toString("");
+ }
m_mcversion = object.value("mcversion").toString();
m_authors = object.value("author").toString();
m_description = object.value("description").toString();