NOISSUE remove status checker from application object
This commit is contained in:
		@@ -21,8 +21,6 @@
 | 
			
		||||
 | 
			
		||||
#include "logic/forge/ForgeVersionList.h"
 | 
			
		||||
 | 
			
		||||
#include "logic/status/StatusChecker.h"
 | 
			
		||||
 | 
			
		||||
#include "logic/net/HttpMetaCache.h"
 | 
			
		||||
#include "logic/net/URLConstants.h"
 | 
			
		||||
 | 
			
		||||
@@ -199,9 +197,6 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar
 | 
			
		||||
	// initialize the notification checker
 | 
			
		||||
	m_notificationChecker.reset(new NotificationChecker());
 | 
			
		||||
 | 
			
		||||
	// initialize the status checker
 | 
			
		||||
	m_statusChecker.reset(new StatusChecker());
 | 
			
		||||
 | 
			
		||||
	m_translationChecker.reset(new TranslationDownloader());
 | 
			
		||||
 | 
			
		||||
	// and instances
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,6 @@ class LiteLoaderVersionList;
 | 
			
		||||
class JavaVersionList;
 | 
			
		||||
class UpdateChecker;
 | 
			
		||||
class NotificationChecker;
 | 
			
		||||
class StatusChecker;
 | 
			
		||||
class BaseProfilerFactory;
 | 
			
		||||
class BaseDetachedToolFactory;
 | 
			
		||||
class TranslationDownloader;
 | 
			
		||||
@@ -101,11 +100,6 @@ public:
 | 
			
		||||
		return m_notificationChecker;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	std::shared_ptr<StatusChecker> statusChecker()
 | 
			
		||||
	{
 | 
			
		||||
		return m_statusChecker;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	std::shared_ptr<LWJGLVersionList> lwjgllist();
 | 
			
		||||
 | 
			
		||||
	std::shared_ptr<ForgeVersionList> forgelist();
 | 
			
		||||
@@ -191,7 +185,6 @@ private:
 | 
			
		||||
	std::shared_ptr<InstanceList> m_instances;
 | 
			
		||||
	std::shared_ptr<UpdateChecker> m_updateChecker;
 | 
			
		||||
	std::shared_ptr<NotificationChecker> m_notificationChecker;
 | 
			
		||||
	std::shared_ptr<StatusChecker> m_statusChecker;
 | 
			
		||||
	std::shared_ptr<MojangAccountList> m_accounts;
 | 
			
		||||
	std::shared_ptr<IconList> m_icons;
 | 
			
		||||
	std::shared_ptr<QNetworkAccessManager> m_qnam;
 | 
			
		||||
 
 | 
			
		||||
@@ -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"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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()
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user