summaryrefslogtreecommitdiffstats
path: root/logic/InstanceList.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-07-16 02:03:52 +0200
committerPetr Mrázek <peterix@gmail.com>2014-07-16 02:03:52 +0200
commit8a56ab6780f525472dce4dccdd53fec41390d586 (patch)
treef7d2ecf90a404e3ef0768890c85cb2101d948445 /logic/InstanceList.cpp
parent71575a5022a4e682a9960256ade7ea5672d1210d (diff)
downloadMultiMC-8a56ab6780f525472dce4dccdd53fec41390d586.tar
MultiMC-8a56ab6780f525472dce4dccdd53fec41390d586.tar.gz
MultiMC-8a56ab6780f525472dce4dccdd53fec41390d586.tar.lz
MultiMC-8a56ab6780f525472dce4dccdd53fec41390d586.tar.xz
MultiMC-8a56ab6780f525472dce4dccdd53fec41390d586.zip
Implement gradle spec reader/writer
Diffstat (limited to 'logic/InstanceList.cpp')
-rw-r--r--logic/InstanceList.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/logic/InstanceList.cpp b/logic/InstanceList.cpp
index 8a68c334..650f5c80 100644
--- a/logic/InstanceList.cpp
+++ b/logic/InstanceList.cpp
@@ -331,7 +331,29 @@ QSet<FTBRecord> InstanceList::discoverFTBInstances()
continue;
record.name = attrs.value("name").toString();
record.logo = attrs.value("logo").toString();
- record.mcVersion = attrs.value("mcVersion").toString();
+ auto customVersions = attrs.value("customMCVersions");
+ if(!customVersions.isNull())
+ {
+ QMap<QString, QString> versionMatcher;
+ QString customVersionsStr = customVersions.toString();
+ QStringList list = customVersionsStr.split(';');
+ for(auto item: list)
+ {
+ auto segment = item.split('^');
+ if(segment.size() != 2)
+ {
+ QLOG_ERROR() << "FTB: Segment of size < 2 in " << customVersionsStr;
+ continue;
+ }
+ versionMatcher[segment[0]] = segment[1];
+ }
+ auto actualVersion = attrs.value("version").toString();
+ record.mcVersion = versionMatcher[actualVersion];
+ }
+ else
+ {
+ record.mcVersion = attrs.value("mcVersion").toString();
+ }
record.description = attrs.value("description").toString();
records.insert(record);
}