1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 11:19:18 +01:00

Fix IsLaptop() check on FreeBSD.

Fixes issue #3244
This commit is contained in:
Veniamin Gvozdikov 2012-10-31 13:25:18 +01:00 committed by John Maguire
parent 9fae3881ed
commit 95dc49ac77

View File

@ -520,13 +520,9 @@ bool IsLaptop() {
}
return !(status.BatteryFlag & 128); // 128 = no system battery
#endif
#ifdef Q_OS_LINUX
#elif defined(Q_OS_LINUX)
return !QDir("/proc/acpi/battery").entryList(QDir::Dirs | QDir::NoDotAndDotDot).isEmpty();
#endif
#ifdef Q_OS_MAC
#elif defined(Q_OS_MAC)
ScopedCFTypeRef<CFTypeRef> power_sources(IOPSCopyPowerSourcesInfo());
ScopedCFTypeRef<CFArrayRef> power_source_list(
IOPSCopyPowerSourcesList(power_sources.get()));
@ -540,6 +536,8 @@ bool IsLaptop() {
}
}
return false;
#else
return false;
#endif
}