Commit b9ee26c5 authored by Laurent Montel's avatar Laurent Montel 😁

const'ify pointer

parent 810da5c9
Pipeline #36710 failed with stage
in 35 minutes and 21 seconds
...@@ -70,7 +70,7 @@ void DavFreeBusyHandler::retrieveFreeBusy(const QString &email, const QDateTime ...@@ -70,7 +70,7 @@ void DavFreeBusyHandler::retrieveFreeBusy(const QString &email, const QDateTime
const QStringList principalScheduleOutboxFromEmail = mPrincipalScheduleOutbox[email]; const QStringList principalScheduleOutboxFromEmail = mPrincipalScheduleOutbox[email];
for (const QString &outbox : principalScheduleOutboxFromEmail) { for (const QString &outbox : principalScheduleOutboxFromEmail) {
++mRequestsTracker[email].retrievalJobCount; ++mRequestsTracker[email].retrievalJobCount;
uint requestId = mNextRequestId++; const uint requestId = mNextRequestId++;
QUrl url(outbox); QUrl url(outbox);
KIO::StoredTransferJob *job = KIO::storedHttpPost(fbData, url); KIO::StoredTransferJob *job = KIO::storedHttpPost(fbData, url);
......
...@@ -22,15 +22,15 @@ public: ...@@ -22,15 +22,15 @@ public:
explicit SearchDialog(QWidget *parent = nullptr); explicit SearchDialog(QWidget *parent = nullptr);
~SearchDialog() override; ~SearchDialog() override;
bool useDefaultCredentials() const; Q_REQUIRED_RESULT bool useDefaultCredentials() const;
void setUsername(const QString &user); void setUsername(const QString &user);
QString username() const; Q_REQUIRED_RESULT QString username() const;
void setPassword(const QString &password); void setPassword(const QString &password);
QString password() const; Q_REQUIRED_RESULT QString password() const;
QStringList selection() const; Q_REQUIRED_RESULT QStringList selection() const;
private: private:
void checkUserInput(); void checkUserInput();
......
...@@ -41,7 +41,6 @@ class SettingsHelper ...@@ -41,7 +41,6 @@ class SettingsHelper
{ {
public: public:
SettingsHelper() SettingsHelper()
: q(nullptr)
{ {
} }
...@@ -50,7 +49,7 @@ public: ...@@ -50,7 +49,7 @@ public:
delete q; delete q;
} }
Settings *q; Settings *q = nullptr;
}; };
Q_GLOBAL_STATIC(SettingsHelper, s_globalSettings) Q_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
......
...@@ -111,11 +111,11 @@ static QString settingsToUrl(const QWizard *wizard, const QString &protocol) ...@@ -111,11 +111,11 @@ static QString settingsToUrl(const QWizard *wizard, const QString &protocol)
url.setScheme(QStringLiteral("http")); url.setScheme(QStringLiteral("http"));
} }
QString host = wizard->field(QStringLiteral("connectionHost")).toString(); const QString host = wizard->field(QStringLiteral("connectionHost")).toString();
if (host.isEmpty()) { if (host.isEmpty()) {
return QString(); return QString();
} }
QStringList hostParts = host.split(QLatin1Char(':')); const QStringList hostParts = host.split(QLatin1Char(':'));
url.setHost(hostParts.at(0)); url.setHost(hostParts.at(0));
url.setPath(pathPattern); url.setPath(pathPattern);
......
...@@ -63,7 +63,7 @@ private: ...@@ -63,7 +63,7 @@ private:
QString mDefaultUsername; QString mDefaultUsername;
QString mDefaultPassword; QString mDefaultPassword;
QPushButton *mOkButton = nullptr; QPushButton *mOkButton = nullptr;
QButtonGroup *mRemoteProtocolGroup = nullptr; QButtonGroup *const mRemoteProtocolGroup;
}; };
#endif #endif
...@@ -166,13 +166,13 @@ bool Utils::parseDavData(const KDAV::DavItem &source, Akonadi::Item &target, Ako ...@@ -166,13 +166,13 @@ bool Utils::parseDavData(const KDAV::DavItem &source, Akonadi::Item &target, Ako
for (const IncidencePtr &exception : qAsConst(exceptions)) { for (const IncidencePtr &exception : qAsConst(exceptions)) {
if (exception->status() == KCalendarCore::Incidence::StatusCanceled) { if (exception->status() == KCalendarCore::Incidence::StatusCanceled) {
QDateTime exDateTime(exception->recurrenceId()); const QDateTime exDateTime(exception->recurrenceId());
mainIncidence->recurrence()->addExDateTime(exDateTime); mainIncidence->recurrence()->addExDateTime(exDateTime);
} else { } else {
// The exception remote id will contain a fragment pointing to // The exception remote id will contain a fragment pointing to
// its instance identifier to distinguish it from the main // its instance identifier to distinguish it from the main
// event. // event.
QString rid = target.remoteId() + QLatin1String("#") + exception->instanceIdentifier(); const QString rid = target.remoteId() + QLatin1String("#") + exception->instanceIdentifier();
qCDebug(DAVRESOURCE_LOG) << "Extra incidence at" << rid; qCDebug(DAVRESOURCE_LOG) << "Extra incidence at" << rid;
Akonadi::Item extraItem = target; Akonadi::Item extraItem = target;
extraItem.setRemoteId(rid); extraItem.setRemoteId(rid);
......
...@@ -9,18 +9,10 @@ ...@@ -9,18 +9,10 @@
#include <KConfigGroup> #include <KConfigGroup>
FolderArchiveAccountInfo::FolderArchiveAccountInfo() FolderArchiveAccountInfo::FolderArchiveAccountInfo()
: mArchiveType(UniqueFolder)
, mArchiveTopLevelCollectionId(-1)
, mEnabled(false)
, mKeepExistingStructure(false)
{ {
} }
FolderArchiveAccountInfo::FolderArchiveAccountInfo(const KConfigGroup &config) FolderArchiveAccountInfo::FolderArchiveAccountInfo(const KConfigGroup &config)
: mArchiveType(UniqueFolder)
, mArchiveTopLevelCollectionId(-1)
, mEnabled(false)
, mKeepExistingStructure(false)
{ {
readConfig(config); readConfig(config);
} }
......
...@@ -46,11 +46,11 @@ public: ...@@ -46,11 +46,11 @@ public:
bool operator==(const FolderArchiveAccountInfo &other) const; bool operator==(const FolderArchiveAccountInfo &other) const;
private: private:
FolderArchiveAccountInfo::FolderArchiveType mArchiveType; FolderArchiveAccountInfo::FolderArchiveType mArchiveType = UniqueFolder;
Akonadi::Collection::Id mArchiveTopLevelCollectionId; Akonadi::Collection::Id mArchiveTopLevelCollectionId = -1;
QString mInstanceName; QString mInstanceName;
bool mEnabled; bool mEnabled = false;
bool mKeepExistingStructure; bool mKeepExistingStructure = false;
}; };
#endif // FOLDERARCHIVEACCOUNTINFO_H #endif // FOLDERARCHIVEACCOUNTINFO_H
...@@ -62,7 +62,6 @@ FolderArchiveAccountInfo::FolderArchiveType FolderArchiveComboBox::type() const ...@@ -62,7 +62,6 @@ FolderArchiveAccountInfo::FolderArchiveType FolderArchiveComboBox::type() const
FolderArchiveSettingPage::FolderArchiveSettingPage(const QString &instanceName, QWidget *parent) FolderArchiveSettingPage::FolderArchiveSettingPage(const QString &instanceName, QWidget *parent)
: QWidget(parent) : QWidget(parent)
, mInstanceName(instanceName) , mInstanceName(instanceName)
, mInfo(nullptr)
{ {
QVBoxLayout *lay = new QVBoxLayout(this); QVBoxLayout *lay = new QVBoxLayout(this);
mEnabled = new QCheckBox(i18n("Enable")); mEnabled = new QCheckBox(i18n("Enable"));
......
...@@ -44,7 +44,7 @@ public: ...@@ -44,7 +44,7 @@ public:
private: private:
void slotEnableChanged(bool enabled); void slotEnableChanged(bool enabled);
QString mInstanceName; const QString mInstanceName;
QCheckBox *mEnabled = nullptr; QCheckBox *mEnabled = nullptr;
FolderArchiveComboBox *mArchiveNamed = nullptr; FolderArchiveComboBox *mArchiveNamed = nullptr;
Akonadi::CollectionRequester *mArchiveFolder = nullptr; Akonadi::CollectionRequester *mArchiveFolder = nullptr;
......
...@@ -86,8 +86,8 @@ protected Q_SLOTS: ...@@ -86,8 +86,8 @@ protected Q_SLOTS:
protected: protected:
void emitReadyStatus(); void emitReadyStatus();
GoogleResourceStateInterface *m_iface = nullptr; GoogleResourceStateInterface *const m_iface;
GoogleSettings *m_settings = nullptr; GoogleSettings *const m_settings;
}; };
#endif // GENERICHANDLER_H #endif // GENERICHANDLER_H
...@@ -84,7 +84,7 @@ private: ...@@ -84,7 +84,7 @@ private:
GoogleSettings *m_settings = nullptr; GoogleSettings *m_settings = nullptr;
Akonadi::Collection m_rootCollection; Akonadi::Collection m_rootCollection;
GoogleResourceState *m_iface; GoogleResourceState *const m_iface;
std::vector<GenericHandler::Ptr> m_handlers; std::vector<GenericHandler::Ptr> m_handlers;
FreeBusyHandler::Ptr m_freeBusyHandler; FreeBusyHandler::Ptr m_freeBusyHandler;
......
...@@ -63,7 +63,7 @@ public: ...@@ -63,7 +63,7 @@ public:
bool canPerformTask() override; bool canPerformTask() override;
bool handleError(KGAPI2::Job *job, bool _cancelTask) override; bool handleError(KGAPI2::Job *job, bool _cancelTask) override;
private: private:
GoogleResource *m_resource = nullptr; GoogleResource *const m_resource;
}; };
#endif // GOOGLERESOURCESTATE_H #endif // GOOGLERESOURCESTATE_H
...@@ -30,8 +30,8 @@ protected: ...@@ -30,8 +30,8 @@ protected:
bool handleError(KGAPI2::Job *job); bool handleError(KGAPI2::Job *job);
void accountChanged(); void accountChanged();
private: private:
GoogleResource *m_resource; GoogleResource *const m_resource;
GoogleSettings *m_settings; GoogleSettings *const m_settings;
Ui::GoogleSettingsDialog *m_ui = nullptr; Ui::GoogleSettingsDialog *m_ui = nullptr;
KGAPI2::AccountPtr m_account; KGAPI2::AccountPtr m_account;
private Q_SLOTS: private Q_SLOTS:
......
...@@ -31,7 +31,7 @@ private Q_SLOTS: ...@@ -31,7 +31,7 @@ private Q_SLOTS:
void onTokenRequestFinished(KGAPI2::AccountPromise *promise); void onTokenRequestFinished(KGAPI2::AccountPromise *promise);
private: private:
ImapResourceBase *mResource = nullptr; ImapResourceBase *const mResource;
QPointer<KGAPI2::AccountPromise> mPendingPromise; QPointer<KGAPI2::AccountPromise> mPendingPromise;
}; };
......
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