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

Require GpgME version 1.14.0

parent 68b4545e
......@@ -34,7 +34,7 @@ set(KF5_MIN_VERSION "5.89.0")
set(KMIME_VERSION "5.19.40")
set(LIBKLEO_VERSION "5.19.46")
set(QT_REQUIRED_VERSION "5.15.2")
set(GPGME_REQUIRED_VERSION "1.13.1")
set(GPGME_REQUIRED_VERSION "1.14.0")
set(BOOST_REQUIRED_VERSION "1.58")
if (WIN32)
......
......@@ -33,11 +33,6 @@
#include <KLocalizedString>
#include "kleopatra_debug.h"
#include <gpgme++/gpgmepp_version.h>
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
# define GPGME_HAS_REMARKS
#endif
using namespace Kleo;
using namespace Kleo::Commands;
using namespace GpgME;
......@@ -206,11 +201,9 @@ void CertifyCertificateCommand::doStart()
Q_ASSERT(d->dialog);
Key target = d->key();
#ifdef GPGME_HAS_REMARKS
if (!(target.keyListMode() & GpgME::SignatureNotations)) {
target.update();
}
#endif
d->dialog->setCertificateToCertify(target);
if (d->uids.size()) {
d->dialog->setSelectedUserIDs(d->uids);
......@@ -257,14 +250,11 @@ void CertifyCertificateCommand::Private::slotCertificationPrepared()
job->setUserIDsToSign(dialog->selectedUserIDs());
job->setSigningKey(dialog->selectedSecretKey());
job->setCheckLevel(dialog->selectedCheckLevel());
#ifdef GPGME_HAS_REMARKS
if (!dialog->tags().isEmpty()) {
// do not set an empty remark to avoid an empty signature notation (GnuPG bug T5142)
job->setRemark(dialog->tags());
}
// This also came with 1.14.0
job->setDupeOk(true);
#endif
#ifdef QGPGME_SUPPORTS_TRUST_SIGNATURES
if (dialog->trustSignatureSelected() && !dialog->trustSignatureDomain().isEmpty()) {
// always create level 1 trust signatures with complete trust
......
......@@ -55,9 +55,6 @@
#include <set>
#include <gpgme++/gpgmepp_version.h>
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
# define GPGME_HAS_REMARKS
#endif
#if GPGMEPP_VERSION >= 0x10F00 // 1.15.0
# define GPGME_HAS_WITH_SECRET
# include <QGpgME/Debug>
......@@ -492,7 +489,6 @@ void CertificateDetailsWidget::Private::setupCommonProperties()
GpgME::Error err;
QStringList tagList;
#ifdef GPGME_HAS_REMARKS
for (const auto &tag: uid.remarks(Tags::tagKeys(), err)) {
if (err) {
qCWarning(KLEOPATRA_LOG) << "Getting remarks for user id" << uid.id() << "failed:" << err;
......@@ -500,7 +496,6 @@ void CertificateDetailsWidget::Private::setupCommonProperties()
tagList << QString::fromStdString(tag);
}
qCDebug(KLEOPATRA_LOG) << "tagList:" << tagList;
#endif
const auto tags = tagList.join(QStringLiteral("; "));
item->setData(3, Qt::DisplayRole, tags);
item->setData(3, Qt::ToolTipRole, toolTip);
......
......@@ -47,11 +47,6 @@
#include <algorithm>
#include <gpgme++/gpgmepp_version.h>
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
# define GPGME_HAS_REMARKS
#endif
using namespace Kleo;
using namespace Kleo::Dialogs;
using namespace Kleo::Commands;
......@@ -208,11 +203,9 @@ CertificateSelectionDialog::Private::Private(CertificateSelectionDialog *qq)
setUpUI(q);
ui.tabWidget.setFlatModel(AbstractKeyListModel::createFlatKeyListModel(q));
ui.tabWidget.setHierarchicalModel(AbstractKeyListModel::createHierarchicalKeyListModel(q));
#ifdef GPGME_HAS_REMARKS
const auto tagKeys = Tags::tagKeys();
ui.tabWidget.flatModel()->setRemarkKeys(tagKeys);
ui.tabWidget.hierarchicalModel()->setRemarkKeys(tagKeys);
#endif
ui.tabWidget.connectSearchBar(&ui.searchBar);
connect(&ui.tabWidget, &TabWidget::currentViewChanged,
......
......@@ -48,11 +48,6 @@
#include <gpgme++/key.h>
#include <gpgme++/gpgmepp_version.h>
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
# define GPGME_HAS_REMARKS
#endif
using namespace Kleo;
namespace {
......@@ -340,9 +335,6 @@ public:
advLay->addLayout(layout);
}
#ifndef GPGME_HAS_REMARKS
mTagsLE->setVisible(false);
#else
{
auto tagsLay = new QHBoxLayout{q};
......@@ -359,7 +351,6 @@ public:
advLay->addLayout(tagsLay);
}
#endif
#ifndef QGPGME_SUPPORTS_SIGNATURE_EXPIRATION
mExpirationCheckBox->setVisible(false);
......@@ -443,9 +434,7 @@ public:
});
connect(mSecKeySelect, &KeySelectionCombo::currentKeyChanged, [this] (const GpgME::Key &) {
#ifdef GPGME_HAS_REMARKS
updateTags();
#endif
checkOwnerTrust();
Q_EMIT q->changed();
});
......@@ -480,7 +469,6 @@ public:
if (mTagsLE->isModified()) {
return;
}
#ifdef GPGME_HAS_REMARKS
GpgME::Key remarkKey = mSecKeySelect->currentKey();
if (!remarkKey.isNull()) {
......@@ -505,7 +493,6 @@ public:
}
mTagsLE->setText(remark);
}
#endif
}
void updateTrustSignatureDomain()
......
......@@ -25,11 +25,6 @@
#include <Libkleo/Formatting>
#include <gpgme++/gpgmepp_version.h>
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
# define GPGME_HAS_EXPORT_FLAGS
#endif
using namespace Kleo;
class ExportWidget::Private
......@@ -151,9 +146,7 @@ void ExportWidget::setKey(const GpgME::Subkey &key, unsigned int flags)
connect(job, &QGpgME::ExportJob::result,
this, &ExportWidget::exportResult);
#ifdef GPGME_HAS_EXPORT_FLAGS
job->setExportFlags(flags);
#endif
job->start(QStringList() << QLatin1String(key.fingerprint()) + QLatin1Char('!'));
}
......@@ -172,9 +165,7 @@ void ExportWidget::setKey(const GpgME::Key &key, unsigned int flags)
connect(job, &QGpgME::ExportJob::result,
this, &ExportWidget::exportResult);
#ifdef GPGME_HAS_EXPORT_FLAGS
job->setExportFlags(flags);
#endif
job->start(QStringList() << QLatin1String(key.primaryFingerprint()));
}
......
......@@ -30,11 +30,6 @@
#include "kleopatra_debug.h"
#include <gpgme++/gpgmepp_version.h>
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
# define GPGME_HAS_UIDHASH
#endif
using namespace Kleo;
namespace {
......@@ -75,11 +70,9 @@ bool CertificationKeyFilter::matches(const GpgME::Key &key, Kleo::KeyFilter::Mat
static bool uidsAreEqual(const GpgME::UserID &lhs, const GpgME::UserID &rhs)
{
// use uidhash if available
#ifdef GPGME_HAS_UIDHASH
if (lhs.uidhash() && rhs.uidhash()) {
return strcmp(lhs.uidhash(), rhs.uidhash()) == 0;
}
#endif
// compare actual user ID string and primary key; this is not unique, but it's all we can do if uidhash is missing
return qstrcmp(lhs.id(), rhs.id()) == 0
&& qstrcmp(lhs.parent().primaryFingerprint(), rhs.parent().primaryFingerprint()) == 0;
......
......@@ -25,9 +25,6 @@
#include <QMenu>
#include <gpgme++/gpgmepp_version.h>
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
# define GPGME_HAS_EXPORT_FLAGS
#endif
#if GPGMEPP_VERSION >= 0x10E01 // 1.14.1
# define CHANGEEXPIRYJOB_SUPPORTS_SUBKEYS
#endif
......@@ -92,7 +89,6 @@ void SubKeysWidget::Private::tableContextMenuRequested(const QPoint &p)
}
#endif // CHANGEEXPIRYJOB_SUPPORTS_SUBKEYS
#ifdef GPGME_HAS_EXPORT_FLAGS
if (subkey.parent().protocol() == GpgME::OpenPGP && subkey.canAuthenticate()) {
hasActions = true;
menu->addAction(QIcon::fromTheme(QStringLiteral("view-certificate-export")),
......@@ -103,7 +99,6 @@ void SubKeysWidget::Private::tableContextMenuRequested(const QPoint &p)
dlg->exec();
});
}
#endif // GPGME_HAS_EXPORT_FLAGS
if (!subkey.isSecret()) {
hasActions = true;
......
......@@ -42,11 +42,6 @@
#include <KSharedConfig>
#include <KLocalizedString>
#include <gpgme++/gpgmepp_version.h>
#if GPGMEPP_VERSION >= 0x10E00 // 1.14.0
# define GPGME_HAS_REMARKS
#endif
#define TAGS_COLUMN 13
using namespace Kleo;
......@@ -292,10 +287,8 @@ void KeyTreeView::init()
<< KeyList::LastUpdate
<< KeyList::Issuer
<< KeyList::SerialNumber
#ifdef GPGME_HAS_REMARKS
// If a column is added before this TAGS_COLUMN define has to be updated accordingly
<< KeyList::Remarks
#endif
);
m_view->setModel(rearangingModel);
......@@ -386,7 +379,6 @@ void KeyTreeView::restoreExpandState()
void KeyTreeView::setUpTagKeys()
{
#ifdef GPGME_HAS_REMARKS
const auto tagKeys = Tags::tagKeys();
if (m_hierarchicalModel) {
m_hierarchicalModel->setRemarkKeys(tagKeys);
......@@ -394,7 +386,6 @@ void KeyTreeView::setUpTagKeys()
if (m_flatModel) {
m_flatModel->setRemarkKeys(tagKeys);
}
#endif
}
void KeyTreeView::saveLayout(KConfigGroup &group)
......
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