Can't safely remove a USB removable hard drive (#852196)

This commit is contained in:
Rex Dieter 2012-08-29 10:29:50 -05:00
parent 248b358eaa
commit 04f815b67d
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,19 @@
diff -up kdelibs-4.9.0/solid/solid/backends/udisks/udisksstorageaccess.cpp.solid-detach-external-hdd kdelibs-4.9.0/solid/solid/backends/udisks/udisksstorageaccess.cpp
--- kdelibs-4.9.0/solid/solid/backends/udisks/udisksstorageaccess.cpp.solid-detach-external-hdd 2012-07-20 03:07:42.000000000 -0500
+++ kdelibs-4.9.0/solid/solid/backends/udisks/udisksstorageaccess.cpp 2012-08-29 10:25:28.162850570 -0500
@@ -204,7 +204,14 @@ void UDisksStorageAccess::slotDBusReply(
QDBusMessage msg = QDBusMessage::createMethodCall(UD_DBUS_SERVICE, drivePath, UD_DBUS_INTERFACE_DISKS_DEVICE, "DriveEject");
msg << QStringList(); // options, unused now
c.call(msg, QDBus::NoBlock);
- }
+ // power down removable USB hard drives, rhbz#852196
+ UDisksDevice drive(drivePath);
+ if (drive.prop("DriveCanDetach").toBool()) {
+ QDBusMessage msg2 = QDBusMessage::createMethodCall(UD_DBUS_SERVICE, drivePath, UD_DBUS_INTERFACE_DISKS_DEVICE, "DriveDetach");
+ msg2 << QStringList(); // options, unused now
+ c.call(msg2, QDBus::NoBlock);
+ }
+ }
slotChanged();
}

View File

@ -25,7 +25,7 @@
Summary: KDE Libraries
Version: 4.9.0
Release: 3%{?dist}
Release: 4%{?dist}
Name: kdelibs
Epoch: 6
@ -144,6 +144,9 @@ Patch53: kdelibs-4.7.2-kjs-s390.patch
# return valid locale (RFC 1766)
Patch54: kdelibs-4.8.4-kjs-locale.patch
# Can't safely remove a USB removable hard drive ( http://bugzilla.redhat.com/852196 )
Patch55: kdelibs-4.9.0-udisks_detatch_external_hdd.patch
## upstream
# fix kdeclarative install location (by wstephenson as found in kde-packager list)
Patch100: kdelibs-4.8.3-kdeclarative-install-location.patch
@ -325,6 +328,7 @@ popd
%patch52 -p1 -b .SOLID_UPNP
%patch53 -p1 -b .kjs-s390
%patch54 -p1 -b .kjs-locale
%patch55 -p1 -b .solid-detach-external-hdd
# upstream patches
%patch100 -p1 -b .kdeclarative-install-location
@ -583,6 +587,9 @@ rm -rf %{buildroot}
%changelog
* Wed Aug 29 2012 Rex Dieter <rdieter@fedoraproject.org> 6:4.9.0-4
- Can't safely remove a USB removable hard drive (#852196)
* Sun Aug 12 2012 Rex Dieter <rdieter@fedoraproject.org> - 6:4.9.0-3
- drop .spec cruft
- Requires: media-player-info