[kdelibs/f17] Can't safely remove a USB removable hard drive (#852196)

Rex Dieter rdieter at fedoraproject.org
Wed Aug 29 15:34:29 UTC 2012


commit 288c7c33054ce990e2a1f1e7cb577e2ffcdb973d
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Wed Aug 29 10:37:44 2012 -0500

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

 kdelibs-4.9.0-udisks_detatch_external_hdd.patch |   19 +++++++++++++++++++
 kdelibs.spec                                    |    9 ++++++++-
 2 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/kdelibs-4.9.0-udisks_detatch_external_hdd.patch b/kdelibs-4.9.0-udisks_detatch_external_hdd.patch
new file mode 100644
index 0000000..ace636b
--- /dev/null
+++ b/kdelibs-4.9.0-udisks_detatch_external_hdd.patch
@@ -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();
+         }
diff --git a/kdelibs.spec b/kdelibs.spec
index 7ecbeb2..9fc4054 100644
--- a/kdelibs.spec
+++ b/kdelibs.spec
@@ -25,7 +25,7 @@
 
 Summary: KDE Libraries
 Version: 4.8.5
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 Name: kdelibs
 Epoch: 6
@@ -145,6 +145,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
@@ -356,6 +359,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
@@ -614,6 +618,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Wed Aug 29 2012 Rex Dieter <rdieter at fedoraproject.org> 6:4.8.5-2
+- Can't safely remove a USB removable hard drive (#852196)
+
 * Thu Aug 02 2012 Rex Dieter <rdieter at fedoraproject.org> - 6:4.8.5-1
 - 4.8.5
 


More information about the scm-commits mailing list