Commit fd5bef6f authored by Raine Makelainen's avatar Raine Makelainen

[nemo-storage] Marking block device to locking state when lock job is added

parent 8bd1feb0
......@@ -280,7 +280,7 @@ void BlockDevices::complete(Block *block, bool forceAccept)
if (block->isEncrypted()) {
QString newPath = block->path();
unlocked = find([newPath](const Block *block) {
return block->cryptoBackingDeviceObjectPath() == newPath;
return block->cryptoBackingDeviceObjectPath() == newPath && !block->isLocking();
});
}
......
......@@ -261,16 +261,16 @@ void UDisks2::Monitor::interfacesAdded(const QDBusObjectPath &objectPath, const
operation == UDISKS2_JOB_OF_FS_FORMAT) {
UDisks2::Job *job = new UDisks2::Job(path, dict);
updatePartitionStatus(job, true);
if (job->operation() == Job::Lock) {
for (const QString &dbusObjectPath : job->objects()) {
m_blockDevices->lock(dbusObjectPath);
}
}
connect(job, &UDisks2::Job::completed, this, [this](bool success) {
UDisks2::Job *job = qobject_cast<UDisks2::Job *>(sender());
job->dumpInfo();
if (job->operation() == Job::Lock) {
for (const QString &dbusObjectPath : job->objects()) {
m_blockDevices->lock(dbusObjectPath);
}
} else {
if (job->operation() != Job::Lock) {
updatePartitionStatus(job, success);
}
});
......
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