Commit 27ef15fb authored by Nicolas Fella's avatar Nicolas Fella

Use mount point returned from DBus instead of using property value

parent b35c037d
......@@ -78,29 +78,7 @@ bool StorageAccess::isAccessible() const
QString StorageAccess::filePath() const
{
QByteArrayList mntPoints;
if (isLuksDevice()) { // encrypted (and unlocked) device
const QString path = clearTextPath();
if (path.isEmpty() || path == "/") {
return QString();
}
Device holderDevice(path);
mntPoints = qdbus_cast<QByteArrayList>(holderDevice.prop("MountPoints"));
if (!mntPoints.isEmpty()) {
return QFile::decodeName(mntPoints.first()); // FIXME Solid doesn't support multiple mount points
} else {
return QString();
}
}
mntPoints = qdbus_cast<QByteArrayList>(m_device->prop("MountPoints"));
if (!mntPoints.isEmpty()) {
return QFile::decodeName(mntPoints.first()); // FIXME Solid doesn't support multiple mount points
} else {
return QString();
}
return m_mountPoint;
}
bool StorageAccess::isIgnored() const
......@@ -158,14 +136,25 @@ void StorageAccess::checkAccessibility()
}
}
void StorageAccess::slotDBusReply(const QDBusMessage & /*reply*/)
void StorageAccess::slotDBusReply(const QDBusMessage &reply)
{
const QString ctPath = clearTextPath();
if (m_setupInProgress) {
if (isLuksDevice() && !isAccessible()) { // unlocked device, now mount it
mount();
if (isLuksDevice()) {
if(!isAccessible()) { // unlocked device, now mount it
mount();
} else {
const QString path = clearTextPath();
if (path.isEmpty() || path == "/") {
return;
}
Device holderDevice(path);
QByteArrayList mntPoints = qdbus_cast<QByteArrayList>(holderDevice.prop("MountPoints"));
m_mountPoint = QFile::decodeName(mntPoints.first()); // FIXME Solid doesn't support multiple mount points
}
} else { // Don't broadcast setupDone unless the setup is really done. (Fix kde#271156)
m_setupInProgress = false;
m_mountPoint = reply.arguments().first().toString(); // FIXME Solid doesn't support multiple mount points
m_device->broadcastActionDone("setup");
checkAccessibility();
......
......@@ -94,6 +94,7 @@ private:
bool m_teardownInProgress;
bool m_passphraseRequested;
QString m_lastReturnObject;
QString m_mountPoint;
static const int s_unmountTimeout = 0x7fffffff;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment