mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
solid: adjust geom backend to action broadcasting changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d21dbb523e
commit
2a6fc42d29
2 changed files with 4 additions and 36 deletions
|
@ -31,13 +31,6 @@ using namespace Solid::Backends::Geom;
|
|||
StorageAccess::StorageAccess(GeomDevice *device)
|
||||
: DeviceInterface(device)
|
||||
{
|
||||
m_device->registerAction("setup", this,
|
||||
SLOT(slotSetupRequested()),
|
||||
SLOT(slotSetupDone(int,QString)));
|
||||
|
||||
m_device->registerAction("teardown", this,
|
||||
SLOT(slotTeardownRequested()),
|
||||
SLOT(slotTeardownDone(int,QString)));
|
||||
}
|
||||
|
||||
StorageAccess::~StorageAccess()
|
||||
|
@ -87,7 +80,7 @@ bool StorageAccess::setup()
|
|||
return true;
|
||||
}
|
||||
|
||||
m_device->broadcastActionRequested("setup");
|
||||
emit setupRequested(m_device->udi());
|
||||
|
||||
QDBusInterface soliduiserver("org.kde.kded", "/modules/soliduiserver", "org.kde.SolidUiServer");
|
||||
QDBusReply<int> reply = soliduiserver.call("mountDevice", m_device->udi());
|
||||
|
@ -97,7 +90,7 @@ bool StorageAccess::setup()
|
|||
emit accessibilityChanged(true, m_device->udi());
|
||||
}
|
||||
|
||||
m_device->broadcastActionDone("setup", replyvalue, Solid::errorString(replyvalue));
|
||||
emit setupDone(replyvalue, Solid::errorString(replyvalue), m_device->udi());
|
||||
return (replyvalue == Solid::NoError);
|
||||
}
|
||||
|
||||
|
@ -108,7 +101,7 @@ bool StorageAccess::teardown()
|
|||
return false;
|
||||
}
|
||||
|
||||
m_device->broadcastActionRequested("teardown");
|
||||
emit teardownRequested(m_device->udi());
|
||||
|
||||
QDBusInterface soliduiserver("org.kde.kded", "/modules/soliduiserver", "org.kde.SolidUiServer");
|
||||
QDBusReply<int> reply = soliduiserver.call("unmountDevice", m_device->udi());
|
||||
|
@ -118,26 +111,7 @@ bool StorageAccess::teardown()
|
|||
emit accessibilityChanged(false, m_device->udi());
|
||||
}
|
||||
|
||||
m_device->broadcastActionDone("teardown", replyvalue, Solid::errorString(replyvalue));
|
||||
emit teardownDone(replyvalue, Solid::errorString(replyvalue), m_device->udi());
|
||||
return (replyvalue == Solid::NoError);
|
||||
}
|
||||
|
||||
void StorageAccess::slotSetupRequested()
|
||||
{
|
||||
emit setupRequested(m_device->udi());
|
||||
}
|
||||
|
||||
void StorageAccess::slotSetupDone(int error, const QString &errorString)
|
||||
{
|
||||
emit setupDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi());
|
||||
}
|
||||
|
||||
void StorageAccess::slotTeardownRequested()
|
||||
{
|
||||
emit teardownRequested(m_device->udi());
|
||||
}
|
||||
|
||||
void StorageAccess::slotTeardownDone(int error, const QString &errorString)
|
||||
{
|
||||
emit teardownDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi());
|
||||
}
|
||||
|
|
|
@ -51,12 +51,6 @@ Q_SIGNALS:
|
|||
void teardownDone(Solid::ErrorType error, QVariant data, const QString &udi);
|
||||
void setupRequested(const QString &udi);
|
||||
void teardownRequested(const QString &udi);
|
||||
|
||||
private Q_SLOTS:
|
||||
void slotSetupRequested();
|
||||
void slotSetupDone(int error, const QString &errorString);
|
||||
void slotTeardownRequested();
|
||||
void slotTeardownDone(int error, const QString &errorString);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue