Merge branch 'develop'

This commit is contained in:
Petr Mrázek 2013-11-06 21:03:22 +01:00
commit cc6e9358fe
2 changed files with 18 additions and 15 deletions

View File

@ -204,7 +204,7 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap)
// if the root of the json wasn't an object, fail // if the root of the json wasn't an object, fail
if (!jsonDoc.isObject()) if (!jsonDoc.isObject())
{ {
qWarning("Invalid group file. Root entry should be an object."); QLOG_WARN() << "Invalid group file. Root entry should be an object.";
return; return;
} }
@ -217,7 +217,7 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap)
// Get the groups. if it's not an object, fail // Get the groups. if it's not an object, fail
if (!rootObj.value("groups").isObject()) if (!rootObj.value("groups").isObject())
{ {
qWarning("Invalid group list JSON: 'groups' should be an object."); QLOG_WARN() << "Invalid group list JSON: 'groups' should be an object.";
return; return;
} }
@ -230,21 +230,21 @@ void InstanceList::loadGroupList(QMap<QString, QString> &groupMap)
// If not an object, complain and skip to the next one. // If not an object, complain and skip to the next one.
if (!iter.value().isObject()) if (!iter.value().isObject())
{ {
qWarning(QString("Group '%1' in the group list should " QLOG_WARN() << QString("Group '%1' in the group list should "
"be an object.") "be an object.")
.arg(groupName) .arg(groupName)
.toUtf8()); .toUtf8();
continue; continue;
} }
QJsonObject groupObj = iter.value().toObject(); QJsonObject groupObj = iter.value().toObject();
if (!groupObj.value("instances").isArray()) if (!groupObj.value("instances").isArray())
{ {
qWarning(QString("Group '%1' in the group list is invalid. " QLOG_WARN() << QString("Group '%1' in the group list is invalid. "
"It should contain an array " "It should contain an array "
"called 'instances'.") "called 'instances'.")
.arg(groupName) .arg(groupName)
.toUtf8()); .toUtf8();
continue; continue;
} }

View File

@ -83,7 +83,10 @@ void LWJGLVersionList::loadList()
setLoading(true); setLoading(true);
auto worker = MMC->qnam(); auto worker = MMC->qnam();
reply = worker->get(QNetworkRequest(QUrl(RSS_URL))); QNetworkRequest req(QUrl(RSS_URL));
req.setRawHeader("Accept", "text/xml");
req.setRawHeader("User-Agent", "MultiMC/5.0 (Uncached)");
reply = worker->get(req);
connect(reply, SIGNAL(finished()), SLOT(netRequestComplete())); connect(reply, SIGNAL(finished()), SLOT(netRequestComplete()));
} }
@ -127,7 +130,7 @@ void LWJGLVersionList::netRequestComplete()
QDomElement linkElement = getDomElementByTagName(items.at(i).toElement(), "link"); QDomElement linkElement = getDomElementByTagName(items.at(i).toElement(), "link");
if (linkElement.isNull()) if (linkElement.isNull())
{ {
qWarning() << "Link element" << i << "in RSS feed doesn't exist! Skipping."; QLOG_INFO() << "Link element" << i << "in RSS feed doesn't exist! Skipping.";
continue; continue;
} }
@ -143,7 +146,7 @@ void LWJGLVersionList::netRequestComplete()
QUrl url(link); QUrl url(link);
if (!url.isValid()) if (!url.isValid())
{ {
qWarning() << "LWJGL version URL isn't valid:" << link << "Skipping."; QLOG_INFO() << "LWJGL version URL isn't valid:" << link << "Skipping.";
continue; continue;
} }
@ -180,7 +183,7 @@ const PtrLWJGLVersion LWJGLVersionList::getVersion(const QString &versionName)
void LWJGLVersionList::failed(QString msg) void LWJGLVersionList::failed(QString msg)
{ {
qWarning() << msg; QLOG_INFO() << msg;
emit loadListFailed(msg); emit loadListFailed(msg);
} }