[Pkg-gnupg-commit] [gpgme] 87/132: qt: Allow creation of default keys without name
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Wed Apr 26 01:01:30 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gpgme.
commit fbafb5474d8898ba1b267f4b4dfbefe39f04e72f
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Wed Mar 1 11:14:07 2017 +0100
qt: Allow creation of default keys without name
* lang/qt/src/defaultkeygenerationjob.cpp
(DefaultKeyGenerationJob::start): Handle empty name and email.
---
lang/qt/src/defaultkeygenerationjob.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lang/qt/src/defaultkeygenerationjob.cpp b/lang/qt/src/defaultkeygenerationjob.cpp
index 020f4d2..f589384 100644
--- a/lang/qt/src/defaultkeygenerationjob.cpp
+++ b/lang/qt/src/defaultkeygenerationjob.cpp
@@ -91,6 +91,11 @@ void DefaultKeyGenerationJob::slotCancel()
GpgME::Error DefaultKeyGenerationJob::start(const QString &email, const QString &name)
{
+ const QString namePart = name.isEmpty() ? QString() :
+ QStringLiteral("name-real: %1\n").arg(name);
+ const QString mailPart = email.isEmpty() ? QString() :
+ QStringLiteral("name-email: %1\n").arg(email);
+
const QString args = QStringLiteral("<GnupgKeyParms format=\"internal\">\n"
"%ask-passphrase\n"
"key-type: RSA\n"
@@ -99,9 +104,9 @@ GpgME::Error DefaultKeyGenerationJob::start(const QString &email, const QString
"subkey-type: RSA\n"
"subkey-length: 2048\n"
"subkey-usage: encrypt\n"
- "name-email: %1\n"
- "name-real: %2\n"
- "</GnupgKeyParms>").arg(email, name);
+ "%1"
+ "%2"
+ "</GnupgKeyParms>").arg(mailPart, namePart);
d->job = openpgp()->keyGenerationJob();
d->job->installEventFilter(this);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git
More information about the Pkg-gnupg-commit
mailing list