Branch: master

b1246c70 2019-06-26 15:05:57 Michele Calgaro
Adjusted to new TDEStorageOpResult-based tdelibs api.

Signed-off-by: Michele Calgaro <michele.calgaro@...>
M libk3bdevice/k3bhalconnection.cpp

libk3bdevice/k3bhalconnection.cpp

diff --git a/libk3bdevice/k3bhalconnection.cpp b/libk3bdevice/k3bhalconnection.cpp
index 476d016..7a17bf7 100644
--- a/libk3bdevice/k3bhalconnection.cpp
+++ b/libk3bdevice/k3bhalconnection.cpp
@@ -22,6 +22,7 @@
 #include <tdelocale.h>
 
 #include <tqtimer.h>
+#include <tqvariant.h>
 
 #ifdef HAVE_HAL
 // We acknowledge the the dbus API is unstable
@@ -842,8 +843,9 @@
 	// FIXME
 	// Options from 'options' are not currently loaded into 'mountOptions'
 	TDEStorageMountOptions mountOptions;
-	TQString mountedPath = sdevice->mountDevice(mountPoint, mountOptions);
-	if (mountedPath.isNull()) {
+	TDEStorageOpResult mountResult = sdevice->mountDevice(mountPoint, mountOptions);
+	TQString mountedPath = mountResult.contains("mountPath") ? mountResult["mountPath"].toString() : TQString::null;
+	if (mountedPath.isEmpty()) {
 		return org_freedesktop_Hal_CommunicationError;
 	}
 	else {
@@ -872,7 +874,8 @@
 	// Options from 'options' are not currently loaded into 'mountOptions'
 	TQString mountOptions;
 
-	if (!sdevice->unmountDevice(NULL)) {
+	TDEStorageOpResult unmountResult = sdevice->unmountDevice();
+	if (unmountResult["result"].toBool() == false) {
 		// Unmount failed!
 		return org_freedesktop_Hal_CommunicationError;
 	}
82c3b55a 2019-06-26 15:05:57 Michele Calgaro
Adjusted to use new TQStringVariantMap type.

Signed-off-by: Michele Calgaro <michele.calgaro@...>
M libk3bdevice/k3bhalconnection.cpp

libk3bdevice/k3bhalconnection.cpp

diff --git a/libk3bdevice/k3bhalconnection.cpp b/libk3bdevice/k3bhalconnection.cpp
index 7a17bf7..d5b6dfd 100644
--- a/libk3bdevice/k3bhalconnection.cpp
+++ b/libk3bdevice/k3bhalconnection.cpp
@@ -843,7 +843,7 @@
 	// FIXME
 	// Options from 'options' are not currently loaded into 'mountOptions'
 	TDEStorageMountOptions mountOptions;
-	TDEStorageOpResult mountResult = sdevice->mountDevice(mountPoint, mountOptions);
+	TQStringVariantMap mountResult = sdevice->mountDevice(mountPoint, mountOptions);
 	TQString mountedPath = mountResult.contains("mountPath") ? mountResult["mountPath"].toString() : TQString::null;
 	if (mountedPath.isEmpty()) {
 		return org_freedesktop_Hal_CommunicationError;
@@ -874,7 +874,7 @@
 	// Options from 'options' are not currently loaded into 'mountOptions'
 	TQString mountOptions;
 
-	TDEStorageOpResult unmountResult = sdevice->unmountDevice();
+	TQStringVariantMap unmountResult = sdevice->unmountDevice();
 	if (unmountResult["result"].toBool() == false) {
 		// Unmount failed!
 		return org_freedesktop_Hal_CommunicationError;