summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <aheinecke@intevation.de>2016-08-10 15:50:03 (GMT)
committerAndre Heinecke <aheinecke@intevation.de>2016-08-10 15:54:22 (GMT)
commit90873cc04db49e1555a6e38c22deefc734921cd1 (patch)
treed04d14459fe330d2bc31b11128b4ad8240020a4e
parent05f3e9901772bfad8e9b54d5adec6d75ea237300 (diff)
Use setDefaultKey in KeySelectionCombo
As KeySelectionCombo does a delayed init setCurrentKey runs into an unpopulated model as it was called before init.
-rw-r--r--src/crypto/gui/signencryptwidget.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/crypto/gui/signencryptwidget.cpp b/src/crypto/gui/signencryptwidget.cpp
index 5b89a66..f667a05 100644
--- a/src/crypto/gui/signencryptwidget.cpp
+++ b/src/crypto/gui/signencryptwidget.cpp
@@ -326,14 +326,8 @@ void SignEncryptWidget::loadKeys()
{
KConfigGroup keys(KSharedConfig::openConfig(), "SignEncryptKeys");
auto cache = KeyCache::instance();
- const auto sigFpr = keys.readEntry("SigningKey", QString());
- const auto encFpr = keys.readEntry("EncryptKey", QString());
- if (!sigFpr.isEmpty()) {
- mSigSelect->setCurrentKey(cache->findByFingerprint(sigFpr.toUtf8().constData()));
- }
- if (!encFpr.isEmpty()) {
- mSelfSelect->setCurrentKey(cache->findByFingerprint(encFpr.toUtf8().constData()));
- }
+ mSigSelect->setDefaultKey(keys.readEntry("SigningKey", QString()));
+ mSelfSelect->setDefaultKey(keys.readEntry("EncryptKey", QString()));
}
void SignEncryptWidget::saveOwnKeys() const