|
|
@ -40,6 +40,7 @@
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/fs.h>
|
|
|
|
|
|
|
|
#include <linux/cdrom.h>
|
|
|
|
|
|
|
|
|
|
|
|
// Backlight devices
|
|
|
|
// Backlight devices
|
|
|
|
#include <linux/fb.h>
|
|
|
|
#include <linux/fb.h>
|
|
|
@ -433,6 +434,21 @@ bool TDEStorageDevice::checkDiskStatus(TDEDiskDeviceStatus::TDEDiskDeviceStatus
|
|
|
|
return ((m_diskStatus&sf)!=(TDEDiskDeviceStatus::TDEDiskDeviceStatus)0);
|
|
|
|
return ((m_diskStatus&sf)!=(TDEDiskDeviceStatus::TDEDiskDeviceStatus)0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool TDEStorageDevice::lockDriveMedia(bool lock) {
|
|
|
|
|
|
|
|
int fd = open(deviceNode().ascii(), O_RDWR | O_NONBLOCK);
|
|
|
|
|
|
|
|
if (fd < 0) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ioctl(fd, CDROM_LOCKDOOR, (lock)?1:0) != 0) {
|
|
|
|
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString TDEStorageDevice::diskLabel() {
|
|
|
|
TQString TDEStorageDevice::diskLabel() {
|
|
|
|
return m_diskName;
|
|
|
|
return m_diskName;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -989,6 +1005,9 @@ bool TDECPUDevice::canSetGovernor() {
|
|
|
|
if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) {
|
|
|
|
if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) {
|
|
|
|
return reply[0].toVariant().value.toBool();
|
|
|
|
return reply[0].toVariant().value.toBool();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
@ -1168,6 +1187,9 @@ bool TDERootSystemDevice::canSuspend() {
|
|
|
|
if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) {
|
|
|
|
if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) {
|
|
|
|
return reply[0].toVariant().value.toBool();
|
|
|
|
return reply[0].toVariant().value.toBool();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
@ -1202,6 +1224,9 @@ bool TDERootSystemDevice::canHibernate() {
|
|
|
|
if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) {
|
|
|
|
if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) {
|
|
|
|
return reply[0].toVariant().value.toBool();
|
|
|
|
return reply[0].toVariant().value.toBool();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
@ -1675,6 +1700,9 @@ bool TDEBacklightDevice::canSetBrightness() {
|
|
|
|
if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) {
|
|
|
|
if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) {
|
|
|
|
return reply[0].toVariant().value.toBool();
|
|
|
|
return reply[0].toVariant().value.toBool();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
|