diff --git a/lang/qt/src/exportjob.h b/lang/qt/src/exportjob.h index 4fdb468d..91b5c90e 100644 --- a/lang/qt/src/exportjob.h +++ b/lang/qt/src/exportjob.h @@ -80,6 +80,12 @@ public: virtual void setExportFlags (unsigned int flags); + /** + * Starts the export operation synchronously, otherwise behaves identical to + * ExportJob::start + */ + virtual GpgME::Error exec(const QStringList &patterns, QByteArray &data); + Q_SIGNALS: void result(const GpgME::Error &result, const QByteArray &keyData, const QString &auditLogAsHtml = QString(), const GpgME::Error &auditLogError = GpgME::Error()); }; diff --git a/lang/qt/src/qgpgmeexportjob.cpp b/lang/qt/src/qgpgmeexportjob.cpp index e9bc0a4d..803af7dd 100644 --- a/lang/qt/src/qgpgmeexportjob.cpp +++ b/lang/qt/src/qgpgmeexportjob.cpp @@ -88,6 +88,14 @@ Error QGpgMEExportJob::start(const QStringList &patterns) return Error(); } +Error QGpgMEExportJob::exec(const QStringList &patterns, QByteArray &data) +{ + auto mode = m_exportMode | m_additionalExportModeFlags; + const result_type r = export_qba(context(), patterns, mode); + data = std::get<1>(r); + return std::get<0>(r); +} + void QGpgMEExportJob::setExportFlags(unsigned int flags) { m_additionalExportModeFlags = flags; @@ -97,4 +105,10 @@ void QGpgMEExportJob::setExportFlags(unsigned int flags) void ExportJob::setExportFlags(unsigned int) { } + +/* For ABI compat not pure virtual. */ +GpgME::Error ExportJob::exec(const QStringList &patterns, QByteArray &data) +{ +} + #include "qgpgmeexportjob.moc" diff --git a/lang/qt/src/qgpgmeexportjob.h b/lang/qt/src/qgpgmeexportjob.h index 272fff4d..b60b95f2 100644 --- a/lang/qt/src/qgpgmeexportjob.h +++ b/lang/qt/src/qgpgmeexportjob.h @@ -69,6 +69,7 @@ public: /* from ExportJob */ GpgME::Error start(const QStringList &patterns) override; + GpgME::Error exec(const QStringList &patterns, QByteArray &data) override; private: unsigned int m_exportMode;