Verified Commit 85f4b7bf authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Do not cache already searched fprs for p15

This might lead to unexpected problems during testing
when users delete keys plug out / plug in smartcards etc.
An ldap query for a fingerprint is reasonable to do because
setCard is rarely called and should only be called when a new
card is detected.
parent 1ee07e08
Pipeline #62451 passed with stage
in 13 minutes and 58 seconds
...@@ -104,14 +104,8 @@ void P15CardWidget::searchPGPFpr(const std::string &fpr) ...@@ -104,14 +104,8 @@ void P15CardWidget::searchPGPFpr(const std::string &fpr)
if (!entry || !entry->stringValue().startsWith(QStringLiteral("ldap"))) { if (!entry || !entry->stringValue().startsWith(QStringLiteral("ldap"))) {
return; return;
} }
static std::vector<std::string> fprs;
if (fpr.empty() || std::find(fprs.begin(), fprs.end(), fpr) != fprs.end()) {
qCDebug(KLEOPATRA_LOG) << "Already looked for " << fpr.c_str() << "on ldap server";
return;
}
mStatusLabel->setText(i18n("Searching in directory service...")); mStatusLabel->setText(i18n("Searching in directory service..."));
mStatusLabel->setVisible(true); mStatusLabel->setVisible(true);
fprs.push_back (fpr);
qCDebug(KLEOPATRA_LOG) << "Looking for:" << fpr.c_str() << "on ldap server"; qCDebug(KLEOPATRA_LOG) << "Looking for:" << fpr.c_str() << "on ldap server";
QGpgME::KeyListJob *job = QGpgME::openpgp()->keyListJob(true); QGpgME::KeyListJob *job = QGpgME::openpgp()->keyListJob(true);
connect(KeyCache::instance().get(), &KeyCache::keysMayHaveChanged, this, [this, fpr] () { connect(KeyCache::instance().get(), &KeyCache::keysMayHaveChanged, this, [this, fpr] () {
......
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