summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-24 11:59:04 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-24 11:59:04 (GMT)
commitb28a7e83d0f871a2d0c924d132b10132737947bb (patch)
tree51b959df927e3d7fbe519ef0796f17878bd9e1fb
parent012feeee26b3f27aa65bd4ebcc55f941546c29e1 (diff)
Use rejected boolean
-rw-r--r--resources/imap/setupserver.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/resources/imap/setupserver.cpp b/resources/imap/setupserver.cpp
index 834f6bb..f2a2d91 100644
--- a/resources/imap/setupserver.cpp
+++ b/resources/imap/setupserver.cpp
@@ -433,7 +433,20 @@ void SetupServer::readSettings()
m_ui->customUsername->setText(m_parentResource->settings()->sieveCustomUsername());
- m_ui->customPassword->setText(m_parentResource->settings()->sieveCustomPassword());
+
+ rejected = false;
+ const QString customPassword = m_parentResource->settings()->sieveCustomPassword(&rejected);
+ if (rejected) {
+ m_ui->customPassword->setEnabled(false);
+ KMessageBox::information(Q_NULLPTR, i18n("Could not access KWallet. "
+ "If you want to store the password permanently then you have to "
+ "activate it. If you do not "
+ "want to use KWallet, check the box below, but note that you will be "
+ "prompted for your password when needed."),
+ i18n("Do not use KWallet"), QStringLiteral("warning_kwallet_disabled"));
+ } else {
+ m_ui->customPassword->insert(customPassword);
+ }
const QString sieverCustomAuth(m_parentResource->settings()->sieveCustomAuthentification());
if (sieverCustomAuth == QLatin1String("ImapUserPassword")) {