Commit 12e4b81f authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Emit currentKeyChanged() signal even if it is already set

If the key that is set with setCurrentKey() became the current key by
changes in the underlying model (i.e. because it happens to be the item
at the current index), then no signal was emitted. This triggered
an update problem in the key approval dialog noticed after the previous
commit.

This problem is fixed by this change because on all model changes
updateWithDefaultKey() is called which in turn calls setCurrentKey().

GnuPG-bug-id: 5283
parent 744e209a
......@@ -474,7 +474,9 @@ void Kleo::KeySelectionCombo::setCurrentKey(const QString &fingerprint)
const auto cur = currentKey();
if (!cur.isNull() && !fingerprint.isEmpty() &&
fingerprint == QLatin1String(cur.primaryFingerprint())) {
// Already set
// already set; still emit a changed signal because the current key may
// have become the item at the current index by changes in the underlying model
Q_EMIT currentKeyChanged(cur);
return;
}
const int idx = findData(fingerprint, KeyList::FingerprintRole, Qt::MatchExactly);
......
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