aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2022-05-08 13:14:24 +0000
committerGitHub <[email protected]>2022-05-08 13:14:24 +0000
commitf722eec9a898c97e233619a50f6f1a94fef6f94c (patch)
tree26757206ff3e139a10968bd8ae6147ca1a1182a7 /src/main.cpp
parentMerge pull request #50 from saturneric/develop-2.0.5 (diff)
parentdoc: update translate document. (diff)
downloadGpgFrontend-f722eec9a898c97e233619a50f6f1a94fef6f94c.tar.gz
GpgFrontend-f722eec9a898c97e233619a50f6f1a94fef6f94c.zip
Merge pull request #54 from saturneric/develop-2.0.6v2.0.6
Develop 2.0.6
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp39
1 files changed, 6 insertions, 33 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a63d2d02..51d977b2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -36,8 +36,9 @@
#include "GpgFrontendBuildInfo.h"
#include "core/GpgFunctionObject.h"
+#include "core/thread/CtxCheckThread.h"
+#include "ui/GpgFrontendUIInit.h"
#include "ui/main_window/MainWindow.h"
-#include "ui/thread/CtxCheckThread.h"
#if !defined(RELEASE) && defined(WINDOWS)
#include "core/function/GlobalSettingStation.h"
@@ -57,18 +58,6 @@ jmp_buf recover_env;
* @brief
*
*/
-extern void init_logging();
-
-/**
- * @brief
- *
- */
-extern void init_certs();
-
-/**
- * @brief
- *
- */
extern void init_locale();
/**
@@ -114,12 +103,6 @@ int main(int argc, char* argv[]) {
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
- // initialize logging system
- init_logging();
-
- // init certs for tls connection
- init_certs();
-
// set the extra information of the build
QApplication::setApplicationVersion(BUILD_VERSION);
QApplication::setApplicationName(PROJECT_NAME);
@@ -142,21 +125,8 @@ int main(int argc, char* argv[]) {
file.close();
#endif
-#ifdef GPG_STANDALONE_MODE
- LOG(INFO) << "GPG_STANDALONE_MODE Enabled";
- auto gpg_path = GpgFrontend::GlobalSettingStation::GetInstance()
- .GetStandaloneGpgBinDir();
- auto db_path = GpgFrontend::GlobalSettingStation::GetInstance()
- .GetStandaloneDatabaseDir();
- GpgFrontend::GpgContext::CreateInstance(
- GpgFrontend::SingletonFunctionObject<
- GpgFrontend::GpgContext>::GetDefaultChannel(),
- std::make_unique<GpgFrontend::GpgContext>(true, db_path.u8string(), true,
- gpg_path.u8string()));
-#endif
-
// create the thread to load the gpg context
- auto* init_ctx_thread = new GpgFrontend::UI::CtxCheckThread();
+ auto* init_ctx_thread = new GpgFrontend::CtxCheckThread();
QApplication::connect(init_ctx_thread, &QThread::finished, init_ctx_thread,
&QThread::deleteLater);
@@ -195,6 +165,9 @@ int main(int argc, char* argv[]) {
&QEventLoop::quit);
loop.exec();
+ // init ui logging
+ GpgFrontend::UI::init_logging();
+
/**
* internationalisation. loop to restart main window
* with changed translation when settings change.