aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/GpgContext.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-01-02 03:40:22 +0000
committerSaturneric <[email protected]>2022-01-02 03:40:22 +0000
commita056f2186de2470d4328bd1cd682e5e484af4587 (patch)
tree27775ca169ad93fc812e94a4da99ebd3fa1c53f9 /src/gpg/GpgContext.cpp
parent<refactor, test>(core, test): test decryption when key not found (diff)
downloadGpgFrontend-a056f2186de2470d4328bd1cd682e5e484af4587.tar.gz
GpgFrontend-a056f2186de2470d4328bd1cd682e5e484af4587.zip
<refactor, fixed, test>(core, ui): add & modify core and ui
1. add init functions for core. 2. add non ascii settings. 3. fit ui with this version of core.
Diffstat (limited to 'src/gpg/GpgContext.cpp')
-rw-r--r--src/gpg/GpgContext.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gpg/GpgContext.cpp b/src/gpg/GpgContext.cpp
index ff483637..8ecb7b87 100644
--- a/src/gpg/GpgContext.cpp
+++ b/src/gpg/GpgContext.cpp
@@ -49,7 +49,7 @@ GpgContext::GpgContext(const GpgContextInitArgs &args) : args_(args) {
if (_first) {
/* Initialize the locale environment. */
LOG(INFO) << "locale" << setlocale(LC_CTYPE, nullptr);
- gpgme_check_version(nullptr);
+ info_.GpgMEVersion = gpgme_check_version(nullptr);
gpgme_set_locale(nullptr, LC_CTYPE, setlocale(LC_CTYPE, nullptr));
#ifdef LC_MESSAGES
gpgme_set_locale(nullptr, LC_MESSAGES, setlocale(LC_MESSAGES, nullptr));
@@ -148,9 +148,12 @@ void GpgContext::init_ctx() {
info_.DatabasePath = "default";
}
- /** Setting the output type must be done at the beginning */
- /** think this means ascii-armor --> ? */
- gpgme_set_armor(*this, 1);
+ if (args_.ascii) {
+ /** Setting the output type must be done at the beginning */
+ /** think this means ascii-armor --> ? */
+ gpgme_set_armor(*this, 1);
+ }
+
// Speed up loading process
gpgme_set_offline(*this, 1);