Commit 702f05d2 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Try to make older and newer compilers happy

GnuPG-bug-id: 5805
parent 24b40d8a
Pipeline #135264 passed with stage
in 3 minutes and 38 seconds
......@@ -1034,13 +1034,22 @@ void ImportCertificatesCommand::Private::setProgressToMaximum()
progressDialog->setValue(progressDialog->maximum());
}
static void disconnectConnection(const QMetaObject::Connection &connection)
{
// trivial function for disconnecting a signal-slot connection because
// using a lambda seems to confuse older GCC / MinGW and unnecessarily
// capturing 'this' generates warnings
QObject::disconnect(connection);
}
void ImportCertificatesCommand::doCancel()
{
const auto jobsToCancel = d->jobs;
std::for_each(std::begin(jobsToCancel), std::end(jobsToCancel),
[this](const auto &job) {
qCDebug(KLEOPATRA_LOG) << "Canceling job" << job.job;
std::for_each(std::cbegin(job.connections), std::cend(job.connections),
[this](const auto &connection) { QObject::disconnect(connection); });
&disconnectConnection);
job.job->slotCancel();
d->importResult(ImportResult{Error::fromCode(GPG_ERR_CANCELED)}, job.job);
});
......
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