qt: Allow build with older GnuPG (< 2.2.18).

* lang/qt/tests/t-remarks.cpp (initTestCase): Check gpg for
allow-weak-key-signatures option.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-11-11 11:58:28 +09:00
parent eb99e8c483
commit 276f3390e1

View File

@ -43,6 +43,7 @@
#include "protocol.h"
#include "signkeyjob.h"
#include "context.h"
#include "engineinfo.h"
#include "t-support.h"
@ -503,7 +504,9 @@ private Q_SLOTS:
qputenv("GNUPGHOME", mDir.path().toUtf8());
QFile conf(mDir.path() + QStringLiteral("/gpg.conf"));
QVERIFY(conf.open(QIODevice::WriteOnly));
if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() >= "2.2.18") {
conf.write("allow-weak-key-signatures");
}
conf.close();
}