Skip to content

Commit

Permalink
Change finished, failed handle order for lock_device
Browse files Browse the repository at this point in the history
  • Loading branch information
deXol committed Feb 6, 2023
1 parent 9d50a14 commit cbb7c1b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/MPDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8606,19 +8606,19 @@ void MPDevice::lockDevice(const MessageHandlerCb &cb)
const auto afterFn = [](const QByteArray &, bool &) -> bool { return true; };
jobs->append(new MPCommandJob(this, MPCmd::LOCK_DEVICE, afterFn));

connect(jobs, &AsyncJobs::finished, [cb](const QByteArray &)
{
qInfo() << "Lock device was successful.";
cb(true, "");
});

connect(jobs, &AsyncJobs::failed, [cb](AsyncJob *failedJob)
{
Q_UNUSED(failedJob);
qCritical() << "Failed to lock device!";
cb(false, {});
});

connect(jobs, &AsyncJobs::finished, [cb](const QByteArray &)
{
qInfo() << "Lock device was successful.";
cb(true, "");
});

jobsQueue.enqueue(jobs);
runAndDequeueJobs();
}
Expand Down

0 comments on commit cbb7c1b

Please sign in to comment.