Commit 951ecd93 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify pointer + use Q_REQUIRED_RESULT

parent c8e01595
Pipeline #74086 passed with stage
in 55 minutes and 10 seconds
......@@ -21,6 +21,6 @@ public:
void resetSettings() override;
private:
AutomaticAddContactsConfigureTab *mConfigureTab = nullptr;
AutomaticAddContactsConfigureTab *const mConfigureTab;
};
......@@ -21,9 +21,9 @@ public:
void setAddressList(const QStringList &addressList);
QStringList validEmails() const;
Q_REQUIRED_RESULT QStringList validEmails() const;
QStringList invalidEmails() const;
Q_REQUIRED_RESULT QStringList invalidEmails() const;
private:
QStringList mAddressList;
......
......@@ -13,6 +13,7 @@
ConfirmAddressWidget::ConfirmAddressWidget(QWidget *parent)
: QWidget(parent)
, mListEmails(new QListWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins({});
......@@ -22,7 +23,6 @@ ConfirmAddressWidget::ConfirmAddressWidget(QWidget *parent)
lab->setObjectName(QStringLiteral("label"));
mainLayout->addWidget(lab);
mListEmails = new QListWidget(this);
mListEmails->setObjectName(QStringLiteral("listemails"));
connect(mListEmails, &QListWidget::itemChanged, this, &ConfirmAddressWidget::slotItemChanged);
mainLayout->addWidget(mListEmails);
......
......@@ -26,6 +26,6 @@ Q_SIGNALS:
private:
void createAddressItems(const QStringList &address, bool valid);
void slotItemChanged(QListWidgetItem *item);
QListWidget *mListEmails = nullptr;
QListWidget *const mListEmails;
};
......@@ -19,10 +19,10 @@
GrammalecteInterface::GrammalecteInterface(KActionCollection *ac, QWidget *parent)
: MessageComposer::PluginEditorGrammarCustomToolsViewInterface(parent)
, mGrammarResultWidget(new GrammalecteResultWidget(this))
{
auto layout = new QHBoxLayout(this);
layout->setContentsMargins({});
mGrammarResultWidget = new GrammalecteResultWidget(this);
connect(mGrammarResultWidget, &GrammalecteResultWidget::replaceText, this, &GrammalecteInterface::slotReplaceText);
connect(mGrammarResultWidget, &GrammalecteResultWidget::checkAgain, this, &GrammalecteInterface::checkAgain);
connect(mGrammarResultWidget, &GrammalecteResultWidget::closeChecker, this, &GrammalecteInterface::closeChecker);
......
......@@ -15,7 +15,7 @@ public:
explicit GrammalecteInterface(KActionCollection *ac, QWidget *parent = nullptr);
~GrammalecteInterface() override;
KToggleAction *action() const override;
Q_REQUIRED_RESULT KToggleAction *action() const override;
private:
Q_DISABLE_COPY(GrammalecteInterface)
......@@ -24,7 +24,7 @@ private:
void createAction(KActionCollection *ac);
void checkAgain();
void closeChecker();
GrammalecteResultWidget *mGrammarResultWidget = nullptr;
GrammalecteResultWidget *const mGrammarResultWidget;
KToggleAction *mAction = nullptr;
};
......@@ -14,12 +14,12 @@
GrammalecteConfigDialog::GrammalecteConfigDialog(QWidget *parent, bool disableMessageBox)
: QDialog(parent)
, mConfigWidget(new GrammalecteConfigWidget(this, disableMessageBox))
{
setWindowTitle(i18nc("@title:window", "Configure Grammalecte"));
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mConfigWidget = new GrammalecteConfigWidget(this, disableMessageBox);
mConfigWidget->setObjectName(QStringLiteral("configwidget"));
mainLayout->addWidget(mConfigWidget);
......
......@@ -19,6 +19,6 @@ private:
Q_DISABLE_COPY(GrammalecteConfigDialog)
void writeConfig();
void readConfig();
GrammalecteConfigWidget *mConfigWidget = nullptr;
GrammalecteConfigWidget *const mConfigWidget;
};
......@@ -14,6 +14,7 @@
GrammarResultWidget::GrammarResultWidget(QWidget *parent)
: QWidget(parent)
, mResult(new GrammarResultTextEdit(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
......@@ -34,7 +35,6 @@ GrammarResultWidget::GrammarResultWidget(QWidget *parent)
mExtraWidgetLayout->addStretch(1);
connect(closeBtn, &QToolButton::clicked, this, &GrammarResultWidget::closeChecker);
mResult = new GrammarResultTextEdit(this);
mResult->setObjectName(QStringLiteral("grammarResult"));
connect(mResult, &GrammarResultTextEdit::replaceText, this, &GrammarResultWidget::replaceText);
connect(mResult, &GrammarResultTextEdit::checkAgain, this, &GrammarResultWidget::checkAgain);
......
......@@ -31,7 +31,7 @@ Q_SIGNALS:
protected:
virtual void addExtraWidget();
GrammarResultTextEdit *mResult = nullptr;
GrammarResultTextEdit *const mResult;
QHBoxLayout *mExtraWidgetLayout = nullptr;
private:
......
......@@ -20,10 +20,10 @@
LanguageToolInterface::LanguageToolInterface(KActionCollection *ac, QWidget *parent)
: MessageComposer::PluginEditorGrammarCustomToolsViewInterface(parent)
, mGrammarResultWidget(new LanguageToolResultWidget(this))
{
auto layout = new QHBoxLayout(this);
layout->setContentsMargins({});
mGrammarResultWidget = new LanguageToolResultWidget(this);
connect(mGrammarResultWidget, &LanguageToolResultWidget::replaceText, this, &LanguageToolInterface::slotReplaceText);
connect(mGrammarResultWidget, &LanguageToolResultWidget::checkAgain, this, &LanguageToolInterface::checkAgain);
connect(mGrammarResultWidget, &LanguageToolResultWidget::closeChecker, this, &LanguageToolInterface::closeChecker);
......
......@@ -24,7 +24,7 @@ private:
void createAction(KActionCollection *ac);
void closeChecker();
bool checkAgain();
LanguageToolResultWidget *mGrammarResultWidget = nullptr;
LanguageToolResultWidget *const mGrammarResultWidget;
KToggleAction *mAction = nullptr;
};
......@@ -19,12 +19,12 @@ static const char myConfigGroupName[] = "LanguageToolConfigDialog";
}
LanguageToolConfigDialog::LanguageToolConfigDialog(QWidget *parent)
: QDialog(parent)
, mConfigWidget(new LanguageToolConfigWidget(this))
{
setWindowTitle(i18nc("@title:window", "Configure LanguageTool"));
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mConfigWidget = new LanguageToolConfigWidget(this);
mConfigWidget->setObjectName(QStringLiteral("configwidget"));
mainLayout->addWidget(mConfigWidget);
......
......@@ -19,6 +19,6 @@ private:
Q_DISABLE_COPY(LanguageToolConfigDialog)
void writeConfig();
void readConfig();
LanguageToolConfigWidget *mConfigWidget = nullptr;
LanguageToolConfigWidget *const mConfigWidget;
};
......@@ -21,25 +21,26 @@
LanguageToolConfigWidget::LanguageToolConfigWidget(QWidget *parent)
: QWidget(parent)
, mUseLocalInstance(new QCheckBox(i18n("Use Local Instance"), this))
, mInstancePath(new QLineEdit(this))
, mInstancePathLabel(new QLabel(i18n("Instance Path:"), this))
, mLanguageToolCombobox(new LanguageToolComboBox(this))
, mLanguageToolUpdateCombobox(new LanguageToolUpdateComboBox(this))
{
mLanguageToolUpdateCombobox = new LanguageToolUpdateComboBox(this);
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins({});
mUseLocalInstance = new QCheckBox(i18n("Use Local Instance"), this);
mUseLocalInstance->setObjectName(QStringLiteral("uselocalinstance"));
mainLayout->addWidget(mUseLocalInstance);
auto instanceLayout = new QHBoxLayout;
instanceLayout->setObjectName(QStringLiteral("instancelayout"));
instanceLayout->setContentsMargins({});
mInstancePathLabel = new QLabel(i18n("Instance Path:"), this);
mInstancePathLabel->setObjectName(QStringLiteral("instancepath"));
mInstancePathLabel->setEnabled(false);
instanceLayout->addWidget(mInstancePathLabel);
mInstancePath = new QLineEdit(this);
mInstancePath->setObjectName(QStringLiteral("instancepath"));
mInstancePath->setEnabled(false);
mInstancePath->setClearButtonEnabled(true);
......@@ -54,7 +55,6 @@ LanguageToolConfigWidget::LanguageToolConfigWidget(QWidget *parent)
languageLabel->setObjectName(QStringLiteral("languageLabel"));
languageLayout->addWidget(languageLabel);
mLanguageToolCombobox = new LanguageToolComboBox(this);
mLanguageToolCombobox->setObjectName(QStringLiteral("languagecombobox"));
languageLayout->addWidget(mLanguageToolCombobox);
mLanguageToolUpdateCombobox->setLanguageToolCombobox(mLanguageToolCombobox);
......
......@@ -29,10 +29,10 @@ private:
Q_DISABLE_COPY(LanguageToolConfigWidget)
void updateWidgets(bool enabled);
void slotResetValue();
QCheckBox *mUseLocalInstance = nullptr;
QLineEdit *mInstancePath = nullptr;
QLabel *mInstancePathLabel = nullptr;
LanguageToolComboBox *mLanguageToolCombobox = nullptr;
LanguageToolUpdateComboBox *mLanguageToolUpdateCombobox = nullptr;
QCheckBox *const mUseLocalInstance;
QLineEdit *const mInstancePath;
QLabel *const mInstancePathLabel;
LanguageToolComboBox *const mLanguageToolCombobox;
LanguageToolUpdateComboBox *const mLanguageToolUpdateCombobox;
};
......@@ -16,7 +16,7 @@ public:
explicit SendMailTransportPlugin(QObject *parent = nullptr, const QList<QVariant> & = {});
~SendMailTransportPlugin() override;
QVector<MailTransport::TransportAbstractPluginInfo> names() const override;
Q_REQUIRED_RESULT QVector<MailTransport::TransportAbstractPluginInfo> names() const override;
bool configureTransport(const QString &identifier, MailTransport::Transport *transport, QWidget *parent) override;
MailTransport::TransportJob *createTransportJob(MailTransport::Transport *t, const QString &identifier) override;
};
......
......@@ -16,5 +16,5 @@ public:
~TranslatorPlugin() override;
PimCommon::CustomToolsViewInterface *createView(KActionCollection *ac, PimCommon::CustomToolsWidgetNg *parent) override;
QString customToolName() const override;
Q_REQUIRED_RESULT QString customToolName() const override;
};
......@@ -16,6 +16,10 @@
DKIMConfigureTab::DKIMConfigureTab(QWidget *parent)
: QWidget(parent)
, mGeneralWidget(new DKIMGeneralWidget(this))
, mRecordWidget(new DKIMKeyRecordWidget(this))
, mAdvancedWidget(new DKIMAdvancedWidget(this))
, mPolicyWidget(new DKIMPolicyWidget(this))
, mTabWidget(new QTabWidget(this))
{
auto mainLayout = new QHBoxLayout(this);
......@@ -33,16 +37,12 @@ DKIMConfigureTab::~DKIMConfigureTab()
void DKIMConfigureTab::initTab()
{
mGeneralWidget = new DKIMGeneralWidget(this);
mTabWidget->addTab(mGeneralWidget, i18n("General"));
mRecordWidget = new DKIMKeyRecordWidget(this);
mTabWidget->addTab(mRecordWidget, i18n("Record Keys"));
mPolicyWidget = new DKIMPolicyWidget(this);
mTabWidget->addTab(mPolicyWidget, i18n("Policy"));
mAdvancedWidget = new DKIMAdvancedWidget(this);
mTabWidget->addTab(mAdvancedWidget, i18n("Advanced"));
}
......
......@@ -27,10 +27,10 @@ public:
private:
void initTab();
DKIMGeneralWidget *mGeneralWidget = nullptr;
DKIMKeyRecordWidget *mRecordWidget = nullptr;
DKIMAdvancedWidget *mAdvancedWidget = nullptr;
DKIMPolicyWidget *mPolicyWidget = nullptr;
DKIMGeneralWidget *const mGeneralWidget;
DKIMKeyRecordWidget *const mRecordWidget;
DKIMAdvancedWidget *const mAdvancedWidget;
DKIMPolicyWidget *const mPolicyWidget;
QTabWidget *const mTabWidget;
};
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