qt: Add function for synchronously executing ExportJob
* lang/qt/src/exportjob: Add exec function. * lang/qt/src/qgpgmeexportjob.cpp: Implement exec function. * lang/qt/src/qgpgmeexportjob.h: Override exec function. -- GnuPG-Bug-Id: 6893
This commit is contained in:
parent
0011412193
commit
47f3d92bf3
@ -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());
|
||||
};
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user