aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ui/UserInterfaceUtils.cpp1
-rw-r--r--src/ui/main_window/KeyMgmt.cpp34
-rw-r--r--src/ui/main_window/MainWindowUI.cpp26
3 files changed, 29 insertions, 32 deletions
diff --git a/src/ui/UserInterfaceUtils.cpp b/src/ui/UserInterfaceUtils.cpp
index 040a57a7..db54dd15 100644
--- a/src/ui/UserInterfaceUtils.cpp
+++ b/src/ui/UserInterfaceUtils.cpp
@@ -269,6 +269,7 @@ void CommonUtils::RaiseFailureMessageBox(QWidget *parent, GpgError err) {
void CommonUtils::SlotImportKeys(QWidget *parent, int channel,
const QByteArray &in_buffer) {
+ LOG_D() << "try to import key(s) to channel: " << channel;
auto info =
GpgKeyImportExporter::GetInstance(channel).ImportKey(GFBuffer(in_buffer));
emit SignalKeyStatusUpdated();
diff --git a/src/ui/main_window/KeyMgmt.cpp b/src/ui/main_window/KeyMgmt.cpp
index 022f3c9f..150017a1 100644
--- a/src/ui/main_window/KeyMgmt.cpp
+++ b/src/ui/main_window/KeyMgmt.cpp
@@ -138,10 +138,10 @@ void KeyMgmt::create_actions() {
open_key_file_act_ = new QAction(tr("Open"), this);
open_key_file_act_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_O));
open_key_file_act_->setToolTip(tr("Open Key File"));
- connect(open_key_file_act_, &QAction::triggered, this,
- [this, channel = key_list_->GetCurrentGpgContextChannel()]() {
- CommonUtils::GetInstance()->SlotImportKeyFromFile(this, channel);
- });
+ connect(open_key_file_act_, &QAction::triggered, this, [this]() {
+ CommonUtils::GetInstance()->SlotImportKeyFromFile(
+ this, key_list_->GetCurrentGpgContextChannel());
+ });
close_act_ = new QAction(tr("Close"), this);
close_act_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q));
@@ -167,21 +167,20 @@ void KeyMgmt::create_actions() {
import_key_from_file_act_ = new QAction(tr("File"), this);
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,
- [this, channel = key_list_->GetCurrentGpgContextChannel()]() {
- CommonUtils::GetInstance()->SlotImportKeyFromFile(this, channel);
- });
+ connect(import_key_from_file_act_, &QAction::triggered, this, [this]() {
+ CommonUtils::GetInstance()->SlotImportKeyFromFile(
+ this, key_list_->GetCurrentGpgContextChannel());
+ });
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,
- [this, channel = key_list_->GetCurrentGpgContextChannel()]() {
- CommonUtils::GetInstance()->SlotImportKeyFromClipboard(this,
- channel);
- });
+ connect(import_key_from_clipboard_act_, &QAction::triggered, this, [this]() {
+ CommonUtils::GetInstance()->SlotImportKeyFromClipboard(
+ this, key_list_->GetCurrentGpgContextChannel());
+ });
bool const forbid_all_gnupg_connection =
GlobalSettingStation::GetInstance()
@@ -195,11 +194,10 @@ void KeyMgmt::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,
- [this, channel = key_list_->GetCurrentGpgContextChannel()]() {
- CommonUtils::GetInstance()->SlotImportKeyFromKeyServer(this,
- channel);
- });
+ connect(import_key_from_key_server_act_, &QAction::triggered, this, [this]() {
+ CommonUtils::GetInstance()->SlotImportKeyFromKeyServer(
+ this, key_list_->GetCurrentGpgContextChannel());
+ });
import_keys_from_key_package_act_ = new QAction(tr("Key Package"), this);
import_keys_from_key_package_act_->setIcon(QIcon(":/icons/key_package.png"));
diff --git a/src/ui/main_window/MainWindowUI.cpp b/src/ui/main_window/MainWindowUI.cpp
index 2163f382..151e5cfa 100644
--- a/src/ui/main_window/MainWindowUI.cpp
+++ b/src/ui/main_window/MainWindowUI.cpp
@@ -310,21 +310,20 @@ void MainWindow::create_actions() {
import_key_from_file_act_ = new QAction(tr("File"), this);
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,
- [=, channel = m_key_list_->GetCurrentGpgContextChannel()]() {
- CommonUtils::GetInstance()->SlotImportKeyFromFile(this, channel);
- });
+ connect(import_key_from_file_act_, &QAction::triggered, this, [=]() {
+ CommonUtils::GetInstance()->SlotImportKeyFromFile(
+ this, m_key_list_->GetCurrentGpgContextChannel());
+ });
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,
- [this, channel = m_key_list_->GetCurrentGpgContextChannel()]() {
- CommonUtils::GetInstance()->SlotImportKeyFromClipboard(this,
- channel);
- });
+ connect(import_key_from_clipboard_act_, &QAction::triggered, this, [this]() {
+ CommonUtils::GetInstance()->SlotImportKeyFromClipboard(
+ this, m_key_list_->GetCurrentGpgContextChannel());
+ });
bool forbid_all_gnupg_connection =
GlobalSettingStation::GetInstance()
@@ -338,11 +337,10 @@ 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,
- [this, channel = m_key_list_->GetCurrentGpgContextChannel()]() {
- CommonUtils::GetInstance()->SlotImportKeyFromKeyServer(this,
- channel);
- });
+ connect(import_key_from_key_server_act_, &QAction::triggered, this, [this]() {
+ CommonUtils::GetInstance()->SlotImportKeyFromKeyServer(
+ this, m_key_list_->GetCurrentGpgContextChannel());
+ });
import_key_from_edit_act_ = new QAction(tr("Editor"), this);
import_key_from_edit_act_->setIcon(QIcon(":/icons/editor.png"));