update the udisks2 backend patch

- Resolves #835107 - Unable to eject optical media using "Device
  notifier"
This commit is contained in:
Lukas Tinkl 2012-06-26 22:53:06 +02:00
parent 71fe9b41bc
commit f94c05b373
2 changed files with 27 additions and 15 deletions

View File

@ -2655,10 +2655,10 @@ index 0000000..4c98ef5
+#endif // UDISKS2OPTICALDRIVE_H
diff --git a/tier1/solid/src/solid/backends/udisks2/udisksstorageaccess.cpp b/tier1/solid/src/solid/backends/udisks2/udisksstorageaccess.cpp
new file mode 100644
index 0000000..146c227
index 0000000..6301210
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udisks2/udisksstorageaccess.cpp
@@ -0,0 +1,359 @@
@@ -0,0 +1,366 @@
+/*
+ Copyright 2009 Pino Toscano <pino@kde.org>
+ Copyright 2009-2012 Lukáš Tinkl <ltinkl@redhat.com>
@ -2793,7 +2793,7 @@ index 0000000..146c227
+ Q_UNUSED(ifaceName);
+
+ if (changedProps.keys().contains("MountPoints") || invalidatedProps.contains("MountPoints")) {
+ Q_EMIT accessibilityChanged(isAccessible(), isLuksDevice() ? m_clearTextPath : m_device->udi());
+ checkAccessibility();
+ }
+}
+
@ -2823,10 +2823,10 @@ index 0000000..146c227
+ }
+ else // Don't broadcast setupDone unless the setup is really done. (Fix kde#271156)
+ {
+ checkAccessibility();
+
+ m_setupInProgress = false;
+ m_device->broadcastActionDone("setup");
+
+ checkAccessibility();
+ }
+ }
+ else if (m_teardownInProgress) // FIXME
@ -2840,11 +2840,12 @@ index 0000000..146c227
+ }
+ else
+ {
+ if (m_device->prop("Ejectable").toBool() && !m_device->isOpticalDisc()) // optical drives have their Eject method
+ // try to "eject" (aka safely remove) from the (parent) drive, e.g. SD card from a reader
+ const QString drivePath = m_device->drivePath();
+ if (!drivePath.isEmpty() || drivePath != "/")
+ {
+ // try to "eject" (aka safely remove) from the (parent) drive, e.g. SD card from a reader
+ QString drivePath = m_device->prop("Drive").value<QDBusObjectPath>().path();
+ if (!drivePath.isEmpty() || drivePath != "/")
+ Device drive(drivePath);
+ if (drive.prop("Ejectable").toBool() && !drive.isOpticalDrive()) // optical drives have their Eject method
+ {
+ QDBusConnection c = QDBusConnection::systemBus();
+ QDBusMessage msg = QDBusMessage::createMethodCall(UD2_DBUS_SERVICE, drivePath, UD2_DBUS_INTERFACE_DRIVE, "Eject");
@ -2853,10 +2854,10 @@ index 0000000..146c227
+ }
+ }
+
+ checkAccessibility();
+
+ m_teardownInProgress = false;
+ m_device->broadcastActionDone("teardown");
+
+ checkAccessibility();
+ }
+ }
+}
@ -2865,19 +2866,21 @@ index 0000000..146c227
+{
+ if (m_setupInProgress)
+ {
+ checkAccessibility();
+
+ m_setupInProgress = false;
+ m_device->broadcastActionDone("setup", m_device->errorToSolidError(error.name()),
+ m_device->errorToString(error.name()) + ": " +error.message());
+
+ checkAccessibility();
+ }
+ else if (m_teardownInProgress)
+ {
+ checkAccessibility();
+
+ m_teardownInProgress = false;
+ m_clearTextPath.clear();
+ m_device->broadcastActionDone("teardown", m_device->errorToSolidError(error.name()),
+ m_device->errorToString(error.name()) + ": " + error.message());
+ checkAccessibility();
+ }
+}
+
@ -2916,8 +2919,12 @@ index 0000000..146c227
+
+ QDBusConnection c = QDBusConnection::systemBus();
+ QDBusMessage msg = QDBusMessage::createMethodCall(UD2_DBUS_SERVICE, path, UD2_DBUS_INTERFACE_FILESYSTEM, "Mount");
+ QVariantMap options;
+
+ msg << QVariantMap(); // options, unused now
+ if (m_device->prop("IdType").toString() == "vfat")
+ options.insert("options", "flush");
+
+ msg << options;
+
+ return c.callWithCallback(msg, this,
+ SLOT(slotDBusReply(const QDBusMessage &)),

View File

@ -25,7 +25,7 @@
Summary: KDE Libraries
Version: 4.8.90
Release: 3%{?dist}
Release: 4%{?dist}
Name: kdelibs
Epoch: 6
@ -610,6 +610,11 @@ rm -rf %{buildroot}
%changelog
* Tue Jun 26 2012 Lukáš Tinkl <ltinkl@redhat.com>
- update the udisks2 backend patch
- Resolves #835107 - Unable to eject optical media using "Device
notifier"
* Wed Jun 20 2012 Rex Dieter <rdieter@fedoraproject.org> 6:4.8.90-3
- rebuild (attica)