diff options
Diffstat (limited to 'src/ui/main_window/MainWindowSlotUI.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowSlotUI.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/ui/main_window/MainWindowSlotUI.cpp b/src/ui/main_window/MainWindowSlotUI.cpp index 6b945beb..b6e7b3e4 100644 --- a/src/ui/main_window/MainWindowSlotUI.cpp +++ b/src/ui/main_window/MainWindowSlotUI.cpp @@ -312,9 +312,8 @@ void MainWindow::SlotGeneralDecryptVerify(bool) { void MainWindow::slot_clean_gpg_password_cache(bool) { bool ret = true; - const auto size = GpgContext::GetAllChannelId().size(); - for (auto i = 0; i < size; i++) { - ret = GpgAdvancedOperator::GetInstance().ClearGpgPasswordCache(); + for (const auto& channel : GpgContext::GetAllChannelId()) { + ret = GpgAdvancedOperator::GetInstance(channel).ClearGpgPasswordCache(); if (!ret) break; } @@ -329,9 +328,8 @@ void MainWindow::slot_clean_gpg_password_cache(bool) { void MainWindow::slot_reload_gpg_components(bool) { bool ret = true; - const auto size = GpgContext::GetAllChannelId().size(); - for (auto i = 0; i < size; i++) { - ret = GpgAdvancedOperator::GetInstance().ReloadAllGpgComponents(); + for (const auto& channel : GpgContext::GetAllChannelId()) { + ret = GpgAdvancedOperator::GetInstance(channel).ReloadAllGpgComponents(); if (!ret) break; } @@ -348,9 +346,8 @@ void MainWindow::slot_reload_gpg_components(bool) { void MainWindow::slot_restart_gpg_components(bool) { bool ret = true; - const auto size = GpgContext::GetAllChannelId().size(); - for (auto i = 0; i < size; i++) { - ret = GpgAdvancedOperator::GetInstance().RestartGpgComponents(); + for (const auto& channel : GpgContext::GetAllChannelId()) { + ret = GpgAdvancedOperator::GetInstance(channel).RestartGpgComponents(); if (!ret) break; } |