This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2501716
commit 0fc71a6
Showing
4 changed files
with
123 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#include "systemname.h" | ||
|
||
#include <QSysInfo> | ||
#ifdef MOBILITY_READY | ||
#include <QSystemDeviceInfo> | ||
|
||
QTM_USE_NAMESPACE | ||
#endif | ||
|
||
QString deviceName() | ||
{ | ||
#ifdef MOBILITY_READY | ||
QSystemDeviceInfo info; | ||
return info.manufacturer() + " " + info.model(); | ||
#else | ||
return osName().append("-based Device"); | ||
#endif | ||
} | ||
|
||
QString osName() | ||
{ | ||
#if defined(Q_OS_ANDROID) | ||
return "Android"; | ||
#elif defined(Q_OS_SYMBIAN) | ||
switch (QSysInfo::symbianVersion()) { | ||
case QSysInfo::SV_9_2: | ||
return "Symbian OS v9.2"; | ||
case QSysInfo::SV_9_3: | ||
return "Symbian OS v9.3"; | ||
case QSysInfo::SV_9_4: | ||
return "Symbian OS v9.4"; | ||
case QSysInfo::SV_SF_1: | ||
return "S60 5th Edition"; | ||
case QSysInfo::SV_SF_2: | ||
return "Symbian^2"; | ||
case QSysInfo::SV_SF_3: | ||
return "Symbian^3"; | ||
case QSysInfo::SV_SF_4: | ||
return "Symbian^4"; | ||
case QSysInfo::SV_API_5_3: | ||
return "S60 API v5.3"; | ||
case QSysInfo::SV_API_5_4: | ||
return "S60 API v5.4"; | ||
default: | ||
return "Symbian"; | ||
} | ||
#elif defined(Q_OS_BLACKBERRY) | ||
return "Blackberry OS"; | ||
#elif defined(Q_OS_IOS) | ||
return "iOS"; | ||
#elif defined(Q_OS_MACOS) | ||
//TODO: QSysInfo version | ||
return "macOS"; | ||
#elif defined(Q_OS_WIN) | ||
switch (QSysInfo::windowsVersion()) { | ||
case QSysInfo::WV_32s: | ||
return "Windows 3.1 with Win32s"; | ||
case QSysInfo::WV_95: | ||
return "Windows 95"; | ||
case QSysInfo::WV_98: | ||
return "Windows 98"; | ||
case QSysInfo::WV_Me: | ||
return "Windows Me"; | ||
case QSysInfo::WV_NT: | ||
return "Windows NT"; | ||
case QSysInfo::WV_2000: | ||
return "Windows 2000"; | ||
case QSysInfo::WV_XP: | ||
return "Windows XP"; | ||
case QSysInfo::WV_2003: | ||
return "Windows 2003"; | ||
case QSysInfo::WV_VISTA: | ||
return "Windows Vista"; | ||
case QSysInfo::WV_WINDOWS7: | ||
return "Windows 7"; | ||
case QSysInfo::WV_CE: | ||
return "Windows CE"; | ||
case QSysInfo::WV_CENET: | ||
return "Windows CE .NET"; | ||
case QSysInfo::WV_CE_5: | ||
return "Windows CE 5"; | ||
case QSysInfo::WV_CE_6: | ||
return "Windows CE 6"; | ||
default: | ||
#ifdef defined(Q_OS_WINCE) | ||
return "Windows CE"; | ||
#else | ||
return "Windows"; | ||
#endif | ||
} | ||
#elif defined(Q_OS_LINUX) | ||
return "Linux"; | ||
#elif defined(Q_OS_UNIX) | ||
return "Unix"; | ||
#else | ||
//TODO: more systems macros | ||
return "Unknown"; | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef SYSTEMNAME_H | ||
#define SYSTEMNAME_H | ||
|
||
#include <QString> | ||
|
||
QString osName(); | ||
QString deviceName(); | ||
|
||
#endif // SYSTEMNAME_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters