Commit 8f67803c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify pointer

parent 5b6a91bb
......@@ -16,13 +16,14 @@
PasswordField::PasswordField(QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f)
, m_currentPasswordOption(StoreForUser)
, m_layout(new QVBoxLayout(this))
, m_passwordField(new QLineEdit(this))
, m_passwordOptionsMenu(new QComboBox(this))
{
m_layout = new QVBoxLayout(this);
// The widget will be already in layout, thus reset content margins
// to align it with the rest of widgets
m_layout->setContentsMargins(0, 0, 0, 0);
m_passwordField = new QLineEdit(this);
connect(m_passwordField, &QLineEdit::textChanged, this, &PasswordField::textChanged);
if (KAuthorized::authorize(QStringLiteral("lineedit_reveal_password"))) {
......@@ -35,7 +36,6 @@ PasswordField::PasswordField(QWidget *parent, Qt::WindowFlags f)
m_layout->addWidget(m_passwordField);
m_passwordOptionsMenu = new QComboBox(this);
m_passwordOptionsMenu->setSizeAdjustPolicy(QComboBox::AdjustToContentsOnFirstShow);
m_passwordOptionsMenu->addItem(QIcon::fromTheme(QStringLiteral("document-save")), i18n("Store password for this user only (encrypted)"), StoreForUser);
......
......@@ -49,9 +49,9 @@ Q_SIGNALS:
private:
PasswordOption m_currentPasswordOption;
QVBoxLayout *m_layout = nullptr;
QLineEdit *m_passwordField = nullptr;
QComboBox *m_passwordOptionsMenu = nullptr;
QVBoxLayout *const m_layout;
QLineEdit *const m_passwordField;
QComboBox *const m_passwordOptionsMenu;
QAction *m_toggleEchoModeAction = nullptr;
};
......
Supports Markdown
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