diff options
Diffstat (limited to 'src/ui/keypair_details/KeyUIDSignDialog.cpp')
-rw-r--r-- | src/ui/keypair_details/KeyUIDSignDialog.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/src/ui/keypair_details/KeyUIDSignDialog.cpp b/src/ui/keypair_details/KeyUIDSignDialog.cpp index 6cce116b..d9592c56 100644 --- a/src/ui/keypair_details/KeyUIDSignDialog.cpp +++ b/src/ui/keypair_details/KeyUIDSignDialog.cpp @@ -33,18 +33,18 @@ namespace GpgFrontend::UI { KeyUIDSignDialog::KeyUIDSignDialog(const GpgKey& key, UIDArgsListPtr uid, QWidget* parent) : QDialog(parent), mUids(std::move(uid)), mKey(key) { - mKeyList = - new KeyList(KeyListRow::ONLY_SECRET_KEY, - KeyListColumn::NAME | KeyListColumn::EmailAddress, this); - - mKeyList->setFilter([](const GpgKey& key) -> bool { - if (key.disabled() || !key.can_certify() || !key.has_master_key() || - key.expired() || key.revoked()) - return false; - else - return true; - }); - mKeyList->setExcludeKeys({key.id()}); + const auto key_id = mKey.id(); + mKeyList = new KeyList( + KeyListRow::ONLY_SECRET_KEY, + KeyListColumn::NAME | KeyListColumn::EmailAddress, + [key_id](const GpgKey& key) -> bool { + if (key.disabled() || !key.can_certify() || !key.has_master_key() || + key.expired() || key.revoked() || key_id == key.id()) + return false; + else + return true; + }, + this); mKeyList->slotRefresh(); signKeyButton = new QPushButton("Sign"); @@ -97,20 +97,19 @@ KeyUIDSignDialog::KeyUIDSignDialog(const GpgKey& key, UIDArgsListPtr uid, } void KeyUIDSignDialog::slotSignKey(bool clicked) { - LOG(INFO) << "KeyUIDSignDialog::slotSignKey Called"; + LOG(INFO) << "Called"; // Set Signers auto key_ids = mKeyList->getChecked(); auto keys = GpgKeyGetter::GetInstance().GetKeys(key_ids); - LOG(INFO) << "KeyUIDSignDialog::slotSignKey Key Info Got"; - auto expires = std::make_unique<boost::gregorian::date>( - boost::posix_time::from_time_t(expiresEdit->dateTime().toTime_t()) - .date()); + LOG(INFO) << "Key Info Got"; + auto expires = std::make_unique<boost::posix_time::ptime>( + boost::posix_time::from_time_t(expiresEdit->dateTime().toTime_t())); - LOG(INFO) << "KeyUIDSignDialog::slotSignKey Sign Start"; + LOG(INFO) << "Sign Start"; for (const auto& uid : *mUids) { - LOG(INFO) << "KeyUIDSignDialog::slotSignKey Sign UID" << uid; + LOG(INFO) << "Sign UID" << uid; // Sign For mKey if (!GpgKeyManager::GetInstance().signKey(mKey, *keys, uid, expires)) { QMessageBox::critical( |