diff options
author | Ingo Klöcker <[email protected]> | 2022-01-04 14:38:49 +0000 |
---|---|---|
committer | Ingo Klöcker <[email protected]> | 2022-01-04 14:44:16 +0000 |
commit | 4e80563fabfdf1d1c136d65252e5353fdd1e9092 (patch) | |
tree | f1edc3ecd890387f94e2bb5ef4b14b88f4394906 /lang/qt/src/qgpgmeexportjob.h | |
parent | cpp: Allow export of secret keys (diff) | |
download | gpgme-4e80563fabfdf1d1c136d65252e5353fdd1e9092.tar.gz gpgme-4e80563fabfdf1d1c136d65252e5353fdd1e9092.zip |
qt: Use QGpgMEExportJob also for export of secret keys
* lang/qt/src/protocol.h (Protocol::secretKeyExportJob): Document
charset argument as ignored.
* lang/qt/src/protocol_p.h (Protocol::secretKeyExportJob): Use
QGpgMEExportJob instead of QGpgMESecretKeyExportJob.
* lang/qt/src/qgpgmeexportjob.h (class QGpgMEExportJob): Add c'tor
taking an export mode. Add member m_exportMode. Rename member m_flags to
m_additionalExportModeFlags.
(QGpgMEExportJob::~QGpgMEExportJob): Mark as override.
* lang/qt/src/qgpgmeexportjob.cpp (QGpgMEExportJob::QGpgMEExportJob):
Delegate to new c'tor. Implement new c'tor.
(QGpgMEExportJob::~QGpgMEExportJob): Use default.
(export_qba): Rename argument flags to mode.
(QGpgMEExportJob::start): Pass combination of export mode and additional
mode flags to export_qba.
(QGpgMEExportJob::setExportFlags): Adapt to renaming of member.
* lang/qt/tests/run-exportjob.cpp: New.
--
This change makes it possible to export secret OpenPGP keys.
GnuPG-bug-id: 5757
Diffstat (limited to 'lang/qt/src/qgpgmeexportjob.h')
-rw-r--r-- | lang/qt/src/qgpgmeexportjob.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lang/qt/src/qgpgmeexportjob.h b/lang/qt/src/qgpgmeexportjob.h index 3f6bd0e2..b77bad1c 100644 --- a/lang/qt/src/qgpgmeexportjob.h +++ b/lang/qt/src/qgpgmeexportjob.h @@ -5,6 +5,8 @@ Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH + Copyright (c) 2022 by g10 Code GmbH + Software engineering by Ingo Klöcker <[email protected]> QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -56,15 +58,21 @@ public Q_SLOTS: #endif public: explicit QGpgMEExportJob(GpgME::Context *context); - ~QGpgMEExportJob(); + // Creates an export job with forced export mode @p exportMode. The + // export mode flags set with @p exportMode cannot be overridden with + // setExportFlags. + explicit QGpgMEExportJob(GpgME::Context *context, unsigned int exportMode); + ~QGpgMEExportJob() Q_DECL_OVERRIDE; /* from ExportJob */ - void setExportFlags (unsigned int flags) Q_DECL_OVERRIDE; + void setExportFlags(unsigned int flags) Q_DECL_OVERRIDE; /* from ExportJob */ GpgME::Error start(const QStringList &patterns) Q_DECL_OVERRIDE; + private: - unsigned int m_flags; + unsigned int m_exportMode; + unsigned int m_additionalExportModeFlags; }; } |