aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/GpgFrontendUIInit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/GpgFrontendUIInit.cpp')
-rw-r--r--src/ui/GpgFrontendUIInit.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ui/GpgFrontendUIInit.cpp b/src/ui/GpgFrontendUIInit.cpp
index a5302c7b..e7751ee6 100644
--- a/src/ui/GpgFrontendUIInit.cpp
+++ b/src/ui/GpgFrontendUIInit.cpp
@@ -72,6 +72,7 @@ void InitGpgFrontendUI() {
waiting_dialog->finished(0);
waiting_dialog->deleteLater();
});
+
QApplication::connect(waiting_dialog, &QProgressDialog::canceled, [=]() {
LOG(INFO) << "cancel clicked";
QCoreApplication::quit();
@@ -83,9 +84,18 @@ void InitGpgFrontendUI() {
waiting_dialog->show();
waiting_dialog->setFocus();
+ // new local event looper
+ QEventLoop looper;
+ QApplication::connect(init_ctx_task,
+ &Thread::CtxCheckTask::SignalTaskFinished, &looper,
+ &QEventLoop::quit);
+
// start the thread to load the gpg context
Thread::TaskRunnerGetter::GetInstance().GetTaskRunner()->PostTask(
init_ctx_task);
+
+ // block the main thread until the gpg context is loaded
+ looper.exec();
}
int RunGpgFrontendUI() {