diff options
author | Forkk <forkk@forkk.net> | 2014-01-07 18:09:05 -0600 |
---|---|---|
committer | Forkk <forkk@forkk.net> | 2014-01-07 18:09:05 -0600 |
commit | 3202b972f8dac05d4464eb46724b1bd703b9b21d (patch) | |
tree | 05d63b3945d8057d86fec899b9bd0dc533ee82ac /logic | |
parent | 28cb66e85cad786f08b40cf242cb17a70d9e7432 (diff) | |
download | MultiMC-3202b972f8dac05d4464eb46724b1bd703b9b21d.tar MultiMC-3202b972f8dac05d4464eb46724b1bd703b9b21d.tar.gz MultiMC-3202b972f8dac05d4464eb46724b1bd703b9b21d.tar.lz MultiMC-3202b972f8dac05d4464eb46724b1bd703b9b21d.tar.xz MultiMC-3202b972f8dac05d4464eb46724b1bd703b9b21d.zip |
Rework version numbering system.
Again...
Diffstat (limited to 'logic')
-rw-r--r-- | logic/updater/NotificationChecker.cpp | 11 | ||||
-rw-r--r-- | logic/updater/NotificationChecker.h | 2 |
2 files changed, 7 insertions, 6 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, diff --git a/logic/updater/NotificationChecker.h b/logic/updater/NotificationChecker.h index 20541757..915ee54d 100644 --- a/logic/updater/NotificationChecker.h +++ b/logic/updater/NotificationChecker.h @@ -26,7 +26,7 @@ public: Information } type; QString channel; - QString buildtype; + QString platform; QString from; QString to; bool applies() const; |