Commit 186e742c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify pointer

parent acf7658c
Pipeline #96931 passed with stage
in 6 minutes and 39 seconds
......@@ -15,9 +15,9 @@
ConfigFile::ConfigFile(const QString &configName, QObject *parent)
: SetupObject(parent)
, m_config(new KConfig(configName))
{
m_name = configName;
m_config = new KConfig(configName);
}
ConfigFile::~ConfigFile()
......
......@@ -37,7 +37,7 @@ public Q_SLOTS:
private:
QVector<Config> m_configData;
QString m_name;
KConfig *m_config = nullptr;
KConfig *const m_config;
QString m_editName;
bool m_editMode = false;
};
......
......@@ -36,9 +36,9 @@
Dialog::Dialog(QWidget *parent)
: KAssistantDialog(parent)
, mSetupManager(new SetupManager(this))
{
resize(480, 600);
mSetupManager = new SetupManager(this);
const bool showPersonalDataPage = Global::typeFilter().size() == 1 && Global::typeFilter().at(0) == KMime::Message::mimeType();
if (showPersonalDataPage) {
// todo: don't ask these details based on a setting of the desktop file.
......
......@@ -45,7 +45,7 @@ private:
KPageWidgetItem *addPage(Page *page, const QString &title);
private:
SetupManager *mSetupManager = nullptr;
SetupManager *const mSetupManager;
KPageWidgetItem *mLastPage = nullptr;
KPageWidgetItem *mProviderPage = nullptr;
KPageWidgetItem *mTypePage = nullptr;
......
......@@ -20,7 +20,7 @@ DynamicPage::DynamicPage(const QString &uiFile, KAssistantDialog *parent)
: Page(parent)
{
auto *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins({});
QWidget *pageParent = this;
......
......@@ -15,7 +15,6 @@
LoadPage::LoadPage(KAssistantDialog *parent)
: Page(parent)
, m_action(nullptr)
{
ui.setupUi(this);
setValid(false);
......
......@@ -10,9 +10,7 @@
Page::Page(KAssistantDialog *parent)
: QWidget(parent)
, m_item(nullptr)
, m_parent(parent)
, m_valid(false)
{
}
......
......@@ -31,7 +31,6 @@ QString accountName(Ispdb *ispdb, QString username)
PersonalDataPage::PersonalDataPage(Dialog *parent)
: Page(parent)
, mIspdb(nullptr)
, mSetupManager(parent->setupManager())
{
QWidget *pageParent = this;
......
......@@ -42,6 +42,6 @@ private:
Ui::PersonalDataPage ui;
Ispdb *mIspdb = nullptr;
SetupManager *mSetupManager = nullptr;
SetupManager *const mSetupManager;
};
......@@ -45,9 +45,9 @@ private:
void findDesktopAndSetAssistant(const QStringList &list);
Ui::ProviderPage ui;
QStandardItemModel *m_model = nullptr;
QStandardItemModel *const m_model;
QStandardItem *m_fetchItem = nullptr;
KNSCore::Engine *m_engine = nullptr;
KNSCore::Engine *const m_engine;
QSortFilterProxyModel *mProxy;
KNSCore::EntryInternal::List m_providerEntries;
Provider m_wantedProvider;
......
......@@ -35,6 +35,6 @@ private Q_SLOTS:
void testFinished(const QVector<int> &list);
private:
MailTransport::ServerTest *m_serverTest = nullptr;
MailTransport::ServerTest *const m_serverTest;
};
......@@ -15,8 +15,8 @@
SetupAutoconfigKolabFreebusy::SetupAutoconfigKolabFreebusy(QObject *parent)
: SetupObject(parent)
, mIspdb(new AutoconfigKolabFreebusy(this))
{
mIspdb = new AutoconfigKolabFreebusy(this);
connect(mIspdb, &AutoconfigKolabFreebusy::finished, this, &SetupAutoconfigKolabFreebusy::onIspdbFinished);
}
......
......@@ -36,6 +36,6 @@ Q_SIGNALS:
private:
void onIspdbFinished(bool);
AutoconfigKolabFreebusy *mIspdb = nullptr;
AutoconfigKolabFreebusy *const mIspdb;
};
......@@ -13,8 +13,8 @@
SetupAutoconfigKolabLdap::SetupAutoconfigKolabLdap(QObject *parent)
: SetupObject(parent)
, mIspdb(new AutoconfigKolabLdap(this))
{
mIspdb = new AutoconfigKolabLdap(this);
connect(mIspdb, &AutoconfigKolabLdap::finished, this, &SetupAutoconfigKolabLdap::onIspdbFinished);
}
......
......@@ -37,6 +37,6 @@ private Q_SLOTS:
void onIspdbFinished(bool);
private:
AutoconfigKolabLdap *mIspdb = nullptr;
AutoconfigKolabLdap *const mIspdb;
};
......@@ -16,8 +16,8 @@
SetupIspdb::SetupIspdb(QObject *parent)
: SetupObject(parent)
, mIspdb(new Ispdb(this))
{
mIspdb = new Ispdb(this);
connect(mIspdb, &Ispdb::finished, this, &SetupIspdb::onIspdbFinished);
}
......
......@@ -26,6 +26,6 @@ public:
private:
void detailsClicked();
Ui::SetupPage ui;
QStandardItemModel *m_msgModel = nullptr;
QStandardItemModel *const m_msgModel;
};
......@@ -50,11 +50,8 @@ template<typename T> static typename T::value_type stringToValue(const T *table,
Transport::Transport(const QString &type, QObject *parent)
: SetupObject(parent)
, m_transportId(-1)
, m_port(-1)
, m_encr(MailTransport::Transport::EnumEncryption::TLS)
, m_auth(MailTransport::Transport::EnumAuthenticationType::PLAIN)
, m_editMode(false)
{
if (type == QLatin1String("smtp")) {
m_port = 25;
......
......@@ -31,10 +31,10 @@ public Q_SLOTS:
Q_SCRIPTABLE void setEditMode(const bool editMode);
private:
int m_transportId;
int m_transportId = -1;
QString m_name;
QString m_host;
int m_port;
int m_port = -1;
QString m_user;
QString m_password;
MailTransport::Transport::EnumEncryption::type m_encr;
......@@ -42,6 +42,6 @@ private:
QString m_encrStr;
QString m_authStr;
bool m_editMode;
bool m_editMode = false;
};
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