summaryrefslogtreecommitdiffstats
path: root/tdeioslave/media/mediaimpl.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-06-01 21:55:11 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-07-08 10:33:33 +0900
commite44487e1b855106ddf00ade92a25493e11589ca1 (patch)
treec19755d458f464a6440813b6a97d29404b59257a /tdeioslave/media/mediaimpl.cpp
parent7d2c7f0621177487fcc3953921788f7cafc509af (diff)
downloadtdebase-e44487e1b855106ddf00ade92a25493e11589ca1.tar.gz
tdebase-e44487e1b855106ddf00ade92a25493e11589ca1.zip
Improved media manager dcop interface for mount/unmount/decrypt/undecrypt methods by returning more information.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdeioslave/media/mediaimpl.cpp')
-rw-r--r--tdeioslave/media/mediaimpl.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/tdeioslave/media/mediaimpl.cpp b/tdeioslave/media/mediaimpl.cpp
index 7b22a5d22..1d00bebf2 100644
--- a/tdeioslave/media/mediaimpl.cpp
+++ b/tdeioslave/media/mediaimpl.cpp
@@ -266,12 +266,16 @@ bool MediaImpl::ensureMediumMounted(Medium &medium)
DCOPRef mediamanager("kded", "mediamanager");
DCOPReply reply = mediamanager.call( "mount", medium.id());
- if (reply.isValid())
- reply.get(m_lastErrorMessage);
- else
- m_lastErrorMessage = i18n("Internal Error");
- if (!m_lastErrorMessage.isEmpty())
- m_lastErrorCode = TDEIO::ERR_SLAVE_DEFINED;
+ TQStringVariantMap mountResult;
+ if (reply.isValid()) {
+ reply.get(mountResult);
+ }
+ if (!mountResult.contains("result") || !mountResult["result"].toBool()) {
+ m_lastErrorMessage = mountResult.contains("errStr") ? mountResult["errStr"].toString() : i18n("Unknown mount error.");
+ }
+ if (!m_lastErrorMessage.isEmpty()) {
+ m_lastErrorCode = TDEIO::ERR_SLAVE_DEFINED;
+ }
else {
tqApp->eventLoop()->enterLoop();
}