Commit b9d9cd3a authored by Ingo Klöcker's avatar Ingo Klöcker Committed by Ingo Klöcker
Browse files

Require GpgME version 1.16.0

Many of the newer features require a newer version of GpgME. I think it's
time to increase the required version of GpgME and its C++ and Qt bindings
for Kleopatra to 1.16.0 which was released 2021-06-24.
parent 7400a08c
Pipeline #161884 passed with stage
in 4 minutes and 1 second
......@@ -34,7 +34,7 @@ set(KF5_MIN_VERSION "5.92.0")
set(KMIME_VERSION "5.20.40")
set(LIBKLEO_VERSION "5.20.41")
set(QT_REQUIRED_VERSION "5.15.2")
set(GPGME_REQUIRED_VERSION "1.15.0")
set(GPGME_REQUIRED_VERSION "1.16.0")
if (WIN32)
set(KF5_WANT_VERSION "5.70.0")
......@@ -98,14 +98,7 @@ endif()
set(HAVE_QDBUS ${Qt${QT_MAJOR_VERSION}DBus_FOUND})
find_package(Gpgmepp ${GPGME_REQUIRED_VERSION} CONFIG REQUIRED)
if (Gpgmepp_VERSION VERSION_GREATER_EQUAL "1.16.0")
set(GPGMEPP_SUPPORTS_TRUST_SIGNATURES 1)
endif()
find_package(QGpgme ${GPGME_REQUIRED_VERSION} CONFIG REQUIRED)
if (QGpgme_VERSION VERSION_GREATER_EQUAL "1.16.0")
set(QGPGME_SUPPORTS_TRUST_SIGNATURES 1)
set(QGPGME_SUPPORTS_SIGNATURE_EXPIRATION 1)
endif()
if (QGpgme_VERSION VERSION_GREATER_EQUAL "1.17.0")
set(QGPGME_SUPPORTS_CHANGING_EXPIRATION_OF_COMPLETE_KEY 1)
set(QGPGME_CRYPTOCONFIGENTRY_HAS_DEFAULT_VALUE 1)
......
......@@ -24,15 +24,6 @@
/* DBus available */
#cmakedefine01 HAVE_QDBUS
/* Defined if GpgME++ supports trust signatures */
#cmakedefine GPGMEPP_SUPPORTS_TRUST_SIGNATURES 1
/* Defined if QGpgME supports trust signatures */
#cmakedefine QGPGME_SUPPORTS_TRUST_SIGNATURES 1
/* Defined if QGpgME supports setting an expiration date for signatures */
#cmakedefine QGPGME_SUPPORTS_SIGNATURE_EXPIRATION 1
/* Defined if QGpgME supports changing the expiration date of the primary key and the subkeys simultaneously */
#cmakedefine QGPGME_SUPPORTS_CHANGING_EXPIRATION_OF_COMPLETE_KEY 1
......
......@@ -255,17 +255,13 @@ void CertifyCertificateCommand::Private::slotCertificationPrepared()
job->setRemark(dialog->tags());
}
job->setDupeOk(true);
#ifdef QGPGME_SUPPORTS_TRUST_SIGNATURES
if (dialog->trustSignatureSelected() && !dialog->trustSignatureDomain().isEmpty()) {
// always create level 1 trust signatures with complete trust
job->setTrustSignature(TrustSignatureTrust::Complete, 1, dialog->trustSignatureDomain());
}
#endif
#ifdef QGPGME_SUPPORTS_SIGNATURE_EXPIRATION
if (!dialog->expirationDate().isNull()) {
job->setExpirationDate(dialog->expirationDate());
}
#endif
if (const Error err = job->start(key())) {
slotResult(err);
......
......@@ -729,7 +729,6 @@ QString CertificateDetailsWidget::Private::tofuTooltipString(const GpgME::UserID
return html;
}
#ifdef GPGMEPP_SUPPORTS_TRUST_SIGNATURES
namespace
{
auto isGood(const GpgME::UserID::Signature &signature)
......@@ -766,7 +765,6 @@ auto accumulateTrustDomains(const std::vector<GpgME::UserID> &userIds)
);
}
}
#endif
void CertificateDetailsWidget::Private::setupPGPProperties()
{
......@@ -779,7 +777,6 @@ void CertificateDetailsWidget::Private::setupPGPProperties()
connect(ui.userIDTable, &QAbstractItemView::customContextMenuRequested,
q, [this](const QPoint &p) { userIDTableContextMenuRequested(p); });
#ifdef GPGMEPP_SUPPORTS_TRUST_SIGNATURES
const auto trustDomains = accumulateTrustDomains(key.userIDs());
if (trustDomains.empty()) {
HIDE_ROW(trustedIntroducer)
......@@ -787,9 +784,6 @@ void CertificateDetailsWidget::Private::setupPGPProperties()
SHOW_ROW(trustedIntroducer)
ui.trustedIntroducer->setText(QStringList(std::begin(trustDomains), std::end(trustDomains)).join(u", "));
}
#else
HIDE_ROW(trustedIntroducer)
#endif
}
static QString formatDNToolTip(const Kleo::DN &dn)
......
......@@ -250,7 +250,6 @@ auto createInfoButton(const QString &text, QWidget *parent)
return infoBtn;
}
#ifdef QGPGME_SUPPORTS_SIGNATURE_EXPIRATION
QString dateFormatWithFourDigitYear(QLocale::FormatType format)
{
// Force the year to be formatted as four digit number, so that
......@@ -264,7 +263,6 @@ QString formatDate(const QDate &date, QLocale::FormatType format)
{
return QLocale{}.toString(date, dateFormatWithFourDigitYear(format));
}
#endif
}
......@@ -352,10 +350,6 @@ public:
advLay->addLayout(tagsLay);
}
#ifndef QGPGME_SUPPORTS_SIGNATURE_EXPIRATION
mExpirationCheckBox->setVisible(false);
mExpirationDateEdit->setVisible(false);
#else
{
auto layout = new QHBoxLayout{q};
......@@ -389,12 +383,7 @@ public:
advLay->addLayout(layout);
}
#endif
#ifndef QGPGME_SUPPORTS_TRUST_SIGNATURES
mTrustSignatureCB->setVisible(false);
mTrustSignatureDomainLE->setVisible(false);
#else
{
auto layout = new QHBoxLayout{q};
......@@ -423,7 +412,6 @@ public:
advLay->addLayout(layout);
}
#endif
expander->setContentLayout(advLay);
......
Supports Markdown
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