summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw/tdestoragedevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdecore/tdehw/tdestoragedevice.cpp')
-rw-r--r--tdecore/tdehw/tdestoragedevice.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/tdecore/tdehw/tdestoragedevice.cpp b/tdecore/tdehw/tdestoragedevice.cpp
index 5489dfc1c..71f852e0b 100644
--- a/tdecore/tdehw/tdestoragedevice.cpp
+++ b/tdecore/tdehw/tdestoragedevice.cpp
@@ -342,15 +342,15 @@ bool ejectDriveUDisks(TDEStorageDevice* sdevice) {
if (error.isValid()) {
// Error!
printf("[ERROR][tdehwlib] ejectDriveUDisks: %s\n", error.name().ascii()); fflush(stdout);
- return FALSE;
+ return false;
}
else {
- return TRUE;
+ return true;
}
}
}
#endif // WITH_UDISKS
- return FALSE;
+ return false;
}
bool ejectDriveUDisks2(TDEStorageDevice* sdevice) {
@@ -371,13 +371,13 @@ bool ejectDriveUDisks2(TDEStorageDevice* sdevice) {
if (error.isValid()) {
// Error!
printf("[ERROR][tdehwlib] ejectDriveUDisks2: %s\n", error.name().ascii()); fflush(stdout);
- return FALSE;
+ return false;
}
else {
if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) {
TQT_DBusObjectPath driveObjectPath = reply[0].toVariant().value.toObjectPath();
if (!driveObjectPath.isValid()) {
- return FALSE;
+ return false;
}
error = TQT_DBusError();
@@ -389,12 +389,12 @@ bool ejectDriveUDisks2(TDEStorageDevice* sdevice) {
if (error.isValid()) {
// Error!
printf("[ERROR][tdehwlib] ejectDriveUDisks2: %s\n", error.name().ascii()); fflush(stdout);
- return FALSE;
+ return false;
}
if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) {
bool ejectable = reply[0].toVariant().value.toBool();
if (!ejectable) {
- return FALSE;
+ return false;
}
// Eject the drive!
@@ -406,10 +406,10 @@ bool ejectDriveUDisks2(TDEStorageDevice* sdevice) {
if (error.isValid()) {
// Error!
printf("[ERROR][tdehwlib] ejectDriveUDisks2: %s\n", error.name().ascii()); fflush(stdout);
- return FALSE;
+ return false;
}
else {
- return TRUE;
+ return true;
}
}
}
@@ -417,7 +417,7 @@ bool ejectDriveUDisks2(TDEStorageDevice* sdevice) {
}
}
#endif // WITH_UDISKS2
- return FALSE;
+ return false;
}
int mountDriveUDisks(TQString deviceNode, TQString fileSystemType, TQStringList mountOptions, TQString* errStr = NULL) {
@@ -600,7 +600,7 @@ bool TDEStorageDevice::ejectDrive() {
#ifdef WITH_UDISKS2
if (!(TDEGlobal::dirs()->findExe("udisksctl").isEmpty())) {
if (ejectDriveUDisks2(this)) {
- return TRUE;
+ return true;
}
else {
printf("[tdehwlib] Failed to eject drive '%s' via udisks2, falling back to alternate mechanism\n", deviceNode().ascii());
@@ -612,7 +612,7 @@ bool TDEStorageDevice::ejectDrive() {
#ifdef WITH_UDISKS
if (!(TDEGlobal::dirs()->findExe("udisks").isEmpty())) {
if (ejectDriveUDisks(this)) {
- return TRUE;
+ return true;
}
else {
printf("[tdehwlib] Failed to eject drive '%s' via udisks, falling back to alternate mechanism\n", deviceNode().ascii());
@@ -631,14 +631,14 @@ bool TDEStorageDevice::ejectDrive() {
eject_output = ts.read();
int retcode = pclose(exepipe);
if (retcode == 0) {
- return TRUE;
+ return true;
}
}
printf("[tdehwlib] Failed to eject drive '%s' via 'eject' command\n", deviceNode().ascii());
fflush(stdout);
}
- return FALSE;
+ return false;
}
bool TDEStorageDevice::ejectDriveMedia() {
@@ -1411,7 +1411,7 @@ bool TDEStorageDevice::unmountDevice(TQString* errRet, int* retcode) {
if (errRet) {
*errRet = i18n("No supported unmounting methods were detected on your system");
}
- return true;
+ return false;
}
FILE *exepipe = popen(command.local8Bit(), "r");
@@ -1424,7 +1424,6 @@ bool TDEStorageDevice::unmountDevice(TQString* errRet, int* retcode) {
if (*retcode == 0) {
// Update internal mount data
TDEGlobal::hardwareDevices()->processModifiedMounts();
-
return true;
}
else {
@@ -1436,7 +1435,6 @@ bool TDEStorageDevice::unmountDevice(TQString* errRet, int* retcode) {
// Update internal mount data
TDEGlobal::hardwareDevices()->processModifiedMounts();
-
return false;
}
@@ -1452,7 +1450,7 @@ TQString TDEStorageDevice::determineFileSystemType(TQString path) {
// Walk the directory tree up to the root, checking for any change in st_dev
// If a change is found, the previous value of path is the mount point itself
while (path != "/") {
- pos = path.findRev("/", -1, TRUE);
+ pos = path.findRev("/", -1, true);
if (pos < 0) {
break;
}