|
|
@@ -1,11 +1,26 @@
|
|
|
#include "sysinfo.h"
|
|
|
|
|
|
-SysInfo::SysInfo()
|
|
|
-{
|
|
|
+#include <QtGlobal>
|
|
|
|
|
|
+#ifdef Q_OS_WIN
|
|
|
+#include "sysinfowindowsimpl.h"
|
|
|
+#elif defined(Q_OS_MAC)
|
|
|
+#include "sysinfomacimpl.h"
|
|
|
+#elif defined(Q_IS_LINUX)
|
|
|
+#include "sysinfolinuximpl.h"
|
|
|
+#endif
|
|
|
+
|
|
|
+SysInfo &SysInfo::instance() {
|
|
|
+#ifdef Q_OS_WIN
|
|
|
+ static SysInfoWindowsImpl singleton;
|
|
|
+#elif defined(Q_OS_MAC)
|
|
|
+ static SysInfoMacImpl singleton;
|
|
|
+#elif defined(Q_OS_LINUX)
|
|
|
+ static SysInfoLinuxImpl singleton;
|
|
|
+#endif
|
|
|
+ return singleton;
|
|
|
}
|
|
|
|
|
|
-SysInfo::~SysInfo()
|
|
|
-{
|
|
|
+SysInfo::SysInfo() {}
|
|
|
|
|
|
-}
|
|
|
+SysInfo::~SysInfo() {}
|