diff options
author | Saturneric <[email protected]> | 2023-02-17 19:08:53 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2023-02-17 19:08:53 +0000 |
commit | da1004ab71c382bde8af2b584e693426227abe0e (patch) | |
tree | a0166f4a5404f5b0d6944cc4a7cffecd3e2eaf86 /src/ui/UserInterfaceUtils.cpp | |
parent | fix: solve command executor memory problem (diff) | |
download | GpgFrontend-da1004ab71c382bde8af2b584e693426227abe0e.tar.gz GpgFrontend-da1004ab71c382bde8af2b584e693426227abe0e.zip |
feat: improve task execute system
Diffstat (limited to 'src/ui/UserInterfaceUtils.cpp')
-rw-r--r-- | src/ui/UserInterfaceUtils.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/ui/UserInterfaceUtils.cpp b/src/ui/UserInterfaceUtils.cpp index 408a1c04..6c3b0726 100644 --- a/src/ui/UserInterfaceUtils.cpp +++ b/src/ui/UserInterfaceUtils.cpp @@ -120,8 +120,8 @@ void process_operation(QWidget *parent, const std::string &waiting_title, auto *dialog = new WaitingDialog(QString::fromStdString(waiting_title), parent); - auto *process_task = - new Thread::Task(std::move(func), std::move(callback), data_object); + auto *process_task = new Thread::Task(std::move(func), waiting_title, + data_object, std::move(callback)); QApplication::connect(process_task, &Thread::Task::SignalTaskFinished, dialog, &QDialog::close); @@ -398,13 +398,15 @@ void CommonUtils::SlotImportKeyFromKeyServer( } void CommonUtils::slot_update_key_status() { - auto refresh_task = new Thread::Task([](Thread::Task::DataObjectPtr) -> int { - // flush key cache for all GpgKeyGetter Intances. - for (const auto &channel_id : GpgKeyGetter::GetAllChannelId()) { - GpgKeyGetter::GetInstance(channel_id).FlushKeyCache(); - } - return 0; - }); + auto refresh_task = new Thread::Task( + [](Thread::Task::DataObjectPtr) -> int { + // flush key cache for all GpgKeyGetter Intances. + for (const auto &channel_id : GpgKeyGetter::GetAllChannelId()) { + GpgKeyGetter::GetInstance(channel_id).FlushKeyCache(); + } + return 0; + }, + "update_key_status_task"); connect(refresh_task, &Thread::Task::SignalTaskFinished, this, &CommonUtils::SignalKeyDatabaseRefreshDone); @@ -419,7 +421,7 @@ void CommonUtils::slot_popup_passphrase_input_dialog() { dialog->setWindowTitle(_("Password Input Dialog")); dialog->setInputMode(QInputDialog::TextInput); dialog->setTextEchoMode(QLineEdit::Password); - dialog->setLabelText("Please Input The Password"); + dialog->setLabelText(_("Please Input The Password")); dialog->resize(500, 80); dialog->exec(); |