diff options
author | Michele Calgaro <[email protected]> | 2019-06-01 21:55:11 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2019-07-08 10:33:33 +0900 |
commit | e44487e1b855106ddf00ade92a25493e11589ca1 (patch) | |
tree | c19755d458f464a6440813b6a97d29404b59257a /tdeioslave/media/mediamanager/fstabbackend.cpp | |
parent | 7d2c7f0621177487fcc3953921788f7cafc509af (diff) | |
download | tdebase-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 <[email protected]>
Diffstat (limited to 'tdeioslave/media/mediamanager/fstabbackend.cpp')
-rw-r--r-- | tdeioslave/media/mediamanager/fstabbackend.cpp | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/tdeioslave/media/mediamanager/fstabbackend.cpp b/tdeioslave/media/mediamanager/fstabbackend.cpp index 84910352d..c0e91c228 100644 --- a/tdeioslave/media/mediamanager/fstabbackend.cpp +++ b/tdeioslave/media/mediamanager/fstabbackend.cpp @@ -97,24 +97,34 @@ FstabBackend::~FstabBackend() KDirWatch::self()->removeFile(MTAB); } -TQString FstabBackend::mount( const TQString &_udi ) +TQStringVariantMap FstabBackend::mount(const TQString &id) { - const Medium* medium = m_mediaList.findById(_udi); - if (!medium) - return i18n("No such medium: %1").arg(_udi); - TDEIO::Job* job = TDEIO::mount( false, 0, medium->deviceNode(), medium->mountPoint()); - TDEIO::NetAccess::synchronousRun( job, 0 ); - return TQString::null; + TQStringVariantMap result; + const Medium *medium = m_mediaList.findById(id); + if (!medium) { + result["errStr"] = i18n("No such medium: %1").arg(id); + result["result"] = false; + return result; + } + TDEIO::Job *job = TDEIO::mount(false, 0, medium->deviceNode(), medium->mountPoint()); + TDEIO::NetAccess::synchronousRun(job, 0); + result["result"] = true; + return result; } -TQString FstabBackend::unmount( const TQString &_udi ) +TQStringVariantMap FstabBackend::unmount(const TQString &id) { - const Medium* medium = m_mediaList.findById(_udi); - if (!medium) - return i18n("No such medium: %1").arg(_udi); - TDEIO::Job* job = TDEIO::unmount( medium->mountPoint(), false); - TDEIO::NetAccess::synchronousRun( job, 0 ); - return TQString::null; + TQStringVariantMap result; + const Medium *medium = m_mediaList.findById(id); + if (!medium) { + result["errStr"] = i18n("No such medium: %1").arg(id); + result["result"] = false; + return result; + } + TDEIO::Job *job = TDEIO::unmount(medium->mountPoint(), false); + TDEIO::NetAccess::synchronousRun(job, 0); + result["result"] = true; + return result; } void FstabBackend::slotDirty(const TQString &path) |