diff options
author | Saturneric <[email protected]> | 2021-08-29 10:49:58 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-08-29 10:49:58 +0000 |
commit | daaa83549d42395161e34a40e18c3615801b1501 (patch) | |
tree | 7ae4c67a31e9eea8a7bda4719fbdac3ac2e730a9 /src/main.cpp | |
parent | Update version settings. (diff) | |
download | GpgFrontend-daaa83549d42395161e34a40e18c3615801b1501.tar.gz GpgFrontend-daaa83549d42395161e34a40e18c3615801b1501.zip |
Start to rewrite gpg core.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 1e54d6e7..831a6121 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,6 +86,24 @@ int main(int argc, char *argv[]) { QApplication::setQuitOnLastWindowClosed(true); + + /** + * The function `gpgme_check_version' must be called before any other + * function in the library, because it initializes the thread support + * subsystem in GPGME. (from the info page) */ + gpgme_check_version(nullptr); + + // the locale set here is used for the other setlocale calls which have nullptr + // -> nullptr means use default, which is configured here + setlocale(LC_ALL, settings.value("int/lang").toLocale().name().toUtf8().constData()); + + /** set locale, because tests do also */ + gpgme_set_locale(nullptr, LC_CTYPE, setlocale(LC_CTYPE, nullptr)); + //qDebug() << "Locale set to" << LC_CTYPE << " - " << setlocale(LC_CTYPE, nullptr); + #ifndef _WIN32 + gpgme_set_locale(nullptr, LC_MESSAGES, setlocale(LC_MESSAGES, nullptr)); + #endif + MainWindow window; return_from_event_loop_code = QApplication::exec(); |