aboutsummaryrefslogtreecommitdiff
path: root/logic/updater/NotificationChecker.cpp
diff options
context:
space:
mode:
authorForkk <forkk@forkk.net>2014-01-08 21:45:13 -0600
committerForkk <forkk@forkk.net>2014-01-08 21:45:13 -0600
commit06b5fa5dccdfc54496cd79e6eba6d025bc6e1204 (patch)
tree83d2f49d9e694bdd8f8d2cdd3879e696f435ba10 /logic/updater/NotificationChecker.cpp
parent51817962aa64bc5c084e33fb29a21261d19bc8f3 (diff)
parentb767d4b134148ddb3f956253a2f7f2cad831e782 (diff)
downloadPrismLauncher-06b5fa5dccdfc54496cd79e6eba6d025bc6e1204.tar.gz
PrismLauncher-06b5fa5dccdfc54496cd79e6eba6d025bc6e1204.tar.bz2
PrismLauncher-06b5fa5dccdfc54496cd79e6eba6d025bc6e1204.zip
Merge branch 'release-0.1'
Release MultiMC version 0.1.
Diffstat (limited to 'logic/updater/NotificationChecker.cpp')
-rw-r--r--logic/updater/NotificationChecker.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/logic/updater/NotificationChecker.cpp b/logic/updater/NotificationChecker.cpp
index 40367eac..b2d67632 100644
--- a/logic/updater/NotificationChecker.cpp
+++ b/logic/updater/NotificationChecker.cpp
@@ -5,8 +5,8 @@
#include <QJsonArray>
#include "MultiMC.h"
+#include "MultiMCVersion.h"
#include "logic/net/CacheDownload.h"
-#include "config.h"
NotificationChecker::NotificationChecker(QObject *parent)
: QObject(parent), m_notificationsUrl(QUrl(NOTIFICATION_URL))
@@ -66,7 +66,7 @@ void NotificationChecker::downloadSucceeded(int)
entry.id = obj.value("id").toDouble();
entry.message = obj.value("message").toString();
entry.channel = obj.value("channel").toString();
- entry.buildtype = obj.value("buildtype").toString();
+ entry.platform = obj.value("platform").toString();
entry.from = obj.value("from").toString();
entry.to = obj.value("to").toString();
const QString type = obj.value("type").toString("critical");
@@ -93,13 +93,14 @@ void NotificationChecker::downloadSucceeded(int)
bool NotificationChecker::NotificationEntry::applies() const
{
- bool channelApplies = channel.isEmpty() || channel == VERSION_CHANNEL;
- bool buildtypeApplies = buildtype.isEmpty() || buildtype == VERSION_BUILD_TYPE;
+ MultiMCVersion version = MMC->version();
+ bool channelApplies = channel.isEmpty() || channel == version.channel;
+ bool platformApplies = platform.isEmpty() || platform == version.platform;
bool fromApplies =
from.isEmpty() || from == FULL_VERSION_STR || !versionLessThan(FULL_VERSION_STR, from);
bool toApplies =
to.isEmpty() || to == FULL_VERSION_STR || !versionLessThan(to, FULL_VERSION_STR);
- return channelApplies && buildtypeApplies && fromApplies && toApplies;
+ return channelApplies && platformApplies && fromApplies && toApplies;
}
bool NotificationChecker::NotificationEntry::versionLessThan(const QString &v1,