NOISSUE remove notification checker form application object

This commit is contained in:
Petr Mrázek 2015-01-29 09:03:11 +01:00
parent 7334b8e520
commit 360ec557b2
4 changed files with 5 additions and 14 deletions

View File

@ -27,7 +27,6 @@
#include "logic/java/JavaUtils.h" #include "logic/java/JavaUtils.h"
#include "logic/updater/UpdateChecker.h" #include "logic/updater/UpdateChecker.h"
#include "logic/updater/NotificationChecker.h"
#include "logic/tools/JProfiler.h" #include "logic/tools/JProfiler.h"
#include "logic/tools/JVisualVM.h" #include "logic/tools/JVisualVM.h"
@ -194,9 +193,6 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar
// initialize the updater // initialize the updater
m_updateChecker.reset(new UpdateChecker()); m_updateChecker.reset(new UpdateChecker());
// initialize the notification checker
m_notificationChecker.reset(new NotificationChecker());
m_translationChecker.reset(new TranslationDownloader()); m_translationChecker.reset(new TranslationDownloader());
// and instances // and instances

View File

@ -19,7 +19,6 @@ class ForgeVersionList;
class LiteLoaderVersionList; class LiteLoaderVersionList;
class JavaVersionList; class JavaVersionList;
class UpdateChecker; class UpdateChecker;
class NotificationChecker;
class BaseProfilerFactory; class BaseProfilerFactory;
class BaseDetachedToolFactory; class BaseDetachedToolFactory;
class TranslationDownloader; class TranslationDownloader;
@ -95,11 +94,6 @@ public:
return m_updateChecker; return m_updateChecker;
} }
std::shared_ptr<NotificationChecker> notificationChecker()
{
return m_notificationChecker;
}
std::shared_ptr<LWJGLVersionList> lwjgllist(); std::shared_ptr<LWJGLVersionList> lwjgllist();
std::shared_ptr<ForgeVersionList> forgelist(); std::shared_ptr<ForgeVersionList> forgelist();
@ -184,7 +178,6 @@ private:
std::shared_ptr<SettingsObject> m_settings; std::shared_ptr<SettingsObject> m_settings;
std::shared_ptr<InstanceList> m_instances; std::shared_ptr<InstanceList> m_instances;
std::shared_ptr<UpdateChecker> m_updateChecker; std::shared_ptr<UpdateChecker> m_updateChecker;
std::shared_ptr<NotificationChecker> m_notificationChecker;
std::shared_ptr<MojangAccountList> m_accounts; std::shared_ptr<MojangAccountList> m_accounts;
std::shared_ptr<IconList> m_icons; std::shared_ptr<IconList> m_icons;
std::shared_ptr<QNetworkAccessManager> m_qnam; std::shared_ptr<QNetworkAccessManager> m_qnam;

View File

@ -622,8 +622,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
auto updater = MMC->updateChecker(); auto updater = MMC->updateChecker();
updater->checkForUpdate(false); updater->checkForUpdate(false);
} }
m_notificationChecker.reset(new NotificationChecker());
connect(MMC->notificationChecker().get(), connect(m_notificationChecker.get(),
&NotificationChecker::notificationCheckFinished, this, &NotificationChecker::notificationCheckFinished, this,
&MainWindow::notificationsChanged); &MainWindow::notificationsChanged);
} }
@ -956,7 +956,7 @@ QString intListToString(const QList<int> &list)
void MainWindow::notificationsChanged() void MainWindow::notificationsChanged()
{ {
QList<NotificationChecker::NotificationEntry> entries = QList<NotificationChecker::NotificationEntry> entries =
MMC->notificationChecker()->notificationEntries(); m_notificationChecker->notificationEntries();
QList<int> shownNotifications = QList<int> shownNotifications =
stringToIntList(MMC->settings()->get("ShownNotifications").toString()); stringToIntList(MMC->settings()->get("ShownNotifications").toString());
for (auto it = entries.begin(); it != entries.end(); ++it) for (auto it = entries.begin(); it != entries.end(); ++it)

View File

@ -25,6 +25,7 @@
#include "logic/net/NetJob.h" #include "logic/net/NetJob.h"
class NewsChecker; class NewsChecker;
class NotificationChecker;
class QToolButton; class QToolButton;
class LabeledToolButton; class LabeledToolButton;
class QLabel; class QLabel;
@ -200,6 +201,7 @@ private:
std::shared_ptr<GenericPageProvider> m_globalSettingsProvider; std::shared_ptr<GenericPageProvider> m_globalSettingsProvider;
std::shared_ptr<NewsChecker> m_newsChecker; std::shared_ptr<NewsChecker> m_newsChecker;
std::shared_ptr<NotificationChecker> m_notificationChecker;
InstancePtr m_selectedInstance; InstancePtr m_selectedInstance;
QString m_currentInstIcon; QString m_currentInstIcon;