summaryrefslogtreecommitdiffstats
path: root/tdeioslave/media/mediamanager
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-04-07 20:20:10 +0000
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-04-07 20:20:10 +0000
commit5f270bc23fa613d6a1327b09188d8e96a514a461 (patch)
treecec9eb246a3602562e5cb513a9794a71ff4f7555 /tdeioslave/media/mediamanager
parent4f17a123c9a6c20bf3117f75d8b0144181fefeec (diff)
downloadtdebase-5f270bc23fa613d6a1327b09188d8e96a514a461.tar.gz
tdebase-5f270bc23fa613d6a1327b09188d8e96a514a461.zip
Add missing TDEBackend::slotResult slot
This partially resolves Bug 1666
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:
/**