Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Commit fd5bef6

Browse files
committed
[nemo-storage] Marking block device to locking state when lock job is added
1 parent 8bd1feb commit fd5bef6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/udisks2blockdevices.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void BlockDevices::complete(Block *block, bool forceAccept)
280280
if (block->isEncrypted()) {
281281
QString newPath = block->path();
282282
unlocked = find([newPath](const Block *block) {
283-
return block->cryptoBackingDeviceObjectPath() == newPath;
283+
return block->cryptoBackingDeviceObjectPath() == newPath && !block->isLocking();
284284
});
285285
}
286286

src/udisks2monitor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,16 @@ void UDisks2::Monitor::interfacesAdded(const QDBusObjectPath &objectPath, const
261261
operation == UDISKS2_JOB_OF_FS_FORMAT) {
262262
UDisks2::Job *job = new UDisks2::Job(path, dict);
263263
updatePartitionStatus(job, true);
264+
if (job->operation() == Job::Lock) {
265+
for (const QString &dbusObjectPath : job->objects()) {
266+
m_blockDevices->lock(dbusObjectPath);
267+
}
268+
}
264269

265270
connect(job, &UDisks2::Job::completed, this, [this](bool success) {
266271
UDisks2::Job *job = qobject_cast<UDisks2::Job *>(sender());
267272
job->dumpInfo();
268-
269-
if (job->operation() == Job::Lock) {
270-
for (const QString &dbusObjectPath : job->objects()) {
271-
m_blockDevices->lock(dbusObjectPath);
272-
}
273-
} else {
273+
if (job->operation() != Job::Lock) {
274274
updatePartitionStatus(job, success);
275275
}
276276
});

0 commit comments

Comments
 (0)