Commit 35f24bc6 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Fix build with gpgme < 1.15.0

parent 66efcb74
Pipeline #46496 passed with stage
in 19 minutes and 52 seconds
...@@ -46,8 +46,9 @@ ...@@ -46,8 +46,9 @@
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0 #if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
# define GPGME_HAS_REMARKS # define GPGME_HAS_REMARKS
#endif #endif
#if GPGMEPP_VERSION >= 0x10E01 // 1.14.1 #if GPGMEPP_VERSION >= 0x10F00 // 1.15.0
#include <QGpgME/Debug> # define GPGME_HAS_WITH_SECRET
# include <QGpgME/Debug>
#endif #endif
#define HIDE_ROW(row) \ #define HIDE_ROW(row) \
...@@ -603,15 +604,21 @@ void CertificateDetailsWidget::setKey(const GpgME::Key &key) ...@@ -603,15 +604,21 @@ void CertificateDetailsWidget::setKey(const GpgME::Key &key)
auto ctx = QGpgME::Job::context(job); auto ctx = QGpgME::Job::context(job);
ctx->addKeyListMode(GpgME::WithTofu); ctx->addKeyListMode(GpgME::WithTofu);
ctx->addKeyListMode(GpgME::SignatureNotations); ctx->addKeyListMode(GpgME::SignatureNotations);
#ifdef GPGME_HAS_WITH_SECRET
if (key.hasSecret()) { if (key.hasSecret()) {
ctx->addKeyListMode(GpgME::WithSecret); ctx->addKeyListMode(GpgME::WithSecret);
} }
#endif
// Windows QGpgME new style connect problem makes this necessary. // Windows QGpgME new style connect problem makes this necessary.
connect(job, SIGNAL(result(GpgME::KeyListResult,std::vector<GpgME::Key>,QString,GpgME::Error)), connect(job, SIGNAL(result(GpgME::KeyListResult,std::vector<GpgME::Key>,QString,GpgME::Error)),
this, SLOT(keyListDone(GpgME::KeyListResult,std::vector<GpgME::Key>,QString,GpgME::Error))); this, SLOT(keyListDone(GpgME::KeyListResult,std::vector<GpgME::Key>,QString,GpgME::Error)));
#ifdef GPGME_HAS_WITH_SECRET
job->start(QStringList() << QLatin1String(key.primaryFingerprint())); job->start(QStringList() << QLatin1String(key.primaryFingerprint()));
#else
job->start(QStringList() << QLatin1String(key.primaryFingerprint()), key.hasSecret());
#endif
} }
GpgME::Key CertificateDetailsWidget::key() const GpgME::Key CertificateDetailsWidget::key() 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