summaryrefslogtreecommitdiffstats
path: root/kcontrol/hwmanager/hwdevicetray.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-05-30 23:33:38 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-07-08 10:33:32 +0900
commitdf9e4e43b0e3e9945d9b32c1b0683314239d1476 (patch)
treeacd05d430f0dc0026b9ea41fb7ce78344357cf66 /kcontrol/hwmanager/hwdevicetray.cpp
parente408b9918746037bd96eb30b707640d2148c2495 (diff)
downloadtdebase-df9e4e43b0e3e9945d9b32c1b0683314239d1476.tar.gz
tdebase-df9e4e43b0e3e9945d9b32c1b0683314239d1476.zip
Adjusted to new TDEStorageOpResult-based tdelibs api.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
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;
}