aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/FileEncryptionDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/FileEncryptionDialog.cpp')
-rwxr-xr-xsrc/ui/FileEncryptionDialog.cpp65
1 files changed, 38 insertions, 27 deletions
diff --git a/src/ui/FileEncryptionDialog.cpp b/src/ui/FileEncryptionDialog.cpp
index 3e1e9b9a..aeba6497 100755
--- a/src/ui/FileEncryptionDialog.cpp
+++ b/src/ui/FileEncryptionDialog.cpp
@@ -86,32 +86,43 @@ FileEncryptionDialog::FileEncryptionDialog(KeyIdArgsListPtr keyList,
groupBox1->setLayout(gLayout);
/*Setup KeyList*/
- mKeyList = new KeyList(
- KeyListRow::ONLY_SECRET_KEY,
- KeyListColumn::NAME | KeyListColumn::EmailAddress | KeyListColumn::Usage);
- if (mAction == Verify)
- mKeyList->setFilter([](const GpgKey& key) -> bool {
- if (key.disabled() || key.expired() || key.revoked())
- return false;
- else
- return true;
- });
-
- if (mAction == Encrypt)
- mKeyList->setFilter([](const GpgKey& key) -> bool {
- if (!key.CanEncrActual())
- return false;
- else
- return true;
- });
-
- if (mAction == Sign)
- mKeyList->setFilter([](const GpgKey& key) -> bool {
- if (!key.CanSignActual())
- return false;
- else
- return true;
- });
+
+ if (mAction == Verify) {
+ mKeyList =
+ new KeyList(KeyListRow::ONLY_SECRET_KEY,
+ KeyListColumn::NAME | KeyListColumn::EmailAddress |
+ KeyListColumn::Usage,
+ [](const GpgKey& key) -> bool {
+ if (key.disabled() || key.expired() || key.revoked())
+ return false;
+ else
+ return true;
+ });
+ }
+
+ if (mAction == Encrypt) {
+ mKeyList = new KeyList(KeyListRow::ONLY_SECRET_KEY,
+ KeyListColumn::NAME | KeyListColumn::EmailAddress |
+ KeyListColumn::Usage,
+ [](const GpgKey& key) -> bool {
+ if (!key.CanEncrActual())
+ return false;
+ else
+ return true;
+ });
+ }
+
+ if (mAction == Encrypt) {
+ mKeyList = new KeyList(KeyListRow::ONLY_SECRET_KEY,
+ KeyListColumn::NAME | KeyListColumn::EmailAddress |
+ KeyListColumn::Usage,
+ [](const GpgKey& key) -> bool {
+ if (!key.CanSignActual())
+ return false;
+ else
+ return true;
+ });
+ }
if (mAction == Decrypt) mKeyList->setDisabled(true);
@@ -256,7 +267,7 @@ void FileEncryptionDialog::slotExecuteAction() {
GpgVerifyResult result = nullptr;
auto error =
BasicOperator::GetInstance().Verify(in_data, sign_data, result);
- new VerifyDetailsDialog(this, mKeyList, error, std::move(result));
+ new VerifyDetailsDialog(this, error, std::move(result));
return;
}