hyperion.ng/libsrc/utils/SysInfo.cpp
Murat Seker 458113f8f9
refactor: Improve utils code style (#841)
* Improve utils code style

* Fix indendation

Co-authored-by: brindosch <edeltraud70@gmx.de>
2020-06-28 23:12:22 +02:00

33 lines
838 B
C++

#include "utils/SysInfo.h"
#include <QHostInfo>
#include <QSysInfo>
SysInfo* SysInfo::_instance = nullptr;
SysInfo::SysInfo()
: QObject()
{
_sysinfo.kernelType = QSysInfo::kernelType();
_sysinfo.kernelVersion = QSysInfo::kernelVersion();
_sysinfo.architecture = QSysInfo::currentCpuArchitecture();
_sysinfo.wordSize = QString::number(QSysInfo::WordSize);
_sysinfo.productType = QSysInfo::productType();
_sysinfo.productVersion = QSysInfo::productVersion();
_sysinfo.prettyName = QSysInfo::prettyProductName();
_sysinfo.hostName = QHostInfo::localHostName();
_sysinfo.domainName = QHostInfo::localDomainName();
}
SysInfo::~SysInfo()
{
}
SysInfo::HyperionSysInfo SysInfo::get()
{
if (SysInfo::_instance == nullptr)
SysInfo::_instance = new SysInfo();
return SysInfo::_instance->_sysinfo;
}