diff options
author | saturneric <[email protected]> | 2024-01-11 03:05:45 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-11 03:05:45 +0000 |
commit | 0266ff1bbce2feccec34ab789f9e378948d1b24d (patch) | |
tree | 49dcdd97ea5fccb47ac5bdb7f2a7e1e51dfb8c05 /src/ui/widgets/KeyList.cpp | |
parent | feat: update core apis, functions and models (diff) | |
download | GpgFrontend-0266ff1bbce2feccec34ab789f9e378948d1b24d.tar.gz GpgFrontend-0266ff1bbce2feccec34ab789f9e378948d1b24d.zip |
feat: improve api and ui of keys import and export
Diffstat (limited to '')
-rw-r--r-- | src/ui/widgets/KeyList.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/ui/widgets/KeyList.cpp b/src/ui/widgets/KeyList.cpp index 04c184b0..135a3c6d 100644 --- a/src/ui/widgets/KeyList.cpp +++ b/src/ui/widgets/KeyList.cpp @@ -36,6 +36,7 @@ #include "core/GpgCoreInit.h" #include "core/function/GlobalSettingStation.h" #include "core/function/gpg/GpgKeyGetter.h" +#include "core/model/GpgImportInformation.h" #include "ui/UISignalStation.h" #include "ui/UserInterfaceUtils.h" #include "ui_KeyList.h" @@ -417,20 +418,10 @@ void KeyList::dragEnterEvent(QDragEnterEvent* event) { event->acceptProposedAction(); } -/** set background color for Keys and put them to top - * - */ -[[maybe_unused]] void KeyList::MarkKeys(QStringList* keyIds) { - foreach (QString id, *keyIds) { - spdlog::debug("marked: ", id.toStdString()); - } -} - -void KeyList::import_keys(const QByteArray& inBuffer) { - auto std_buffer = std::make_unique<ByteArray>(inBuffer.toStdString()); - GpgImportInformation result = - GpgKeyImportExporter::GetInstance().ImportKey(std::move(std_buffer)); - new KeyImportDetailDialog(result, false, this); +void KeyList::import_keys(const QByteArray& in_buffer) { + auto result = + GpgKeyImportExporter::GetInstance().ImportKey(GFBuffer(in_buffer)); + (new KeyImportDetailDialog(result, this))->exec(); } void KeyList::slot_double_clicked(const QModelIndex& index) { |