Verified Commit d47c29c4 authored by Franz Baumgärtner's avatar Franz Baumgärtner
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
parent 47b49d18
Pipeline #72340 failed with stage
in 24 minutes
......@@ -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