diff options
author | Saturneric <[email protected]> | 2021-11-28 04:35:01 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-11-28 04:35:01 +0000 |
commit | b5b3ba7b1dc52a8dbae2a3a6970b44ede827f060 (patch) | |
tree | 7dffd4f4e6684d078616d88999590b95e8a56410 /src/ui/KeyServerImportDialog.cpp | |
parent | UI Framework Modified. (diff) | |
download | GpgFrontend-b5b3ba7b1dc52a8dbae2a3a6970b44ede827f060.tar.gz GpgFrontend-b5b3ba7b1dc52a8dbae2a3a6970b44ede827f060.zip |
Can be compiled with minimal UI support.
Diffstat (limited to '')
-rw-r--r-- | src/ui/KeyServerImportDialog.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ui/KeyServerImportDialog.cpp b/src/ui/KeyServerImportDialog.cpp index dae8f723..c4d2bdac 100644 --- a/src/ui/KeyServerImportDialog.cpp +++ b/src/ui/KeyServerImportDialog.cpp @@ -30,15 +30,14 @@ namespace GpgFrontend::UI { -KeyServerImportDialog::KeyServerImportDialog(KeyList* keyList, - bool automatic, +KeyServerImportDialog::KeyServerImportDialog(KeyList* keyList, bool automatic, QWidget* parent) : QDialog(parent), + mAutomatic(automatic), appPath(qApp->applicationDirPath()), settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat), - mKeyList(keyList), - mAutomatic(automatic) { + mKeyList(keyList) { if (automatic) { setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint); } @@ -79,8 +78,7 @@ KeyServerImportDialog::KeyServerImportDialog(KeyList* keyList, // Layout for import and close button auto* buttonsLayout = new QHBoxLayout; buttonsLayout->addStretch(); - if (!automatic) - buttonsLayout->addWidget(importButton); + if (!automatic) buttonsLayout->addWidget(importButton); buttonsLayout->addWidget(closeButton); auto* mainLayout = new QGridLayout; @@ -353,10 +351,14 @@ void KeyServerImportDialog::slotImport() { } } -void KeyServerImportDialog::slotImport(const QStringList& keyIds) { +void KeyServerImportDialog::slotImport(const KeyIdArgsListPtr& keys) { QString keyserver = settings.value("keyserver/defaultKeyServer").toString(); qDebug() << "Select Key Server" << keyserver; - slotImport(keyIds, QUrl(keyserver)); + auto key_ids = QStringList(); + for (const auto& key_id : *keys) { + key_ids.append(QString::fromStdString(key_id)); + } + slotImport(key_ids, QUrl(keyserver)); } void KeyServerImportDialog::slotImportKey(const KeyIdArgsListPtr& keys) { |