summaryrefslogtreecommitdiffstats
path: root/kcontrol/hwmanager/devicepropsdlg.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/devicepropsdlg.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/devicepropsdlg.cpp')
-rw-r--r--kcontrol/hwmanager/devicepropsdlg.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp
index 885dc7a7a..c97c6dea2 100644
--- a/kcontrol/hwmanager/devicepropsdlg.cpp
+++ b/kcontrol/hwmanager/devicepropsdlg.cpp
@@ -879,21 +879,19 @@ void DevicePropertiesDialog::setHibernationMethod(int value) {
void DevicePropertiesDialog::mountDisk() {
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(m_device);
-
- // FIXME
- // This can only mount normal volumes
TQString qerror;
TQString diskLabel = sdevice->diskLabel();
if (diskLabel.isNull()) {
diskLabel = i18n("%1 Removable Device").arg(sdevice->deviceFriendlySize());
}
TDEStorageMountOptions mountOptions;
- TQString mountMessages;
- TQString mountedPath = sdevice->mountDevice(diskLabel, mountOptions, &mountMessages);
- if (mountedPath.isNull()) {
+ TDEStorageOpResult mountResult = sdevice->mountDevice(diskLabel, mountOptions);
+ TQString mountedPath = mountResult.contains("mountPath") ? mountResult["mountPath"].toString() : TQString::null;
+ if (mountedPath.isEmpty()) {
qerror = i18n("<qt>Unable to mount this device.<p>Potential reasons include:<br>Improper device and/or user privilege level<br>Corrupt data on storage device");
- if (!mountMessages.isNull()) {
- qerror.append(i18n("<p>Technical details:<br>").append(mountMessages));
+ TQString errStr = mountResult.contains("errStr") ? mountResult["errStr"].toString() : TQString::null;
+ if (!errStr.isEmpty()) {
+ qerror.append(i18n("<p>Technical details:<br>").append(errStr));
}
qerror.append("</qt>");
}
@@ -910,13 +908,13 @@ void DevicePropertiesDialog::unmountDisk() {
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(m_device);
TQString qerror;
- TQString unmountMessages;
- int unmountRetcode = 0;
- if (!sdevice->unmountDevice(&unmountMessages, &unmountRetcode)) {
+ TDEStorageOpResult unmountResult = sdevice->unmountDevice();
+ if (unmountResult["result"].toBool() == false) {
// Unmount failed!
qerror = "<qt>" + i18n("Unfortunately, the device could not be unmounted.");
- if (!unmountMessages.isNull()) {
- qerror.append(i18n("<p>Technical details:<br>").append(unmountMessages));
+ TQString errStr = unmountResult.contains("errStr") ? unmountResult["errStr"].toString() : TQString::null;
+ if (!errStr.isEmpty()) {
+ qerror.append(i18n("<p>Technical details:<br>").append(errStr));
}
qerror.append("</qt>");
}