[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/runtime/knotify
From: Jacopo De Simoi <wilderkde () gmail ! com>
Date: 2010-06-20 15:45:49
Message-ID: 20100620154549.53A4EAC8D9 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1140405 by jacopods:
Fix notifications for errors upon eject
M +15 -3 ksolidnotify.cpp
--- trunk/KDE/kdebase/runtime/knotify/ksolidnotify.cpp #1140404:1140405
@@ -111,7 +111,7 @@
}
if (device->is<Solid::OpticalDisc>())
{
- Solid::OpticalDrive *drive = device->as<Solid::OpticalDrive>();
+ Solid::OpticalDrive *drive = device->parent().as<Solid::OpticalDrive>();
connect(drive, SIGNAL(ejectDone(Solid::ErrorType, QVariant, const QString &)),
this, SLOT(storageEjectDone(Solid::ErrorType, QVariant , const QString &)));
}
@@ -157,8 +157,20 @@
{
if (error)
{
- Solid::Device device(udi);
- QString errorMessage = i18n("Could not eject the following device: %1\nOne or more \
files on this device are open within an application ", device.description()); \
+ QString discUdi; + foreach (Solid::Device device, m_devices) {
+ if (device.parentUdi() == udi) {
+ discUdi = device.udi();
+ }
+ }
+
+ if (discUdi.isNull()) {
+ //This should not happen, bail out
+ return;
+ }
+
+ Solid::Device discDevice(discUdi);
+ QString errorMessage = i18n("Could not eject the following device: %1\nOne or more \
files on this device are open within an application ", discDevice.description()); if \
(!m_dbusServiceExists) {
m_kNotify->event("mounterror", "hardwarenotifications", ContextList(), \
i18n("Device error"), errorMessage, KNotifyImage(), QStringList(), -1);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic