From 5f270bc23fa613d6a1327b09188d8e96a514a461 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 7 Apr 2014 20:20:10 +0000 Subject: Add missing TDEBackend::slotResult slot This partially resolves Bug 1666 --- .../media/mediamanager/tdehardwarebackend.cpp | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'tdeioslave/media/mediamanager/tdehardwarebackend.cpp') 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 = ""; + qerror += "

" + i18n("Unfortunately, the device %1 (%2) named '%3' and " + "currently mounted at %4 could not be unmounted. ").arg( + "system:/media/" + medium->name(), + medium->deviceNode(), + medium->prettyLabel(), + medium->prettyBaseURL().pathOrURL()) + "

"; + qerror += "

" + i18n("The following error was returned by umount command:"); + qerror += "

" + job->errorText() + "
"; + + if (!proclist.isEmpty()) { + qerror += proclist; + } + qerror += "
"; + } 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); -- cgit v1.2.1