Commit 3fcfe9ea authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Prefill the trust signature domain

If the key to be certified has exactly one user id, then use the domain
of the email address of this user id as default trust signature domain.

GnuPG-bug-id: 5245
parent 2cb7c1e2
Pipeline #61454 passed with stage
in 14 minutes and 49 seconds
......@@ -402,6 +402,19 @@ public:
#endif
}
void updateTrustSignatureDomain()
{
if (mTrustSignatureDomainLE->text().isEmpty() && mTarget.numUserIDs() == 1) {
// try to guess the domain to use for the trust signature
const auto address = mTarget.userID(0).addrSpec();
const auto atPos = address.find('@');
if (atPos != std::string::npos) {
const auto domain = address.substr(atPos + 1);
mTrustSignatureDomainLE->setText(QString::fromUtf8(domain.c_str(), domain.size()));
}
}
}
void setTarget(const GpgME::Key &key)
{
mFprLabel->setText(i18n("Fingerprint: <b>%1</b>",
......@@ -411,6 +424,7 @@ public:
mTarget = key;
updateTags();
updateTrustSignatureDomain();
}
GpgME::Key secKey() const
......
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