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

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