diff options
-rw-r--r-- | framework/src/domain/mime/mimetreeparser/tests/gpgerrortest.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/framework/src/domain/mime/mimetreeparser/tests/gpgerrortest.cpp b/framework/src/domain/mime/mimetreeparser/tests/gpgerrortest.cpp index 7e0e0d04..356c0821 100644 --- a/framework/src/domain/mime/mimetreeparser/tests/gpgerrortest.cpp +++ b/framework/src/domain/mime/mimetreeparser/tests/gpgerrortest.cpp | |||
@@ -19,9 +19,6 @@ | |||
19 | 19 | ||
20 | #include <objecttreeparser.h> | 20 | #include <objecttreeparser.h> |
21 | 21 | ||
22 | #include <QGpgME/Protocol> | ||
23 | #include <gpgme++/context.h> | ||
24 | #include <gpgme++/engineinfo.h> | ||
25 | #include <gpgme.h> | 22 | #include <gpgme.h> |
26 | 23 | ||
27 | #include <QDebug> | 24 | #include <QDebug> |
@@ -148,10 +145,14 @@ public Q_SLOTS: | |||
148 | mResetGpgmeEngine = false; | 145 | mResetGpgmeEngine = false; |
149 | mModifiedEnv.clear(); | 146 | mModifiedEnv.clear(); |
150 | { | 147 | { |
151 | QGpgME::openpgp(); // We need to intialize it, otherwise ctx will be a nullpointer | 148 | |
152 | const GpgME::Context *ctx = GpgME::Context::createForProtocol(GpgME::Protocol::OpenPGP); | 149 | gpgme_check_version(0); |
153 | const auto engineinfo = ctx->engineInfo(); | 150 | gpgme_ctx_t ctx = 0; |
154 | mGpgmeEngine_fname = engineinfo.fileName(); | 151 | gpgme_new(&ctx); |
152 | gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP); | ||
153 | gpgme_engine_info_t info = gpgme_ctx_get_engine_info(ctx); | ||
154 | mGpgmeEngine_fname = info->file_name; | ||
155 | gpgme_release(ctx); | ||
155 | } | 156 | } |
156 | mEnv = QProcessEnvironment::systemEnvironment(); | 157 | mEnv = QProcessEnvironment::systemEnvironment(); |
157 | unsetEnv("GNUPGHOME"); | 158 | unsetEnv("GNUPGHOME"); |