mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
solid: unmount the optical drive before ejecting it
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
4d6cc60bc6
commit
b77a8b70fd
1 changed files with 6 additions and 0 deletions
|
@ -20,6 +20,8 @@
|
|||
|
||||
#include "udevopticaldrive.h"
|
||||
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusReply>
|
||||
#include <QDebug>
|
||||
|
||||
#include <cdio/mmc.h>
|
||||
|
@ -61,6 +63,10 @@ OpticalDrive::~OpticalDrive()
|
|||
|
||||
bool OpticalDrive::eject()
|
||||
{
|
||||
// cdio fails to unmount unless current user is root
|
||||
QDBusInterface soliduiserver("org.kde.kded", "/modules/soliduiserver", "org.kde.SolidUiServer");
|
||||
soliduiserver.call("unmountUdi", m_device->udi());
|
||||
|
||||
emit ejectRequested(m_device->udi());
|
||||
|
||||
const QByteArray devicename(m_device->deviceProperty("DEVNAME").toLocal8Bit());
|
||||
|
|
Loading…
Add table
Reference in a new issue