Commit 14267ba1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify pointer

parent 276e9a80
Pipeline #90265 passed with stage
in 6 minutes and 21 seconds
......@@ -50,7 +50,6 @@ CalendarBasePrivate::CalendarBasePrivate(CalendarBase *qq)
CalendarBasePrivate::~CalendarBasePrivate()
{
delete mIncidenceChanger;
mIncidenceChanger = nullptr;
}
void CalendarBasePrivate::internalInsert(const Akonadi::Item &item)
......
......@@ -49,7 +49,7 @@ public:
QHash<KJob *, Akonadi::Collection::Id> mCollectionJobs;
QHash<QString, Akonadi::Item::Id> mItemIdByUid;
QHash<Akonadi::Item::Id, Akonadi::Item> mItemById;
Akonadi::IncidenceChanger *mIncidenceChanger = nullptr;
Akonadi::IncidenceChanger *const mIncidenceChanger;
QHash<QString, QStringList> mParentUidToChildrenUid;
Akonadi::Collection mCollectionForBatchInsertion;
bool mBatchInsertionCancelled = false;
......
......@@ -132,8 +132,7 @@ FreeBusyManagerPrivate::FreeBusyProviderRequest::FreeBusyProviderRequest(const Q
/// FreeBusyManagerPrivate::FreeBusyProvidersRequestsQueue
FreeBusyManagerPrivate::FreeBusyProvidersRequestsQueue::FreeBusyProvidersRequestsQueue()
: mHandlersCount(0)
, mResultingFreeBusy(nullptr)
: mResultingFreeBusy(nullptr)
{
// Set the start of the period to today 00:00:00
mStartTime = QDateTime(QDate::currentDate(), QTime());
......@@ -142,8 +141,7 @@ FreeBusyManagerPrivate::FreeBusyProvidersRequestsQueue::FreeBusyProvidersRequest
}
FreeBusyManagerPrivate::FreeBusyProvidersRequestsQueue::FreeBusyProvidersRequestsQueue(const QDateTime &start, const QDateTime &end)
: mHandlersCount(0)
, mResultingFreeBusy(nullptr)
: mResultingFreeBusy(nullptr)
{
mStartTime = start;
mEndTime = end;
......@@ -155,9 +153,6 @@ FreeBusyManagerPrivate::FreeBusyProvidersRequestsQueue::FreeBusyProvidersRequest
FreeBusyManagerPrivate::FreeBusyManagerPrivate(FreeBusyManager *q)
: QObject()
, q_ptr(q)
, mTimerID(0)
, mUploadingFreeBusy(false)
, mBrokenUrl(false)
, mParentWidgetForRetrieval(nullptr)
{
connect(this, &FreeBusyManagerPrivate::freeBusyUrlRetrieved, this, &FreeBusyManagerPrivate::finishProcessRetrieveQueue);
......@@ -170,7 +165,7 @@ QString FreeBusyManagerPrivate::freeBusyDir() const
void FreeBusyManagerPrivate::checkFreeBusyUrl()
{
QUrl targetURL(CalendarSettings::self()->freeBusyPublishUrl());
const QUrl targetURL(CalendarSettings::self()->freeBusyPublishUrl());
mBrokenUrl = targetURL.isEmpty() || !targetURL.isValid();
}
......@@ -354,8 +349,8 @@ KCalendarCore::FreeBusy::Ptr FreeBusyManagerPrivate::iCalToFreeBusy(const QByteA
KCalendarCore::FreeBusy::Ptr FreeBusyManagerPrivate::ownerFreeBusy()
{
QDateTime start = QDateTime::currentDateTimeUtc();
QDateTime end = start.addDays(CalendarSettings::self()->freeBusyPublishDays());
const QDateTime start = QDateTime::currentDateTimeUtc();
const QDateTime end = start.addDays(CalendarSettings::self()->freeBusyPublishDays());
KCalendarCore::Event::List events = mCalendar ? mCalendar->rawEvents(start.date(), end.date()) : KCalendarCore::Event::List();
KCalendarCore::FreeBusy::Ptr freebusy(new KCalendarCore::FreeBusy(events, start, end));
......@@ -439,10 +434,10 @@ void FreeBusyManagerPrivate::processRetrieveQueue()
return;
}
QString email = mRetrieveQueue.takeFirst();
const QString email = mRetrieveQueue.takeFirst();
// First, try to find all agents that are free-busy providers
QStringList providers = getFreeBusyProviders();
const QStringList providers = getFreeBusyProviders();
qCDebug(AKONADICALENDAR_LOG) << "Got the following FreeBusy providers: " << providers;
// If some free-busy providers were found let's query them first and ask them
......
......@@ -52,7 +52,7 @@ public: /// Structs
QDateTime mStartTime;
QDateTime mEndTime;
QList<FreeBusyProviderRequest> mRequests;
int mHandlersCount;
int mHandlersCount = 0;
KCalendarCore::FreeBusy::Ptr mResultingFreeBusy;
};
......@@ -66,9 +66,9 @@ public:
// Free/Busy uploading
QDateTime mNextUploadTime;
int mTimerID;
bool mUploadingFreeBusy;
bool mBrokenUrl;
int mTimerID = 0;
bool mUploadingFreeBusy = false;
bool mBrokenUrl = false;
QPointer<QWidget> mParentWidgetForMailling;
......
......@@ -168,7 +168,7 @@ void Scheduler::acceptRequest(const IncidenceBase::Ptr &incidenceBase,
return;
}
QString schedulingUid = incidence->uid();
const QString schedulingUid = incidence->uid();
QString errorString;
Result result = ResultSuccess;
......@@ -335,7 +335,7 @@ void Scheduler::acceptCancel(const IncidenceBase::Ptr &incidenceBase,
<< existingIncidences.count() << " incidences with schedulingID " << incidence->schedulingID();
Result result = ResultIncidenceToDeleteNotFound;
QString errorString = i18n("Could not find incidence to delete.");
const QString errorString = i18n("Could not find incidence to delete.");
for (const KCalendarCore::Incidence::Ptr &existingIncidence : existingIncidences) {
qCDebug(AKONADICALENDAR_LOG) << "Considering this found event (" << (existingIncidence->isReadOnly() ? "readonly" : "readwrite")
<< ") :" << mFormat->toString(existingIncidence);
......
Supports Markdown
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