summaryrefslogtreecommitdiffstats
path: root/tdeioslave/media/mediamanager
diff options
context:
space:
mode:
Diffstat (limited to 'tdeioslave/media/mediamanager')
-rw-r--r--tdeioslave/media/mediamanager/tdehardwarebackend.cpp41
-rw-r--r--tdeioslave/media/mediamanager/tdehardwarebackend.h3
2 files changed, 44 insertions, 0 deletions
diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
index 1981ba31d..3029cec72 100644
--- a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
+++ b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
@@ -1406,6 +1406,47 @@ TQString TDEBackend::unmount(const TQString &_udi)
return TQString();
}
+void TDEBackend::slotResult(TDEIO::Job *job)
+{
+ TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
+
+ struct mount_job_data *data = mount_jobs[job];
+ TQString& qerror = data->errorMessage;
+ const Medium* medium = data->medium;
+
+ if (job->error() == TDEIO::ERR_COULD_NOT_UNMOUNT) {
+ TQString proclist(listUsingProcesses(medium));
+
+ qerror = "<qt>";
+ qerror += "<p>" + i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
+ "currently mounted at <b>%4</b> could not be unmounted. ").arg(
+ "system:/media/" + medium->name(),
+ medium->deviceNode(),
+ medium->prettyLabel(),
+ medium->prettyBaseURL().pathOrURL()) + "</p>";
+ qerror += "<p>" + i18n("The following error was returned by umount command:");
+ qerror += "</p><pre>" + job->errorText() + "</pre>";
+
+ if (!proclist.isEmpty()) {
+ qerror += proclist;
+ }
+ qerror += "</qt>";
+ } else if (job->error()) {
+ qerror = job->errorText();
+ }
+
+ TDEStorageDevice * sdevice = hwdevices->findDiskByUID(medium->id());
+ if (sdevice) {
+ ResetProperties(sdevice);
+ }
+ mount_jobs.remove(job);
+
+ /* Job completed. Notify the caller */
+ data->error = job->error();
+ data->completed = true;
+ kapp->eventLoop()->exitLoop();
+}
+
TQString TDEBackend::isInFstab(const Medium *medium)
{
KMountPoint::List fstab = KMountPoint::possibleMountPoints(KMountPoint::NeedMountOptions|KMountPoint::NeedRealDeviceName);
diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.h b/tdeioslave/media/mediamanager/tdehardwarebackend.h
index 9b5407d8f..19f697a84 100644
--- a/tdeioslave/media/mediamanager/tdehardwarebackend.h
+++ b/tdeioslave/media/mediamanager/tdehardwarebackend.h
@@ -142,6 +142,9 @@ private:
TQString m_decryptionPassword;
bool m_decryptPasswordValid;
+private slots:
+ void slotResult(TDEIO::Job *job);
+
/* TDE structures */
private:
/**