From a1abbd9e05c80584d831b1d12c27c5f7d731cece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 28 May 2016 19:54:17 +0200 Subject: NOISSUE refactor *Download into more, smaller pieces * Download is now Download. * Download uses Sink subclasses to process various events. * Validators can be used to further customize the Sink behaviour. --- api/logic/notifications/NotificationChecker.cpp | 7 +++---- api/logic/notifications/NotificationChecker.h | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'api/logic/notifications') diff --git a/api/logic/notifications/NotificationChecker.cpp b/api/logic/notifications/NotificationChecker.cpp index ab2570b7..6d006c31 100644 --- a/api/logic/notifications/NotificationChecker.cpp +++ b/api/logic/notifications/NotificationChecker.cpp @@ -6,7 +6,7 @@ #include #include "Env.h" -#include "net/CacheDownload.h" +#include "net/Download.h" NotificationChecker::NotificationChecker(QObject *parent) @@ -55,9 +55,8 @@ void NotificationChecker::checkForNotifications() m_checkJob.reset(new NetJob("Checking for notifications")); auto entry = ENV.metacache()->resolveEntry("root", "notifications.json"); entry->setStale(true); - m_checkJob->addNetAction(m_download = CacheDownload::make(m_notificationsUrl, entry)); - connect(m_download.get(), &CacheDownload::succeeded, this, - &NotificationChecker::downloadSucceeded); + m_checkJob->addNetAction(m_download = Net::Download::makeCached(m_notificationsUrl, entry)); + connect(m_download.get(), &Net::Download::succeeded, this, &NotificationChecker::downloadSucceeded); m_checkJob->start(); } diff --git a/api/logic/notifications/NotificationChecker.h b/api/logic/notifications/NotificationChecker.h index a2d92ab9..c8e831d5 100644 --- a/api/logic/notifications/NotificationChecker.h +++ b/api/logic/notifications/NotificationChecker.h @@ -3,7 +3,7 @@ #include #include "net/NetJob.h" -#include "net/CacheDownload.h" +#include "net/Download.h" #include "multimc_logic_export.h" @@ -55,7 +55,7 @@ private: QList m_entries; QUrl m_notificationsUrl; NetJobPtr m_checkJob; - CacheDownloadPtr m_download; + Net::Download::Ptr m_download; QString m_appVersionChannel; QString m_appPlatform; -- cgit v1.2.3