Commit 300add84 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify some pointer

parent b5e43f65
Pipeline #57715 canceled with stage
in 3 minutes and 49 seconds
......@@ -15,12 +15,13 @@
ExternalComposerConfigureWidget::ExternalComposerConfigureWidget(QWidget *parent)
: MessageComposer::PluginEditorInitConfigureWidget(parent)
, mExternalEditorCheck(new QCheckBox(i18n("Use external editor instead of composer"), this))
, mEditorRequester(new KUrlRequester(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins({});
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mExternalEditorCheck = new QCheckBox(i18n("Use external editor instead of composer"), this);
mExternalEditorCheck->setObjectName(QStringLiteral("enabled"));
mExternalEditorCheck->setChecked(false);
mainLayout->addWidget(mExternalEditorCheck);
......@@ -30,7 +31,6 @@ ExternalComposerConfigureWidget::ExternalComposerConfigureWidget(QWidget *parent
label->setObjectName(QStringLiteral("urlrequesterlabel"));
hbox->addWidget(label);
mEditorRequester = new KUrlRequester(this);
mEditorRequester->setObjectName(QStringLiteral("mEditorRequester"));
hbox->addWidget(mEditorRequester);
......
......@@ -22,7 +22,7 @@ public:
void resetSettings() override;
private:
QCheckBox *mExternalEditorCheck = nullptr;
KUrlRequester *mEditorRequester = nullptr;
QCheckBox *const mExternalEditorCheck;
KUrlRequester *const mEditorRequester;
};
......@@ -17,10 +17,10 @@ static const char myConfigGroupName[] = "SelectMailDialog";
}
SelectMailDialog::SelectMailDialog(QWidget *parent)
: QDialog(parent)
, mSelectMailWidget(new SelectMailWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mSelectMailWidget = new SelectMailWidget(this);
mSelectMailWidget->setObjectName(QStringLiteral("selectmailwidget"));
mainLayout->addWidget(mSelectMailWidget);
......
......@@ -25,6 +25,6 @@ Q_SIGNALS:
private:
void writeConfig();
void readConfig();
SelectMailWidget *mSelectMailWidget = nullptr;
SelectMailWidget *const mSelectMailWidget;
};
......@@ -13,12 +13,12 @@
SelectMailWidget::SelectMailWidget(QWidget *parent)
: QWidget(parent)
, mView(new Akonadi::EmailAddressSelectionWidget(true, nullptr, this))
{
auto layout = new QHBoxLayout(this);
layout->setObjectName(QStringLiteral("mainlayout"));
layout->setContentsMargins({});
mView = new Akonadi::EmailAddressSelectionWidget(true, nullptr, this);
mView->setObjectName(QStringLiteral("emailaddressselectionwidget"));
layout->addWidget(mView);
mView->view()->setSelectionMode(QAbstractItemView::ExtendedSelection);
......
......@@ -20,6 +20,7 @@ static const char myConfigGroupName[] = "ShortUrl";
}
InsertShorturlConfigureWidget::InsertShorturlConfigureWidget(QWidget *parent)
: QWidget(parent)
, mShortUrlServer(new QComboBox(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
......@@ -29,7 +30,6 @@ InsertShorturlConfigureWidget::InsertShorturlConfigureWidget(QWidget *parent)
lab->setObjectName(QStringLiteral("label"));
mainLayout->addWidget(lab);
mShortUrlServer = new QComboBox(this);
mShortUrlServer->setObjectName(QStringLiteral("shorturlserver"));
mainLayout->addWidget(mShortUrlServer);
const QVector<ShortUrlEnginePlugin *> lstPlugin = ShortUrlEnginePluginManager::self()->pluginsList();
......
......@@ -21,6 +21,6 @@ private:
void slotChanged();
void loadConfig();
bool mChanged = false;
QComboBox *mShortUrlServer = nullptr;
QComboBox *const mShortUrlServer;
};
......@@ -20,11 +20,11 @@ static const char myConfigGroupName[] = "QuickTextConfigureDialog";
}
QuickTextConfigureDialog::QuickTextConfigureDialog(QWidget *parent)
: QDialog(parent)
, mQuickTextConfigureWidget(new QuickTextConfigureWidget(this))
{
setWindowTitle(i18nc("@title:window", "Configure quick text"));
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mQuickTextConfigureWidget = new QuickTextConfigureWidget(this);
mQuickTextConfigureWidget->setObjectName(QStringLiteral("quicktextconfigurewidget"));
mainLayout->addWidget(mQuickTextConfigureWidget);
......
......@@ -24,6 +24,6 @@ private:
void slotAccepted();
void slotExport();
void slotImport();
QuickTextConfigureWidget *mQuickTextConfigureWidget = nullptr;
QuickTextConfigureWidget *const mQuickTextConfigureWidget;
};
......@@ -11,12 +11,12 @@
QuickTextConfigureWidget::QuickTextConfigureWidget(QWidget *parent)
: QWidget(parent)
, mSnippetWidget(new QuickTextWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins({});
mSnippetWidget = new QuickTextWidget(this);
mSnippetWidget->setObjectName(QStringLiteral("snippetwidget"));
mainLayout->addWidget(mSnippetWidget);
......
......@@ -16,11 +16,11 @@
AutomaticAddContactsConfigureTab::AutomaticAddContactsConfigureTab(QWidget *parent)
: QWidget(parent)
, mTabWidget(new QTabWidget(this))
{
auto mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins({});
mTabWidget = new QTabWidget(this);
mTabWidget->setObjectName(QStringLiteral("tabwidget"));
mainLayout->addWidget(mTabWidget);
initTab(KIdentityManagement::IdentityManager::self());
......
......@@ -31,7 +31,7 @@ Q_SIGNALS:
private:
void initTab(KIdentityManagement::IdentityManager *identityManager);
QTabWidget *mTabWidget = nullptr;
QTabWidget *const mTabWidget;
QList<AutomaticAddContactsTabWidget *> mListTabWidget;
};
......@@ -14,12 +14,12 @@
AutomaticAddContactsConfigureWidget::AutomaticAddContactsConfigureWidget(QWidget *parent)
: MessageComposer::PluginEditorCheckBeforeSendConfigureWidget(parent)
, mConfigureTab(new AutomaticAddContactsConfigureTab(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins({});
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mConfigureTab = new AutomaticAddContactsConfigureTab(this);
mConfigureTab->setObjectName(QStringLiteral("configuretab"));
mainLayout->addWidget(mConfigureTab);
connect(mConfigureTab, &AutomaticAddContactsConfigureTab::configureChanged, this, &AutomaticAddContactsConfigureWidget::configureChanged);
......
......@@ -24,10 +24,11 @@ QString configGroupName()
}
AutomaticAddContactsTabWidget::AutomaticAddContactsTabWidget(QWidget *parent, QAbstractItemModel *model)
: QWidget(parent)
, mEnabled(new QCheckBox(i18n("Automatic Add Contacts"), this))
, mCollectionCombobox(new Akonadi::CollectionComboBox(model, this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mEnabled = new QCheckBox(i18n("Automatic Add Contacts"), this);
mEnabled->setObjectName(QStringLiteral("enabled"));
connect(mEnabled, &QCheckBox::clicked, this, &AutomaticAddContactsTabWidget::configureChanged);
mainLayout->addWidget(mEnabled);
......@@ -41,7 +42,6 @@ AutomaticAddContactsTabWidget::AutomaticAddContactsTabWidget(QWidget *parent, QA
lab->setObjectName(QStringLiteral("labelfolder"));
hlay->addWidget(lab);
mCollectionCombobox = new Akonadi::CollectionComboBox(model, this);
mCollectionCombobox->setAccessRightsFilter(Akonadi::Collection::CanCreateItem);
mCollectionCombobox->setMinimumWidth(250);
mCollectionCombobox->setMimeTypeFilter(QStringList() << KContacts::Addressee::mimeType());
......
......@@ -29,8 +29,8 @@ Q_SIGNALS:
void configureChanged();
private:
QCheckBox *mEnabled = nullptr;
Akonadi::CollectionComboBox *mCollectionCombobox = nullptr;
QCheckBox *const mEnabled;
Akonadi::CollectionComboBox *const mCollectionCombobox;
uint mIdentity = 0;
};
......@@ -16,27 +16,27 @@ static const char myConfigGroupName[] = "Check Before Send";
}
CheckBeforeSendConfigureWidget::CheckBeforeSendConfigureWidget(QWidget *parent)
: MessageComposer::PluginEditorCheckBeforeSendConfigureWidget(parent)
, mCheckPlainTextMail(new QCheckBox(i18n("Send as plain text"), this))
, mCheckMailTransport(new QCheckBox(i18n("Use SMTP server defined in identity"), this))
, mCheckDuplicateEmailsAddresses(new QCheckBox(i18n("Check duplicated emails addresses"), this))
, mCheckSendAttachments(new QCheckBox(i18n("Check send attachment"), this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins({});
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mCheckPlainTextMail = new QCheckBox(i18n("Send as plain text"), this);
mCheckPlainTextMail->setObjectName(QStringLiteral("checkplaintext"));
connect(mCheckPlainTextMail, &QCheckBox::clicked, this, &CheckBeforeSendConfigureWidget::configureChanged);
mainLayout->addWidget(mCheckPlainTextMail);
mCheckMailTransport = new QCheckBox(i18n("Use SMTP server defined in identity"), this);
mCheckMailTransport->setObjectName(QStringLiteral("smtpdefinedinidentity"));
connect(mCheckMailTransport, &QCheckBox::clicked, this, &CheckBeforeSendConfigureWidget::configureChanged);
mainLayout->addWidget(mCheckMailTransport);
mCheckDuplicateEmailsAddresses = new QCheckBox(i18n("Check duplicated emails addresses"), this);
mCheckDuplicateEmailsAddresses->setObjectName(QStringLiteral("checkduplicatedemailsaddresses"));
connect(mCheckDuplicateEmailsAddresses, &QCheckBox::clicked, this, &CheckBeforeSendConfigureWidget::configureChanged);
mainLayout->addWidget(mCheckDuplicateEmailsAddresses);
mCheckSendAttachments = new QCheckBox(i18n("Check send attachment"), this);
mCheckSendAttachments->setObjectName(QStringLiteral("checksendattachment"));
connect(mCheckSendAttachments, &QCheckBox::clicked, this, &CheckBeforeSendConfigureWidget::configureChanged);
mainLayout->addWidget(mCheckSendAttachments);
......
......@@ -22,9 +22,9 @@ public:
void resetSettings() override;
private:
QCheckBox *mCheckPlainTextMail = nullptr;
QCheckBox *mCheckMailTransport = nullptr;
QCheckBox *mCheckDuplicateEmailsAddresses = nullptr;
QCheckBox *mCheckSendAttachments = nullptr;
QCheckBox *const mCheckPlainTextMail;
QCheckBox *const mCheckMailTransport;
QCheckBox *const mCheckDuplicateEmailsAddresses;
QCheckBox *const mCheckSendAttachments;
};
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