summaryrefslogtreecommitdiffstats
path: root/kcontrol/hwmanager/hwdevicetray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kcontrol/hwmanager/hwdevicetray.cpp')
-rw-r--r--kcontrol/hwmanager/hwdevicetray.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/kcontrol/hwmanager/hwdevicetray.cpp b/kcontrol/hwmanager/hwdevicetray.cpp
index b6ef8a6ad..ae3a1db23 100644
--- a/kcontrol/hwmanager/hwdevicetray.cpp
+++ b/kcontrol/hwmanager/hwdevicetray.cpp
@@ -300,11 +300,12 @@ void HwDeviceSystemTray::slotUnmountDevice(int parameter)
for (hwdevice = diskDeviceList.first(); hwdevice; hwdevice = diskDeviceList.next()) {
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(hwdevice);
if ((sdevice->diskUUID() == uuid) || (sdevice->systemPath() == uuid)) {
- if (sdevice->mountPath() != TQString::null) {
- int retcode;
- TQString errstr;
- if (!sdevice->unmountDevice(&errstr, &retcode)) {
- KMessageBox::error(0, i18n("<qt><b>Unable to eject device</b><p>Detailed error information:<br>%1 (code %2)</qt>").arg(errstr).arg(retcode), i18n("Eject Failed"));
+ if (!sdevice->mountPath().isEmpty()) {
+ TDEStorageOpResult unmountResult = sdevice->unmountDevice();
+ if (unmountResult["result"].toBool() == false) {
+ TQString errStr = unmountResult.contains("errStr") ? unmountResult["errStr"].toString() : TQString::null;
+ TQString retcodeStr = unmountResult.contains("retCode") ? unmountResult["retCode"].asString() : "not available";
+ KMessageBox::error(0, i18n("<qt><b>Unable to eject device</b><p>Detailed error information:<br>%1 (error code %2)</qt>").arg(errStr).arg(retcodeStr), i18n("Eject Failed"));
}
return;
}