[kdelibs] update the udisks2 backend patch

Lukas Tinkl ltinkl at fedoraproject.org
Tue Jun 26 20:53:10 UTC 2012


commit f94c05b3732a163d5bf76a9dc52d51688339b812
Author: Lukas Tinkl <lukas at kde.org>
Date:   Tue Jun 26 22:53:06 2012 +0200

    update the udisks2 backend patch
    
    - Resolves #835107 - Unable to eject optical media using "Device
      notifier"

 kdelibs-udisks2-backend.patch |   35 +++++++++++++++++++++--------------
 kdelibs.spec                  |    7 ++++++-
 2 files changed, 27 insertions(+), 15 deletions(-)
---
diff --git a/kdelibs-udisks2-backend.patch b/kdelibs-udisks2-backend.patch
index 74ec3c2..6254efc 100644
--- a/kdelibs-udisks2-backend.patch
+++ b/kdelibs-udisks2-backend.patch
@@ -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 at kde.org>
 +    Copyright 2009-2012 Lukáš Tinkl <ltinkl at 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 &)),
diff --git a/kdelibs.spec b/kdelibs.spec
index 392a93e..a84d396 100644
--- a/kdelibs.spec
+++ b/kdelibs.spec
@@ -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 at redhat.com>
+- update the udisks2 backend patch
+- Resolves #835107 - Unable to eject optical media using "Device
+  notifier"
+
 * Wed Jun 20 2012 Rex Dieter <rdieter at fedoraproject.org> 6:4.8.90-3
 - rebuild (attica)
 


More information about the scm-commits mailing list