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

Remove special widget for OpenPGP keyserver entry

It is only used for the gpg/keyserver entry that is no longer made
available via gpgconf in GnuPG 2.3. Moreover, it tries to parse
the keyserver entry which fails for LDAP urls. And it silently keeps
the optional keyserver configuration options one can append to gpg's
(but not dirmngr's) keyserver option. But those option may no longer be
appropriate if the user changes the keyserver.

Instead of this special widget now a simple line edit is used which
isn't very user friendly, but, OTOH, it doesn't hide anything from the

GnuPG-bug-id: 5404
parent 2e7c0cc0
......@@ -483,8 +483,7 @@ static const struct WidgetsByEntryName {
const char *entryGlob;
constructor create;
} widgetsByEntryName[] = {
{ "*/*/debug-level", &_create<CryptoConfigEntryDebugLevel> },
{ "gpg/*/keyserver", &_create<CryptoConfigEntryKeyserver> }
{ "*/*/debug-level", &_create<CryptoConfigEntryDebugLevel> }
static const unsigned int numWidgetsByEntryName = sizeof widgetsByEntryName / sizeof * widgetsByEntryName;
......@@ -930,33 +929,6 @@ void Kleo::CryptoConfigEntryLDAPURL::setURLList(const QList<QUrl> &urlList)
CryptoConfigModule *module,
QGpgME::CryptoConfigEntry *entry,
const QString &entryName,
QGridLayout *glay, QWidget *widget)
: CryptoConfigEntryGUI(module, entry, entryName)
mLabel = new QLabel(widget);
mPushButton = new QPushButton(i18n("Edit..."), widget);
const int row = glay->rowCount();
QLabel *label = new QLabel(i18n("Use keyserver at"), widget);
glay->addWidget(label, row, 1);
auto hlay = new QHBoxLayout;
glay->addLayout(hlay, row, 2);
hlay->addWidget(mLabel, 1);
if (entry->isReadOnly()) {
} else {
connect(mPushButton, &QPushButton::clicked, this, &CryptoConfigEntryKeyserver::slotOpenDialog);
Kleo::ParsedKeyserver Kleo::parseKeyserver(const QString &str)
const QStringList list = str.split(QRegExp(QLatin1String("[\\s,]")), Qt::SkipEmptyParts);
......@@ -999,53 +971,4 @@ QString Kleo::assembleKeyserver(const ParsedKeyserver &keyserver)
return result;
void Kleo::CryptoConfigEntryKeyserver::doLoad()
mParsedKeyserver = parseKeyserver(mEntry->stringValue());
void Kleo::CryptoConfigEntryKeyserver::doSave()
mParsedKeyserver.url = mLabel->text();
static QList<QUrl> string2urls(const QString &str)
QList<QUrl> ret;
if (str.isEmpty()) {
return ret;
ret << QUrl::fromUserInput(str);
return ret;
static QString urls2string(const QList<QUrl> &urls)
return urls.empty() ? QString() : urls.front().url();
void Kleo::CryptoConfigEntryKeyserver::slotOpenDialog()
// I'm a bad boy and I do it all on the stack. Enough classes already :)
// This is just a simple dialog around the directory-services-widget
QDialog dialog(mPushButton->parentWidget());
dialog.setWindowTitle(i18nc("@title:window", "Configure Keyservers"));
auto dirserv = new DirectoryServicesWidget(&dialog);
prepareURLCfgDialog(&dialog, dirserv, mEntry->isReadOnly());
if (dialog.exec()) {
#include "moc_cryptoconfigmodule_p.cpp"
......@@ -282,27 +282,5 @@ private:
QList<QUrl> mURLList;
* A widget manager for a (OpenPGP) keyserver entry in the crypto config
class CryptoConfigEntryKeyserver : public CryptoConfigEntryGUI
CryptoConfigEntryKeyserver(CryptoConfigModule *module,
QGpgME::CryptoConfigEntry *entry,
const QString &entryName,
QGridLayout *layout,
QWidget *parent = nullptr);
void doSave() override;
void doLoad() override;
private Q_SLOTS:
void slotOpenDialog();
QLabel *mLabel = nullptr;
QPushButton *mPushButton = nullptr;
ParsedKeyserver mParsedKeyserver;
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