Commit 60d63759 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

modernize code

parent 1decfc3e
Pipeline #32939 passed with stage
in 17 minutes and 30 seconds
......@@ -28,11 +28,10 @@ using namespace KCalendarCore;
struct MultiChange {
Akonadi::Item parent;
QVector<Akonadi::Item::Id> children;
bool success;
bool success = true;
explicit MultiChange(const Akonadi::Item &parent = Akonadi::Item())
: parent(parent)
, success(true)
{
}
......
......@@ -19,7 +19,7 @@ public:
{
}
QItemSelectionModel *model = nullptr;
QItemSelectionModel *const model;
};
CollectionSelection::CollectionSelection(QItemSelectionModel *selectionModel, QObject *parent)
......
......@@ -47,8 +47,8 @@ public:
m_changer->setGroupwareCommunication(m_wasEnabled);
}
bool m_wasEnabled;
Akonadi::IncidenceChanger *m_changer = nullptr;
bool m_wasEnabled = false;
Akonadi::IncidenceChanger *const m_changer;
};
EventArchiver::EventArchiver(QObject *parent)
......
......@@ -15,8 +15,6 @@ using namespace CalendarSupport;
FreeBusyItem::FreeBusyItem(const KCalendarCore::Attendee &attendee, QWidget *parentWidget)
: mAttendee(attendee)
, mTimerID(0)
, mIsDownloading(false)
, mParentWidget(parentWidget)
{
Q_ASSERT(!attendee.isNull());
......
......@@ -52,12 +52,12 @@ private:
KCalendarCore::FreeBusy::Ptr mFreeBusy;
// This is used for the update timer
int mTimerID;
int mTimerID = 0;
// Only run one download job at a time
bool mIsDownloading = false;
QWidget *mParentWidget = nullptr;
QWidget *const mParentWidget;
};
}
#endif
......@@ -22,7 +22,6 @@ class IncidenceAttachmentModelPrivate
: q_ptr(qq)
, m_modelIndex(modelIndex)
, m_item(item)
, m_monitor(nullptr)
{
if (modelIndex.isValid()) {
QObject::connect(modelIndex.model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
......
......@@ -39,7 +39,7 @@ public:
Akonadi::Collection::Id mDefaultCalendarId;
TagCache mTagCache;
QColor mDefaultCategoryColor;
const QColor mDefaultCategoryColor;
QDateTime mDayBegins;
};
......
......@@ -43,8 +43,8 @@ protected:
}
private:
KDatePicker *mDatePicker = nullptr;
QWidget *mOriginalParent = nullptr;
KDatePicker *const mDatePicker;
QWidget *const mOriginalParent;
};
class Q_DECL_HIDDEN KDatePickerPopup::Private
......@@ -52,7 +52,6 @@ class Q_DECL_HIDDEN KDatePickerPopup::Private
public:
Private(KDatePickerPopup *qq)
: q(qq)
, mDatePicker(nullptr)
{
}
......@@ -65,7 +64,7 @@ public:
void slotNextMonth();
void slotNoDate();
KDatePickerPopup *q = nullptr;
KDatePickerPopup *const q;
KDatePicker *mDatePicker = nullptr;
Modes mModes;
};
......
......@@ -56,11 +56,7 @@ class Q_DECL_HIDDEN IncidenceViewer::Private
{
public:
Private(IncidenceViewer *parent)
: mCalendar(nullptr)
, mParent(parent)
, mParentCollectionFetchJob(nullptr)
, mAttachmentModel(nullptr)
, mDelayedClear(false)
: mParent(parent)
{
mAttachmentHandler = new AttachmentHandler(parent);
mBrowser = new TextBrowser;
......@@ -111,7 +107,7 @@ public:
}
Akonadi::ETMCalendar *mCalendar = nullptr;
IncidenceViewer *mParent = nullptr;
IncidenceViewer *const mParent;
TextBrowser *mBrowser = nullptr;
Akonadi::Item mCurrentItem;
QString mHeaderText;
......
......@@ -38,7 +38,7 @@ private:
QHash<Akonadi::Tag::Id, Akonadi::Tag> mCache;
QHash<QByteArray, Akonadi::Tag::Id> mGidCache;
QHash<QString, Akonadi::Tag::Id> mNameCache;
Akonadi::Monitor *mMonitor = nullptr;
Akonadi::Monitor *const mMonitor;
};
}
......
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