Commit f190945f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify more pointer

parent e385130f
Pipeline #57746 passed with stage
in 58 minutes and 45 seconds
......@@ -38,7 +38,7 @@ public:
void calendarIncidenceAboutToBeDeleted(const KCalendarCore::Incidence::Ptr &incidence) override;
private:
PimDataSource *mDataSource = nullptr;
PimDataSource *const mDataSource;
QDate mStart;
QDate mEnd;
};
......
......@@ -17,11 +17,12 @@
SelectImapFolderDialog::SelectImapFolderDialog(const KSieveUi::SieveImapAccountSettings &account, QWidget *parent)
: QDialog(parent)
, mSelectImapFolderWidget(new SelectImapFolderWidget(account, this))
, mNewFolder(new QPushButton(i18n("Create Folder..."), this))
{
setWindowTitle(i18nc("@title:window", "Select IMAP folder"));
auto layout = new QVBoxLayout(this);
mSelectImapFolderWidget = new SelectImapFolderWidget(account, this);
mSelectImapFolderWidget->setObjectName(QStringLiteral("selectimapfolderwidget"));
layout->addWidget(mSelectImapFolderWidget);
connect(mSelectImapFolderWidget, &SelectImapFolderWidget::folderSelected, this, &SelectImapFolderDialog::accept);
......@@ -30,7 +31,6 @@ SelectImapFolderDialog::SelectImapFolderDialog(const KSieveUi::SieveImapAccountS
layout->addWidget(buttonBox);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
mNewFolder = new QPushButton(i18n("Create Folder..."), this);
mNewFolder->setObjectName(QStringLiteral("createfolder"));
mNewFolder->setEnabled(false);
buttonBox->addButton(mNewFolder, QDialogButtonBox::ActionRole);
......
......@@ -27,7 +27,7 @@ private:
void readConfig();
void slotCreateFolder();
SelectImapFolderWidget *mSelectImapFolderWidget = nullptr;
QPushButton *mNewFolder = nullptr;
SelectImapFolderWidget *const mSelectImapFolderWidget;
QPushButton *const mNewFolder;
};
......@@ -24,6 +24,8 @@
SelectImapFolderWidget::SelectImapFolderWidget(const KSieveUi::SieveImapAccountSettings &account, QWidget *parent)
: QWidget(parent)
, mAccount(account)
, mSearchLineEdit(new QLineEdit(this))
, mTreeView(new SelectImapFolderTreeView(this))
{
bool modelIsInitialized = false;
mModel = SelectImapFolderModel::self()->folderModel(mAccount, modelIsInitialized);
......@@ -35,7 +37,6 @@ SelectImapFolderWidget::SelectImapFolderWidget(const KSieveUi::SieveImapAccountS
auto topLayout = new QHBoxLayout;
topLayout->setContentsMargins({});
mainLayout->addLayout(topLayout);
mSearchLineEdit = new QLineEdit(this);
mSearchLineEdit->setObjectName(QStringLiteral("searchline"));
mSearchLineEdit->setClearButtonEnabled(true);
mSearchLineEdit->setPlaceholderText(i18n("Search..."));
......@@ -48,7 +49,6 @@ SelectImapFolderWidget::SelectImapFolderWidget(const KSieveUi::SieveImapAccountS
connect(refreshImap, &QToolButton::clicked, this, &SelectImapFolderWidget::slotRefreshImap);
topLayout->addWidget(refreshImap);
mTreeView = new SelectImapFolderTreeView(this);
mTreeView->setObjectName(QStringLiteral("treeview"));
mTreeView->header()->hide();
mFilter = new QSortFilterProxyModel(this);
......
......@@ -38,8 +38,8 @@ private:
void slotRefreshImap();
const KSieveUi::SieveImapAccountSettings mAccount;
QLineEdit *mSearchLineEdit = nullptr;
SelectImapFolderTreeView *mTreeView = nullptr;
QLineEdit *const mSearchLineEdit;
SelectImapFolderTreeView *const mTreeView;
QStandardItemModel *mModel = nullptr;
QSortFilterProxyModel *mFilter = nullptr;
};
......
......@@ -17,15 +17,15 @@ K_PLUGIN_CLASS_WITH_JSON(SelectImapWidget, "imapfoldercompletion.json")
SelectImapWidget::SelectImapWidget(QWidget *parent, const QList<QVariant> &)
: KSieveUi::AbstractMoveImapFolderWidget(parent)
, mToolButton(new QToolButton(this))
, mLineEdit(new SelectImapLineEdit(this))
{
auto layout = new QHBoxLayout(this);
layout->setObjectName(QStringLiteral("mainlayout"));
layout->setContentsMargins({});
mLineEdit = new SelectImapLineEdit(this);
mLineEdit->setObjectName(QStringLiteral("lineedit"));
layout->addWidget(mLineEdit);
mToolButton = new QToolButton(this);
mToolButton->setText(QStringLiteral("..."));
mToolButton->setObjectName(QStringLiteral("toolbutton"));
mToolButton->setToolTip(i18n("Select IMAP folder"));
......
......@@ -30,7 +30,7 @@ private:
SelectImapFolderDialog *selectFolderDialog();
KSieveUi::SieveImapAccountSettings mAccount;
QPointer<SelectImapFolderDialog> mSelectImapFolderDialog;
QToolButton *mToolButton = nullptr;
SelectImapLineEdit *mLineEdit = nullptr;
QToolButton *const mToolButton;
SelectImapLineEdit *const mLineEdit;
};
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