aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-15 23:19:53 +0000
committersaturneric <[email protected]>2025-04-15 23:19:53 +0000
commit73a0f7ddf8a8db0057201374f1518d2063ad9a06 (patch)
tree4dfdf140fa639f0ab8799433c4d9cf5079a92bf0 /src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp
parentrefactor: code cleanup (diff)
downloadGpgFrontend-73a0f7ddf8a8db0057201374f1518d2063ad9a06.tar.gz
GpgFrontend-73a0f7ddf8a8db0057201374f1518d2063ad9a06.zip
feat: support key groups
Diffstat (limited to 'src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp')
-rw-r--r--src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp b/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp
index 754999a2..d641c4d3 100644
--- a/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp
+++ b/src/ui/dialog/keypair_details/KeyNewUIDDialog.cpp
@@ -28,19 +28,17 @@
#include "KeyNewUIDDialog.h"
-#include "core/GpgModel.h"
-#include "core/function/gpg/GpgKeyGetter.h"
+#include <utility>
+
#include "core/function/gpg/GpgUIDOperator.h"
#include "ui/UISignalStation.h"
namespace GpgFrontend::UI {
-KeyNewUIDDialog::KeyNewUIDDialog(int channel, const KeyId& key_id,
- QWidget* parent)
+KeyNewUIDDialog::KeyNewUIDDialog(int channel, GpgKeyPtr key, QWidget* parent)
: GeneralDialog(typeid(KeyNewUIDDialog).name(), parent),
current_gpg_context_channel_(channel),
- m_key_(GpgKeyGetter::GetInstance(current_gpg_context_channel_)
- .GetKey(key_id)) {
- assert(m_key_.IsGood());
+ m_key_(std::move(key)) {
+ assert(m_key_ != nullptr);
name_ = new QLineEdit();
name_->setMinimumWidth(240);
@@ -51,7 +49,7 @@ KeyNewUIDDialog::KeyNewUIDDialog(int channel, const KeyId& key_id,
create_button_ = new QPushButton("Create");
error_label_ = new QLabel();
- auto grid_layout = new QGridLayout();
+ auto* grid_layout = new QGridLayout();
grid_layout->addWidget(new QLabel(tr("Name")), 0, 0);
grid_layout->addWidget(new QLabel(tr("Email")), 1, 0);
grid_layout->addWidget(new QLabel(tr("Comment")), 2, 0);