From e13c01e6863b7384e70f10068c6b76c1d24d9945 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 25 May 2012 22:05:06 -0500 Subject: Clean up ugly error message --- kioslave/media/mediamanager/halbackend.cpp | 2 +- kioslave/media/mounthelper/kio_media_mounthelper.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'kioslave/media') diff --git a/kioslave/media/mediamanager/halbackend.cpp b/kioslave/media/mediamanager/halbackend.cpp index 8d4d6f0a7..575d7f729 100644 --- a/kioslave/media/mediamanager/halbackend.cpp +++ b/kioslave/media/mediamanager/halbackend.cpp @@ -1272,7 +1272,7 @@ static TQString mount_priv(const char *udi, const char *mount_point, const char if ( !strcmp(error.name, "org.freedesktop.Hal.Device.Volume.UnknownFilesystemType")) qerror = i18n("Invalid filesystem type"); else if ( !strcmp(error.name, "org.freedesktop.Hal.Device.Volume.PermissionDenied")) - qerror = i18n("Permissions denied

Please ensure that:
1. You have permission to access this device.
2. This device node is not listed in /etc/fstab.

"); + qerror = i18n("Permission denied

Please ensure that:
1. You have permission to access this device.
2. This device node is not listed in /etc/fstab.

"); else if ( !strcmp(error.name, "org.freedesktop.Hal.Device.PermissionDeniedByPolicy")) qerror = privilegedMount(udi, mount_point, poptions, noptions); else if ( !strcmp(error.name, "org.freedesktop.Hal.Device.Volume.AlreadyMounted")) diff --git a/kioslave/media/mounthelper/kio_media_mounthelper.cpp b/kioslave/media/mounthelper/kio_media_mounthelper.cpp index 07588e867..7a2b2b78f 100644 --- a/kioslave/media/mounthelper/kio_media_mounthelper.cpp +++ b/kioslave/media/mounthelper/kio_media_mounthelper.cpp @@ -208,7 +208,7 @@ void MountHelper::ejectFinished(KProcess* proc) else m_errorStr = i18n("The device was successfully unmounted, but could not be ejected"); } -//X Comment this because the error is useless as long as the unmount is successfull. +//X Comment this because the error is useless as long as the unmount is successful. //X TQTimer::singleShot(0, this, TQT_SLOT(error())); ::exit(0); } @@ -216,7 +216,13 @@ void MountHelper::ejectFinished(KProcess* proc) void MountHelper::error() { - KMessageBox::error(0, m_errorStr); + TQString prettyErrorString = m_errorStr; + if (m_errorStr.contains("<") && m_errorStr.contains(">")) { + if (!m_errorStr.contains("")) { + prettyErrorString = TQString("%1").arg(m_errorStr); + } + } + KMessageBox::error(0, prettyErrorString); ::exit(1); } -- cgit v1.2.1