diff options
author | Saturneric <[email protected]> | 2023-02-18 11:12:03 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2023-02-18 11:12:03 +0000 |
commit | 3b062240c399bc7fb24fde3442db407386c17161 (patch) | |
tree | 06f41cd7928ae1f5ab2b935203d8399dab11373a /src/ui/UserInterfaceUtils.cpp | |
parent | fix: improve stability of the object-channel model (diff) | |
download | GpgFrontend-3b062240c399bc7fb24fde3442db407386c17161.tar.gz GpgFrontend-3b062240c399bc7fb24fde3442db407386c17161.zip |
fix: improve the task execution model
Diffstat (limited to '')
-rw-r--r-- | src/ui/UserInterfaceUtils.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/ui/UserInterfaceUtils.cpp b/src/ui/UserInterfaceUtils.cpp index 6c3b0726..f944e037 100644 --- a/src/ui/UserInterfaceUtils.cpp +++ b/src/ui/UserInterfaceUtils.cpp @@ -123,12 +123,12 @@ void process_operation(QWidget *parent, const std::string &waiting_title, auto *process_task = new Thread::Task(std::move(func), waiting_title, data_object, std::move(callback)); - QApplication::connect(process_task, &Thread::Task::SignalTaskFinished, dialog, + QApplication::connect(process_task, &Thread::Task::SignalTaskEnd, dialog, &QDialog::close); QEventLoop looper; - QApplication::connect(process_task, &Thread::Task::SignalTaskFinished, - &looper, &QEventLoop::quit); + QApplication::connect(process_task, &Thread::Task::SignalTaskEnd, &looper, + &QEventLoop::quit); // post process task to task runner Thread::TaskRunnerGetter::GetInstance() @@ -406,9 +406,10 @@ void CommonUtils::slot_update_key_status() { } return 0; }, - "update_key_status_task"); - connect(refresh_task, &Thread::Task::SignalTaskFinished, this, - &CommonUtils::SignalKeyDatabaseRefreshDone); + "update_key_database_task"); + connect(refresh_task, &Thread::Task::SignalTaskEnd, this, + &CommonUtils::SignalKeyDatabaseRefreshDone, + Qt::BlockingQueuedConnection); // post the task to the default task runner Thread::TaskRunnerGetter::GetInstance().GetTaskRunner()->PostTask( |