kdelibs/kdelibs-4.9.0-udisks_detatch_external_hdd.patch

20 lines
1.2 KiB
Diff
Raw Normal View History

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();
}