55 qWarning()<<
KLF_FUNC_NAME<<
": Invalid sysarch string "<<sysarch;
59 if (thisos != sysarch.
left(ic)) {
60 klfDbg(
"incompatible architectures (this one)="<<thisos<<
" and (tested)="<<sysarch) ;
65 klfDbg(
"testing if our arch="<<thisarch<<
" is in the compatible arch list="<<archlist) ;
71#if defined(Q_OS_LINUX)
73#elif defined(Q_OS_DARWIN)
75#elif defined(Q_OS_WIN32)
91 qWarning(
"KLFSysInfo::osString: unknown OS: %d", sysos);
100#elif defined(Q_OS_LINUX)
104#elif defined(Q_OS_WIN32)
116#if defined(Q_OS_DARWIN)
118#elif defined(Q_OS_LINUX)
120#elif defined(Q_OS_WIN32)
128static int _klf_cached_islaptop = -1;
132 if (_klf_cached_islaptop >= 0)
133 return (
bool) _klf_cached_islaptop;
135#if defined(Q_OS_DARWIN)
137#elif defined(Q_OS_LINUX)
139#elif defined(Q_OS_WIN32)
145 return (
bool) _klf_cached_islaptop;
150#if defined(Q_OS_DARWIN)
152#elif defined(Q_OS_LINUX)
154#elif defined(Q_OS_WIN32)
#define KLF_DEBUG_TEE(expr)
Print the value of expression and return it.
#define klfDbg(streamableItems)
print debug stream items
Base declarations for klatexformula and some utilities.
KLF_EXPORT bool _klf_linux_is_laptop()
KLF_EXPORT bool _klf_linux_is_on_battery_power()
KLF_EXPORT KLFSysInfo::BatteryInfo _klf_linux_battery_info(bool want_info_onbatterypower)
KLF_EXPORT bool _klf_mac_is_on_battery_power()
KLF_EXPORT KLFSysInfo::BatteryInfo _klf_mac_battery_info()
KLF_EXPORT bool _klf_mac_is_laptop()
KLF_EXPORT bool _klf_win_is_on_battery_power()
KLF_EXPORT KLFSysInfo::BatteryInfo _klf_win_battery_info()
KLF_EXPORT bool _klf_win_is_laptop()
KLFSysInfo::BatteryInfo _klf_otheros_battery_info()
bool _klf_otheros_is_on_battery_power()
bool _klf_otheros_is_laptop()
QString klf_defs_sysinfo_arch()
KLF_EXPORT QString osString(KLFSysInfo::Os sysos=os())
The operating system we are running, returned as a string.
Os
List of known operating systems.
@ MacOsX
systems on which Q_OS_DARWIN is defined
@ Win32
systems on which Q_OS_WIN32 is defined
@ Linux
systems on which Q_OS_LINUX is defined
@ OtherOs
systems on which neither Q_OS_{LINUX|WIN32|DARWIN} is defined
KLF_EXPORT bool isCompatibleSysArch(const QString &sysarch)
KLF_EXPORT bool isLaptop()
KLF_EXPORT QString makeSysArch(const QString &os, const QString &arch)
KLF_EXPORT BatteryInfo batteryInfo()
KLF_EXPORT KLFSysInfo::Os os()
Which operating system this system is running.
KLF_EXPORT QString arch()
The architecture of this sytem.
KLF_EXPORT bool isOnBatteryPower()
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
QString left(int n) const
QString mid(int position, int n) const
QString & replace(int position, int n, QChar after)
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
bool contains(const QString &str, Qt::CaseSensitivity cs) const