summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2018-01-11 10:44:46 +0100
committerAndre Heinecke <[email protected]>2018-01-11 10:44:46 +0100
commit0796e04aa43c4500fb0f2c378b9a6cadf53a0a94 (patch)
treee5bc83da53433127e94dbe089e6c8a354cc5f865
parentb7c91cf722e6dae1ed350241b1408e6f0f76efb9 (diff)
Use old style connect for Keylist in detailswidget
New style connect does not work with this signal and Windows mingw build.
-rw-r--r--src/dialogs/certificatedetailswidget.cpp32
-rw-r--r--src/dialogs/certificatedetailswidget.h9
2 files changed, 31 insertions, 10 deletions
diff --git a/src/dialogs/certificatedetailswidget.cpp b/src/dialogs/certificatedetailswidget.cpp
index 48f6807..0c9c427 100644
--- a/src/dialogs/certificatedetailswidget.cpp
+++ b/src/dialogs/certificatedetailswidget.cpp
@@ -89,6 +89,9 @@ public:
void smimeLinkActivated(const QString &link);
void setUpdatedKey(const GpgME::Key &key);
+ void keyListDone(const GpgME::KeyListResult &,
+ const std::vector<GpgME::Key> &, const QString &,
+ const GpgME::Error &);
Ui::CertificateDetailsWidget ui;
GpgME::Key key;
@@ -507,6 +510,20 @@ CertificateDetailsWidget::~CertificateDetailsWidget()
{
}
+void CertificateDetailsWidget::Private::keyListDone(const GpgME::KeyListResult &,
+ const std::vector<GpgME::Key> &keys,
+ const QString &,
+ const GpgME::Error &) {
+ updateInProgress = false;
+ if (keys.size() != 1) {
+ qCWarning(KLEOPATRA_LOG) << "Invalid keylist result in update.";
+ return;
+ }
+ // As we listen for keysmayhavechanged we get the update
+ // after updating the keycache.
+ KeyCache::mutableInstance()->insert(keys);
+}
+
void CertificateDetailsWidget::Private::setUpdatedKey(const GpgME::Key &k)
{
key = k;
@@ -535,16 +552,9 @@ void CertificateDetailsWidget::setKey(const GpgME::Key &key)
auto ctx = QGpgME::Job::context(job);
ctx->addKeyListMode(GpgME::WithTofu);
- connect(job, &QGpgME::KeyListJob::result, job, [this, job](GpgME::KeyListResult, std::vector<GpgME::Key> keys, QString, GpgME::Error) {
- d->updateInProgress = false;
- if (keys.size() != 1) {
- qCWarning(KLEOPATRA_LOG) << "Invalid keylist result in update.";
- return;
- }
- // As we listen for keysmayhavechanged we get the update
- // after updating the keycache.
- KeyCache::mutableInstance()->insert(keys);
- });
+ // Windows QGpgME new style connect problem makes this necessary.
+ 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)));
job->start(QStringList() << key.primaryFingerprint(), key.hasSecret());
}
@@ -602,3 +612,5 @@ GpgME::Key CertificateDetailsDialog::key() const
Q_ASSERT(w);
return w->key();
}
+
+#include "moc_certificatedetailswidget.cpp"
diff --git a/src/dialogs/certificatedetailswidget.h b/src/dialogs/certificatedetailswidget.h
index 6bdff4d..d202936 100644
--- a/src/dialogs/certificatedetailswidget.h
+++ b/src/dialogs/certificatedetailswidget.h
@@ -21,8 +21,12 @@
#include <QWidget>
#include <QDialog>
+#include <vector>
+
namespace GpgME {
class Key;
+class Error;
+class KeyListResult;
}
class CertificateDetailsWidget : public QWidget
@@ -39,6 +43,11 @@ public:
private:
class Private;
const QScopedPointer<Private> d;
+
+ // Windows QGpgME new style connect problem makes this necessary.
+ Q_PRIVATE_SLOT(d, void keyListDone(const GpgME::KeyListResult &,
+ const std::vector<GpgME::Key> &, const QString &,
+ const GpgME::Error &))
};