From 27fde22d54a893c2e647bfd6c8d9700cc4242e89 Mon Sep 17 00:00:00 2001 From: eelke Date: Tue, 29 Jan 2019 19:52:50 +0100 Subject: [PATCH] Fix: Cancelling the password prompt of the PSK database doesn't keep endlessly asking for password. --- pglab/MasterController.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pglab/MasterController.cpp b/pglab/MasterController.cpp index 185d709..5c901aa 100644 --- a/pglab/MasterController.cpp +++ b/pglab/MasterController.cpp @@ -187,8 +187,12 @@ bool MasterController::UnlockPasswordManagerIfNeeded() int exec_result = dlg->exec(); bool ok = (exec_result == QDialog::Accepted); - // IF user gave OK - if (ok && m_passwordManager->openDatabase(m_userConfigDatabase, dlg->password())) + if (!ok) { + // leave this retry loop + break; + } + // user gave OK, if succeeds return true otherwise loop a prompt for password again. + if (m_passwordManager->openDatabase(m_userConfigDatabase, dlg->password())) return true; } }