diff options
Diffstat (limited to 'lang/qt/src')
-rw-r--r-- | lang/qt/src/qgpgmebackend.cpp | 18 | ||||
-rw-r--r-- | lang/qt/src/qgpgmebackend.h | 14 |
2 files changed, 32 insertions, 0 deletions
diff --git a/lang/qt/src/qgpgmebackend.cpp b/lang/qt/src/qgpgmebackend.cpp index 1167daee..abecde2c 100644 --- a/lang/qt/src/qgpgmebackend.cpp +++ b/lang/qt/src/qgpgmebackend.cpp @@ -507,3 +507,21 @@ const char *QGpgME::QGpgMEBackend::enumerateProtocols(int i) const default: return 0; } } + +static QGpgME::QGpgMEBackend *gpgmeBackend; + +QGpgME::Protocol *QGpgME::openpgp() +{ + if (!gpgmeBackend) { + gpgmeBackend = new QGpgME::QGpgMEBackend(); + } + return gpgmeBackend->openpgp(); +} + +QGpgME::Protocol *QGpgME::smime() +{ + if (!gpgmeBackend) { + gpgmeBackend = new QGpgME::QGpgMEBackend(); + } + return gpgmeBackend->smime(); +} diff --git a/lang/qt/src/qgpgmebackend.h b/lang/qt/src/qgpgmebackend.h index d442fa55..16b70cf8 100644 --- a/lang/qt/src/qgpgmebackend.h +++ b/lang/qt/src/qgpgmebackend.h @@ -72,6 +72,20 @@ namespace QGpgME class CryptoConfig; class Protocol; +/** Obtain a reference to the OpenPGP Protocol. + * + * The reference is to a static object. + * @returns Refrence to the OpenPGP Protocol. + */ +Protocol *openpgp(); + +/** Obtain a reference to the smime Protocol. + * + * The reference is to a static object. + * @returns Refrence to the smime Protocol. + */ +Protocol *smime(); + class QGpgMEBackend { public: |