From 27b1de0d6d196d9d0f6c284e0cb772c077688c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 23 Jun 2013 22:10:32 +0200 Subject: Implement some bits and pieces, disable dead buttons. --- libmultimc/src/minecraftversionlist.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'libmultimc/src/minecraftversionlist.cpp') diff --git a/libmultimc/src/minecraftversionlist.cpp b/libmultimc/src/minecraftversionlist.cpp index 71deb471..17737b1e 100644 --- a/libmultimc/src/minecraftversionlist.cpp +++ b/libmultimc/src/minecraftversionlist.cpp @@ -200,6 +200,7 @@ void MCVListLoadTask::setSubStatus(const QString msg) setStatus("Loading instance version list: " + msg); } +// FIXME: we should have a local cache of the version list and a local cache of version data bool MCVListLoadTask::loadFromVList() { QNetworkReply *vlistReply = netMgr->get(QNetworkRequest(QUrl(QString(MCVLIST_URLBASE) + @@ -276,10 +277,15 @@ bool MCVListLoadTask::loadFromVList() else versionType = MinecraftVersion::Stable; } - else + else if(versionTypeStr == "snapshot") { versionType = MinecraftVersion::Snapshot; } + else + { + // we don't know what to do with this... + continue; + } // Get the download URL. QString dlUrl = QString(MCVLIST_URLBASE) + versionID + "/"; @@ -289,7 +295,7 @@ bool MCVListLoadTask::loadFromVList() MinecraftVersion *mcVersion = new MinecraftVersion( versionID, versionID, versionTime.toMSecsSinceEpoch(), dlUrl, ""); - mcVersion->setIsForNewLauncher(true); + mcVersion->setLauncherVersion(MinecraftVersion::Launcher16); mcVersion->setVersionType(versionType); tempList.append(mcVersion); } @@ -340,7 +346,7 @@ bool MCVListLoadTask::loadFromAssets() QDomNodeList contents = doc.elementsByTagName("Contents"); QRegExp mcRegex("/minecraft.jar$"); - QRegExp snapshotRegex("[0-9][0-9]w[0-9][0-9][a-z]|pre|rc"); + QRegExp snapshotRegex("[0-9][0-9]w[0-9][0-9][a-z]?|pre|rc"); for (int i = 0; i < contents.length(); i++) { @@ -443,6 +449,8 @@ bool MCVListLoadTask::loadMCNostalgia() { QNetworkReply *mcnReply = netMgr->get(QNetworkRequest(QUrl(QString(MCN_URLBASE) + "?pversion=1&list=True"))); NetUtils::waitForNetRequest(mcnReply); + processedMCNReply = true; + updateStuff(); return true; } -- cgit v1.2.3