[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Ejecting mounted CDs/DVDs



Hi,

since upgrading to Wheezy, I cannot eject mounted CDs/DVDs from the fileplaces 
panel any more. This bug has already been reported upstream and has been fixed 
in KDE 4.9 and 4.10:

https://bugs.kde.org/show_bug.cgi?id=274982

The patch is pretty small, so perhaps there is a chance to include it in 
Wheezy.

The original patch from the bug report did not work for me due to a signature 
mismatch with udisk's DriveEject method. The attachment contains a modified 
version of the patch, which I tested successfully.

Best regards,
 Matthias Grossmann
--- a/solid/solid/backends/udisks/udisksopticaldrive.cpp
+++ b/solid/solid/backends/udisks/udisksopticaldrive.cpp
@@ -62,16 +62,8 @@
 
     QString path = m_device->udi();
 
-    // check if the device is mounted and call umount if needed
-    if (m_device->prop("DeviceIsMounted").toBool())
-    {
-        QDBusMessage msg = QDBusMessage::createMethodCall(UD_DBUS_SERVICE, path, UD_DBUS_INTERFACE_DISKS_DEVICE, "FilesystemUnmount");
-        msg << QStringList();   // options, unused now
-        c.call(msg, QDBus::NoBlock);
-    }
-
     QDBusMessage msg = QDBusMessage::createMethodCall(UD_DBUS_SERVICE, path, UD_DBUS_INTERFACE_DISKS_DEVICE, "DriveEject");
-    msg << QStringList();
+    msg << QStringList(QString("unmount"));
     return c.callWithCallback(msg, this, SLOT(slotDBusReply(QDBusMessage)), SLOT(slotDBusError(QDBusError)));
 }
 

Reply to: