diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-01-29 08:57:38 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-02 00:14:06 +0200 |
commit | 7334b8e5204f76f83409a8e2d48b31b50f86e413 (patch) | |
tree | 62fdf553bc36b0bd43785bbbde165ea2ea2e0cd4 /gui/widgets | |
parent | 791221e923586bb717396ecf18bd13e57034df99 (diff) | |
download | MultiMC-7334b8e5204f76f83409a8e2d48b31b50f86e413.tar MultiMC-7334b8e5204f76f83409a8e2d48b31b50f86e413.tar.gz MultiMC-7334b8e5204f76f83409a8e2d48b31b50f86e413.tar.lz MultiMC-7334b8e5204f76f83409a8e2d48b31b50f86e413.tar.xz MultiMC-7334b8e5204f76f83409a8e2d48b31b50f86e413.zip |
NOISSUE remove status checker from application object
Diffstat (limited to 'gui/widgets')
-rw-r--r-- | gui/widgets/ServerStatus.cpp | 7 | ||||
-rw-r--r-- | gui/widgets/ServerStatus.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/gui/widgets/ServerStatus.cpp b/gui/widgets/ServerStatus.cpp index 93781e1c..a73f499e 100644 --- a/gui/widgets/ServerStatus.cpp +++ b/gui/widgets/ServerStatus.cpp @@ -39,12 +39,13 @@ ServerStatus::ServerStatus(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, setLayout(layout); // Start status checker + m_statusChecker.reset(new StatusChecker()); { - auto reloader = MMC->statusChecker().get(); + auto reloader = m_statusChecker.get(); connect(reloader, &StatusChecker::statusChanged, this, &ServerStatus::StatusChanged); connect(reloader, &StatusChecker::statusLoading, this, &ServerStatus::StatusReloading); connect(m_statusRefresh, &QAbstractButton::clicked, this, &ServerStatus::reloadStatus); - MMC->statusChecker()->startTimer(60000); + m_statusChecker->startTimer(60000); reloadStatus(); } } @@ -55,7 +56,7 @@ ServerStatus::~ServerStatus() void ServerStatus::reloadStatus() { - MMC->statusChecker()->reloadStatus(); + m_statusChecker->reloadStatus(); } void ServerStatus::addLine() diff --git a/gui/widgets/ServerStatus.h b/gui/widgets/ServerStatus.h index 1c6ae428..fdd43677 100644 --- a/gui/widgets/ServerStatus.h +++ b/gui/widgets/ServerStatus.h @@ -8,6 +8,7 @@ class IconLabel; class QToolButton; class QHBoxLayout; +class StatusChecker; class ServerStatus: public QWidget { @@ -32,4 +33,5 @@ private: /* data */ QIcon goodIcon; QIcon yellowIcon; QIcon badIcon; + std::shared_ptr<StatusChecker> m_statusChecker; }; |