Commit a260926b authored by Laurent Montel's avatar Laurent Montel
Browse files

Const'ify pointer

parent 4f930385
......@@ -15,18 +15,18 @@ using namespace KABMergeContacts;
MergeContactInfoWidget::MergeContactInfoWidget(QWidget *parent)
: QWidget(parent)
, mStackWidget(new QStackedWidget(this))
, mNoContactSelected(new QLabel(this))
, mContactViewer(new KAddressBookGrantlee::GrantleeContactViewer(this))
{
auto lay = new QHBoxLayout(this);
mStackWidget = new QStackedWidget;
mStackWidget->setObjectName(QStringLiteral("stackedwidget"));
mContactViewer = new KAddressBookGrantlee::GrantleeContactViewer;
mContactViewer->setObjectName(QStringLiteral("contactwidget"));
mContactViewer->setForceDisableQRCode(true);
mStackWidget->addWidget(mContactViewer);
mNoContactSelected = new QLabel;
mNoContactSelected->setObjectName(QStringLiteral("nocontact"));
mStackWidget->addWidget(mNoContactSelected);
......
......@@ -31,6 +31,6 @@ public Q_SLOTS:
private:
QStackedWidget *mStackWidget = nullptr;
QLabel *mNoContactSelected = nullptr;
KAddressBookGrantlee::GrantleeContactViewer *mContactViewer = nullptr;
KAddressBookGrantlee::GrantleeContactViewer *const mContactViewer;
};
}
......@@ -19,10 +19,12 @@ using namespace KABMergeContacts;
MergeContactSelectInformationScrollArea::MergeContactSelectInformationScrollArea(QWidget *parent)
: QWidget(parent)
, mStackWidget(new QStackedWidget(this))
, mSelectInformationWidget(new MergeContactSelectInformationWidget(this))
, mMergedContactWidget(new MergeContactInfoWidget(this))
{
auto vbox = new QVBoxLayout(this);
vbox->setContentsMargins({});
mStackWidget = new QStackedWidget;
mStackWidget->setObjectName(QStringLiteral("stackwidget"));
vbox->addWidget(mStackWidget);
......@@ -30,17 +32,16 @@ MergeContactSelectInformationScrollArea::MergeContactSelectInformationScrollArea
selectMergeWidget->setObjectName(QStringLiteral("selectwidget"));
auto layout = new QVBoxLayout;
selectMergeWidget->setLayout(layout);
auto area = new QScrollArea;
auto area = new QScrollArea(this);
area->setWidgetResizable(true);
area->setObjectName(QStringLiteral("scrollarea"));
layout->addWidget(area);
mSelectInformationWidget = new MergeContactSelectInformationWidget;
mSelectInformationWidget->setObjectName(QStringLiteral("selectinformationwidget"));
area->setWidget(mSelectInformationWidget);
auto hbox = new QHBoxLayout;
hbox->addStretch();
auto mergeButton = new QPushButton(i18n("Merge"));
auto mergeButton = new QPushButton(i18n("Merge"), this);
mergeButton->setObjectName(QStringLiteral("merge"));
hbox->addWidget(mergeButton);
layout->addLayout(hbox);
......@@ -48,7 +49,6 @@ MergeContactSelectInformationScrollArea::MergeContactSelectInformationScrollArea
mStackWidget->addWidget(selectMergeWidget);
mMergedContactWidget = new MergeContactInfoWidget;
mMergedContactWidget->setObjectName(QStringLiteral("mergedcontactwidget"));
mStackWidget->addWidget(mMergedContactWidget);
mStackWidget->setCurrentWidget(selectMergeWidget);
......
......@@ -28,8 +28,8 @@ private:
void mergeContact(const KContacts::Addressee &addr);
Akonadi::Collection mCollection;
Akonadi::Item::List mListItem;
MergeContactSelectInformationWidget *mSelectInformationWidget = nullptr;
QStackedWidget *mStackWidget = nullptr;
MergeContactInfoWidget *mMergedContactWidget = nullptr;
MergeContactSelectInformationWidget *const mSelectInformationWidget;
QStackedWidget *const mStackWidget;
MergeContactInfoWidget *const mMergedContactWidget;
};
}
......@@ -17,12 +17,12 @@ using namespace KContacts;
MergeContactSelectListWidget::MergeContactSelectListWidget(QWidget *parent)
: QWidget(parent)
, mConflictType(MergeContacts::None)
, mTitle(new QLabel(this))
, mSelectListWidget(new QListWidget(this))
{
auto vbox = new QVBoxLayout(this);
mTitle = new QLabel(this);
mTitle->setObjectName(QStringLiteral("title"));
vbox->addWidget(mTitle);
mSelectListWidget = new QListWidget(this);
mSelectListWidget->setObjectName(QStringLiteral("listwidget"));
vbox->addWidget(mSelectListWidget);
}
......
......@@ -36,7 +36,7 @@ private:
void updateTitle();
void addItem(const QString &str, const QIcon &icon = QIcon());
QLabel *mTitle = nullptr;
QListWidget *mSelectListWidget = nullptr;
QListWidget *const mSelectListWidget;
MergeContacts::ConflictInformation mConflictType;
};
}
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