Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[nemo-storage] Marking block device to locking state when lock job is…
… added
  • Loading branch information
rainemak committed May 27, 2019
1 parent 8bd1feb commit fd5bef6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/udisks2blockdevices.cpp
Expand Up @@ -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();
});
}

Expand Down
12 changes: 6 additions & 6 deletions src/udisks2monitor.cpp
Expand Up @@ -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);

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 {
}

connect(job, &UDisks2::Job::completed, this, [this](bool success) {
UDisks2::Job *job = qobject_cast<UDisks2::Job *>(sender());
job->dumpInfo();
if (job->operation() != Job::Lock) {
updatePartitionStatus(job, success);
}
});
Expand Down

0 comments on commit fd5bef6

Please sign in to comment.