NOISSUE remove status checker from application object

This commit is contained in:
Petr Mrázek
2015-01-29 08:57:38 +01:00
parent 791221e923
commit 7334b8e520
5 changed files with 6 additions and 17 deletions

View File

@ -373,8 +373,6 @@ namespace Ui {
#include "logic/news/NewsChecker.h"
#include "logic/status/StatusChecker.h"
#include "logic/net/URLConstants.h"
#include "logic/net/NetJob.h"

View File

@ -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()

View File

@ -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;
};