diff options
author | saturneric <[email protected]> | 2024-10-26 13:43:14 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-10-26 13:43:14 +0000 |
commit | 24c28eb752aa611dd1670f3fa7ab6b358b052f1b (patch) | |
tree | 6a4f9af003fa4a86b7d7e29a965e37a231951092 /src/ui/main_window/MainWindowUI.cpp | |
parent | fix: thread concurrent crash issue (diff) | |
download | GpgFrontend-24c28eb752aa611dd1670f3fa7ab6b358b052f1b.tar.gz GpgFrontend-24c28eb752aa611dd1670f3fa7ab6b358b052f1b.zip |
fix: test basic operations of multi key db and solve issues
Diffstat (limited to 'src/ui/main_window/MainWindowUI.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowUI.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/ui/main_window/MainWindowUI.cpp b/src/ui/main_window/MainWindowUI.cpp index e7c1c69e..f2108c95 100644 --- a/src/ui/main_window/MainWindowUI.cpp +++ b/src/ui/main_window/MainWindowUI.cpp @@ -310,16 +310,20 @@ void MainWindow::create_actions() { import_key_from_file_act_->setIcon(QIcon(":/icons/import_key_from_file.png")); import_key_from_file_act_->setToolTip(tr("Import New Key From File")); connect(import_key_from_file_act_, &QAction::triggered, this, - [&]() { CommonUtils::GetInstance()->SlotImportKeyFromFile(this); }); + [=, channel = m_key_list_->GetCurrentGpgContextChannel()]() { + CommonUtils::GetInstance()->SlotImportKeyFromFile(this, channel); + }); import_key_from_clipboard_act_ = new QAction(tr("Clipboard"), this); import_key_from_clipboard_act_->setIcon( QIcon(":/icons/import_key_from_clipboard.png")); import_key_from_clipboard_act_->setToolTip( tr("Import New Key From Clipboard")); - connect(import_key_from_clipboard_act_, &QAction::triggered, this, [&]() { - CommonUtils::GetInstance()->SlotImportKeyFromClipboard(this); - }); + connect(import_key_from_clipboard_act_, &QAction::triggered, this, + [this, channel = m_key_list_->GetCurrentGpgContextChannel()]() { + CommonUtils::GetInstance()->SlotImportKeyFromClipboard(this, + channel); + }); bool forbid_all_gnupg_connection = GlobalSettingStation::GetInstance() @@ -333,9 +337,11 @@ void MainWindow::create_actions() { import_key_from_key_server_act_->setToolTip( tr("Import New Key From Keyserver")); import_key_from_key_server_act_->setDisabled(forbid_all_gnupg_connection); - connect(import_key_from_key_server_act_, &QAction::triggered, this, [&]() { - CommonUtils::GetInstance()->SlotImportKeyFromKeyServer(this); - }); + connect(import_key_from_key_server_act_, &QAction::triggered, this, + [this, channel = m_key_list_->GetCurrentGpgContextChannel()]() { + CommonUtils::GetInstance()->SlotImportKeyFromKeyServer(this, + channel); + }); import_key_from_edit_act_ = new QAction(tr("Editor"), this); import_key_from_edit_act_->setIcon(QIcon(":/icons/editor.png")); |