diff options
author | saturneric <[email protected]> | 2024-12-03 09:42:14 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-12-03 09:42:14 +0000 |
commit | f4525ea80237bbb57ab7e3ab196fb3e85a4b05bb (patch) | |
tree | f0dc58c1e4740f79640fbdadcbf68563ec59b9df /src/ui/main_window/MainWindowFileSlotFunction.cpp | |
parent | fix: variable 'mods_path' is reassigned a value before the old one has been u... (diff) | |
download | GpgFrontend-f4525ea80237bbb57ab7e3ab196fb3e85a4b05bb.tar.gz GpgFrontend-f4525ea80237bbb57ab7e3ab196fb3e85a4b05bb.zip |
fix: compiler warnings
Diffstat (limited to 'src/ui/main_window/MainWindowFileSlotFunction.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowFileSlotFunction.cpp | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/ui/main_window/MainWindowFileSlotFunction.cpp b/src/ui/main_window/MainWindowFileSlotFunction.cpp index b94da713..184635a7 100644 --- a/src/ui/main_window/MainWindowFileSlotFunction.cpp +++ b/src/ui/main_window/MainWindowFileSlotFunction.cpp @@ -122,9 +122,8 @@ void MainWindow::SlotFileEncrypt(const QString& path) { auto p_keys = GpgKeyGetter::GetInstance(m_key_list_->GetCurrentGpgContextChannel()) .GetKeys(key_ids); - for (const auto& key : *p_keys) { - assert(key.IsGood()); - } + assert(std::all_of(p_keys->begin(), p_keys->end(), + [](const auto& key) { return key.IsGood(); })); // check key abilities for (const auto& key : *p_keys) { @@ -248,9 +247,8 @@ void MainWindow::SlotDirectoryEncrypt(const QString& path) { auto p_keys = GpgKeyGetter::GetInstance(m_key_list_->GetCurrentGpgContextChannel()) .GetKeys(key_ids); - for (const auto& key : *p_keys) { - assert(key.IsGood()); - } + assert(std::all_of(p_keys->begin(), p_keys->end(), + [](const auto& key) { return key.IsGood(); })); // check key abilities for (const auto& key : *p_keys) { @@ -415,9 +413,8 @@ void MainWindow::SlotFileSign(const QString& path) { auto keys = GpgKeyGetter::GetInstance(m_key_list_->GetCurrentGpgContextChannel()) .GetKeys(key_ids); - for (const auto& key : *keys) { - assert(key.IsGood()); - } + assert(std::all_of(keys->begin(), keys->end(), + [](const auto& key) { return key.IsGood(); })); if (keys->empty()) { QMessageBox::critical( @@ -578,9 +575,8 @@ void MainWindow::SlotFileEncryptSign(const QString& path) { auto p_keys = GpgKeyGetter::GetInstance(m_key_list_->GetCurrentGpgContextChannel()) .GetKeys(key_ids); - for (const auto& key : *p_keys) { - assert(key.IsGood()); - } + assert(std::all_of(p_keys->begin(), p_keys->end(), + [](const auto& key) { return key.IsGood(); })); if (p_keys->empty()) { QMessageBox::critical( @@ -640,9 +636,8 @@ void MainWindow::SlotFileEncryptSign(const QString& path) { auto p_signer_keys = GpgKeyGetter::GetInstance(m_key_list_->GetCurrentGpgContextChannel()) .GetKeys(signer_key_ids); - for (const auto& key : *p_signer_keys) { - assert(key.IsGood()); - } + assert(std::all_of(p_signer_keys->begin(), p_signer_keys->end(), + [](const auto& key) { return key.IsGood(); })); CommonUtils::WaitForOpera( this, tr("Encrypting and Signing"), [=](const OperaWaitingHd& op_hd) { @@ -697,9 +692,8 @@ void MainWindow::SlotDirectoryEncryptSign(const QString& path) { auto p_keys = GpgKeyGetter::GetInstance(m_key_list_->GetCurrentGpgContextChannel()) .GetKeys(key_ids); - for (const auto& key : *p_keys) { - assert(key.IsGood()); - } + assert(std::all_of(p_keys->begin(), p_keys->end(), + [](const auto& key) { return key.IsGood(); })); if (p_keys->empty()) { QMessageBox::critical( @@ -759,9 +753,11 @@ void MainWindow::SlotDirectoryEncryptSign(const QString& path) { auto p_signer_keys = GpgKeyGetter::GetInstance(m_key_list_->GetCurrentGpgContextChannel()) .GetKeys(signer_key_ids); +#ifndef NDEBUG for (const auto& key : *p_signer_keys) { assert(key.IsGood()); } +#endif CommonUtils::WaitForOpera( this, tr("Archiving & Encrypting & Signing"), |