GH-2124 First complete implementation, installing is working now! GH-2172 Added sorting

This commit is contained in:
Janrupf 2018-03-03 21:22:00 +01:00
parent 2d295d5afb
commit b8ca36372b
16 changed files with 498 additions and 169 deletions

View file

@ -58,6 +58,26 @@ void FtbPackFetchTask::fileDownloadFinished(){
modpack.mods = element.attribute("mods");
modpack.image = element.attribute("image");
modpack.oldVersions = element.attribute("oldVersions").split(";");
//remove empty if the xml is bugged
for(QString curr : modpack.oldVersions) {
if(curr.isNull() || curr.isEmpty()) {
modpack.oldVersions.removeAll(curr);
modpack.bugged = true;
qWarning() << "Removed some empty versions from" << modpack.name;
}
}
if(modpack.oldVersions.size() < 1) {
if(!modpack.currentVersion.isNull() && !modpack.currentVersion.isEmpty()) {
modpack.oldVersions.append(modpack.currentVersion);
qWarning() << "Added current version to oldVersions because oldVersions was empty! (" + modpack.name + ")";
} else {
modpack.broken = true;
qWarning() << "Broken pack:" << modpack.name << " => No valid version!";
}
}
modpack.author = element.attribute("author");
modpack.dir = element.attribute("dir");
@ -66,6 +86,7 @@ void FtbPackFetchTask::fileDownloadFinished(){
modpackList.append(modpack);
}
emit finished(modpackList);
}