diff options
| author | Ingo Klöcker <[email protected]> | 2020-08-11 17:02:25 +0200 |
|---|---|---|
| committer | Ingo Klöcker <[email protected]> | 2020-08-11 17:02:25 +0200 |
| commit | 4f2cd3a0c6a8f3633040ff0e8cca787b2bd61fb2 (patch) | |
| tree | 30240535a70bc5e6e62d1d6b51dea5d45017f90a /lang/qt/src/qgpgmechangeexpiryjob.cpp | |
| parent | cpp: Make private helper a file static (diff) | |
| download | gpgme-4f2cd3a0c6a8f3633040ff0e8cca787b2bd61fb2.tar.gz gpgme-4f2cd3a0c6a8f3633040ff0e8cca787b2bd61fb2.zip | |
qt: Support changing expiry of subkeys
* lang/qt/src/changeexpiryjob.h (ChangeExpiryJob::start): New overload
that accepts subkeys (with empty implementation).
* lang/qt/src/qgpgmechangeexpiryjob.h,
lang/qt/src/qgpgmechangeexpiryjob.cpp (QGpgMEChangeExpiryJob::start):
New overload that accepts subkeys.
--
This adds the possibility to change the expiry of subkeys.
GnuPG-bug-id: 4717
Diffstat (limited to 'lang/qt/src/qgpgmechangeexpiryjob.cpp')
| -rw-r--r-- | lang/qt/src/qgpgmechangeexpiryjob.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lang/qt/src/qgpgmechangeexpiryjob.cpp b/lang/qt/src/qgpgmechangeexpiryjob.cpp index 6eb5855f..68591b7e 100644 --- a/lang/qt/src/qgpgmechangeexpiryjob.cpp +++ b/lang/qt/src/qgpgmechangeexpiryjob.cpp @@ -54,20 +54,33 @@ QGpgMEChangeExpiryJob::QGpgMEChangeExpiryJob(Context *context) QGpgMEChangeExpiryJob::~QGpgMEChangeExpiryJob() {} -static QGpgMEChangeExpiryJob::result_type change_expiry(Context *ctx, const Key &key, const QDateTime &expiry) +static QGpgMEChangeExpiryJob::result_type change_expiry(Context *ctx, const Key &key, const QDateTime &expiry, + const std::vector<Subkey> &subkeys) { // convert expiry to "seconds from now"; use 1 second from now if expiry is before the current datetime const unsigned long expires = expiry.isValid() ? std::max<qint64>(QDateTime::currentDateTime().secsTo(expiry), 1) : 0; - auto err = ctx->setExpire(key, expires); + auto err = ctx->setExpire(key, expires, subkeys); return std::make_tuple(err, QString(), Error()); } Error QGpgMEChangeExpiryJob::start(const Key &key, const QDateTime &expiry) { - run(std::bind(&change_expiry, std::placeholders::_1, key, expiry)); + return start(key, expiry, std::vector<Subkey>()); +} + +Error QGpgMEChangeExpiryJob::start(const Key &key, const QDateTime &expiry, const std::vector<Subkey> &subkeys) +{ + run(std::bind(&change_expiry, std::placeholders::_1, key, expiry, subkeys)); + return Error(); +} + +/* For ABI compat not pure virtual. */ +Error ChangeExpiryJob::start(const Key &, const QDateTime &, const std::vector<Subkey> &) +{ return Error(); } + #include "qgpgmechangeexpiryjob.moc" |
