summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-07-20 12:59:44 +0200
committerPetr Mrázek <peterix@gmail.com>2014-07-20 12:59:44 +0200
commit3403553d44ad2ab64d348767aee6c08e7e32b2cb (patch)
tree38bf342a20713044e82e2f715f63e343822076b3
parentce68efa17404f9d11e0ff26d2290c2e5f2efe852 (diff)
downloadMultiMC-3403553d44ad2ab64d348767aee6c08e7e32b2cb.tar
MultiMC-3403553d44ad2ab64d348767aee6c08e7e32b2cb.tar.gz
MultiMC-3403553d44ad2ab64d348767aee6c08e7e32b2cb.tar.lz
MultiMC-3403553d44ad2ab64d348767aee6c08e7e32b2cb.tar.xz
MultiMC-3403553d44ad2ab64d348767aee6c08e7e32b2cb.zip
Fix LWJGL version list loading.
SourceForge has changed its API again.
-rw-r--r--logic/LwjglVersionList.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/logic/LwjglVersionList.cpp b/logic/LwjglVersionList.cpp
index df46d7be..84aaf03d 100644
--- a/logic/LwjglVersionList.cpp
+++ b/logic/LwjglVersionList.cpp
@@ -22,7 +22,7 @@
#include "logger/QsLog.h"
-#define RSS_URL "http://sourceforge.net/api/file/index/project-id/58488/mtime/desc/rss"
+#define RSS_URL "http://sourceforge.net/projects/java-game-lib/rss"
LWJGLVersionList::LWJGLVersionList(QObject *parent) : QAbstractListModel(parent)
{
@@ -84,7 +84,7 @@ void LWJGLVersionList::loadList()
setLoading(true);
auto worker = MMC->qnam();
QNetworkRequest req(QUrl(RSS_URL));
- req.setRawHeader("Accept", "text/xml");
+ req.setRawHeader("Accept", "application/rss+xml, text/xml, */*");
req.setRawHeader("User-Agent", "MultiMC/5.0 (Uncached)");
reply = worker->get(req);
connect(reply, SIGNAL(finished()), SLOT(netRequestComplete()));
@@ -110,7 +110,8 @@ void LWJGLVersionList::netRequestComplete()
QString xmlErrorMsg;
int errorLine;
- if (!doc.setContent(reply->readAll(), false, &xmlErrorMsg, &errorLine))
+ auto rawData = reply->readAll();
+ if (!doc.setContent(rawData, false, &xmlErrorMsg, &errorLine))
{
failed("Failed to load LWJGL list. XML error: " + xmlErrorMsg + " at line " +
QString::number(errorLine));
@@ -146,10 +147,10 @@ void LWJGLVersionList::netRequestComplete()
QUrl url(link);
if (!url.isValid())
{
- QLOG_INFO() << "LWJGL version URL isn't valid:" << link << "Skipping.";
+ QLOG_WARN() << "LWJGL version URL isn't valid:" << link << "Skipping.";
continue;
}
-
+ QLOG_INFO() << "Discovered LWGL version" << name << "at" << link;
tempList.append(LWJGLVersion::Create(name, link));
}
}
@@ -183,7 +184,7 @@ const PtrLWJGLVersion LWJGLVersionList::getVersion(const QString &versionName)
void LWJGLVersionList::failed(QString msg)
{
- QLOG_INFO() << msg;
+ QLOG_ERROR() << msg;
emit loadListFailed(msg);
}