From b3c1452d4e1fc3280396c185168c40ef452024b9 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 5 May 2024 07:34:44 +0300 Subject: [PATCH] kutils: attempt to re-open the password store after the timeout Signed-off-by: Ivailo Monev --- kutils/kpasswdstore/kded/kpasswdstoreimpl.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kutils/kpasswdstore/kded/kpasswdstoreimpl.cpp b/kutils/kpasswdstore/kded/kpasswdstoreimpl.cpp index 1b1f52a6..82a1b2df 100644 --- a/kutils/kpasswdstore/kded/kpasswdstoreimpl.cpp +++ b/kutils/kpasswdstore/kded/kpasswdstoreimpl.cpp @@ -98,7 +98,7 @@ bool KPasswdStoreImpl::isOpen() const bool KPasswdStoreImpl::openStore(const qlonglong windowid) { - if (m_cacheonly) { + if (m_cacheonly && m_passwdtimer.elapsed() < m_timeout) { return false; } @@ -111,9 +111,14 @@ bool KPasswdStoreImpl::openStore(const qlonglong windowid) } } if (!hasPasswd()) { - KMessageBox::error(widgetForWindowID(windowid), i18n("The storage could not be open, no passwords will be permanently stored")); + KMessageBox::error( + widgetForWindowID(windowid), + i18n("The storage could not be open, passwords will not be permanently stored until the store is open") + ); setCacheOnly(true); return false; + } else { + setCacheOnly(false); } return true; } @@ -188,7 +193,7 @@ bool KPasswdStoreImpl::ensurePasswd(const qlonglong windowid, const bool showerr if (!m_passwd.isEmpty() && m_passwdtimer.elapsed() >= m_timeout) { m_passwd.clear(); } - m_passwdtimer.restart(); + m_passwdtimer.start(); if (m_passwd.isEmpty()) { QByteArray kpasswddialogpass;