Commit 8f7520ed authored by Franz Baumgärtner's avatar Franz Baumgärtner Committed by Laurent Montel
Browse files

fix UI elements being used before initialization

commit 18bc7e43 introduced calls to setRevealPasswordAvailable() on
password fields.

those calls happened before m_ui->password and m_ui->customPassword
were initialized by the call to m_ui->setupUI(),
and led to a crash when trying to open the settings of an IMAP account.

BUG: 439991
(cherry picked from commit d47c29c4)
parent e792c79f
Pipeline #72500 skipped
......@@ -120,8 +120,6 @@ SetupServer::SetupServer(ImapResourceBase *parentResource, WId parent)
{
auto networkConfigMgr = new QNetworkConfigurationManager(QCoreApplication::instance());
m_ui->password->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
m_ui->customPassword->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
m_parentResource->settings()->setWinId(parent);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout(this);
......@@ -135,6 +133,8 @@ SetupServer::SetupServer(ImapResourceBase *parentResource, WId parent)
mainLayout->addWidget(buttonBox);
m_ui->setupUi(mainWidget);
m_ui->password->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
m_ui->customPassword->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
new KPIM::LineEditCatchReturnKey(m_ui->accountName, this);
new KPIM::LineEditCatchReturnKey(m_ui->imapServer, this);
new KPIM::LineEditCatchReturnKey(m_ui->userName, this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment