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

Fix clazy warning

parent 114aaebc
Pipeline #29691 passed with stage
in 8 minutes and 25 seconds
...@@ -78,9 +78,9 @@ class Q_DECL_HIDDEN EventIndicator::Private ...@@ -78,9 +78,9 @@ class Q_DECL_HIDDEN EventIndicator::Private
public: public:
Private(EventIndicator *parent, EventIndicator::Location loc) Private(EventIndicator *parent, EventIndicator::Location loc)
: q(parent) : mColumns(1)
, mColumns(1)
, mLocation(loc) , mLocation(loc)
, q(parent)
{ {
mEnabled.resize(mColumns); mEnabled.resize(mColumns);
...@@ -717,7 +717,7 @@ void AgendaView::Private::insertIncidence(const KCalendarCore::Incidence::Ptr &i ...@@ -717,7 +717,7 @@ void AgendaView::Private::insertIncidence(const KCalendarCore::Incidence::Ptr &i
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
AgendaView::AgendaView(const QDate &start, const QDate &end, bool isInteractive, bool isSideBySide, QWidget *parent) AgendaView::AgendaView(QDate start, QDate end, bool isInteractive, bool isSideBySide, QWidget *parent)
: EventView(parent) : EventView(parent)
, d(new Private(this, isInteractive, isSideBySide)) , d(new Private(this, isInteractive, isSideBySide))
{ {
...@@ -732,7 +732,7 @@ AgendaView::AgendaView(const PrefsPtr &prefs, const QDate &start, const QDate &e ...@@ -732,7 +732,7 @@ AgendaView::AgendaView(const PrefsPtr &prefs, const QDate &start, const QDate &e
init(start, end); init(start, end);
} }
void AgendaView::init(const QDate &start, const QDate &end) void AgendaView::init(QDate start, QDate end)
{ {
d->mSelectedDates = Private::generateDateList(start, end); d->mSelectedDates = Private::generateDateList(start, end);
...@@ -2152,7 +2152,7 @@ void AgendaView::setHolidayMasks() ...@@ -2152,7 +2152,7 @@ void AgendaView::setHolidayMasks()
d->mHolidayMask.resize(d->mSelectedDates.count() + 1); d->mHolidayMask.resize(d->mSelectedDates.count() + 1);
const QList<QDate> workDays = CalendarSupport::workDays(d->mSelectedDates.first().addDays(-1), const QList<QDate> workDays = CalendarSupport::workDays(d->mSelectedDates.constFirst().addDays(-1),
d->mSelectedDates.last()); d->mSelectedDates.last());
for (int i = 0; i < d->mSelectedDates.count(); ++i) { for (int i = 0; i < d->mSelectedDates.count(); ++i) {
d->mHolidayMask[i] = !workDays.contains(d->mSelectedDates[ i ]); d->mHolidayMask[i] = !workDays.contains(d->mSelectedDates[ i ]);
......
...@@ -86,7 +86,7 @@ class EVENTVIEWS_EXPORT AgendaView : public EventView ...@@ -86,7 +86,7 @@ class EVENTVIEWS_EXPORT AgendaView : public EventView
public: public:
explicit AgendaView(const PrefsPtr &preferences, const QDate &start, const QDate &end, bool isInteractive, bool isSideBySide = false, QWidget *parent = nullptr); explicit AgendaView(const PrefsPtr &preferences, const QDate &start, const QDate &end, bool isInteractive, bool isSideBySide = false, QWidget *parent = nullptr);
explicit AgendaView(const QDate &start, const QDate &end, bool isInteractive, bool isSideBySide = false, QWidget *parent = nullptr); explicit AgendaView(QDate start, QDate end, bool isInteractive, bool isSideBySide = false, QWidget *parent = nullptr);
~AgendaView() override; ~AgendaView() override;
...@@ -240,7 +240,7 @@ private Q_SLOTS: ...@@ -240,7 +240,7 @@ private Q_SLOTS:
void slotDeleteIncidence(const KCalendarCore::Incidence::Ptr &incidence); void slotDeleteIncidence(const KCalendarCore::Incidence::Ptr &incidence);
private: private:
void init(const QDate &start, const QDate &end); void init(QDate start, QDate end);
bool filterByCollectionSelection(const KCalendarCore::Incidence::Ptr &incidence); bool filterByCollectionSelection(const KCalendarCore::Incidence::Ptr &incidence);
void setupTimeLabel(TimeLabels *timeLabel); void setupTimeLabel(TimeLabels *timeLabel);
bool displayIncidence(const KCalendarCore::Incidence::Ptr &incidence, bool createSelected); bool displayIncidence(const KCalendarCore::Incidence::Ptr &incidence, bool createSelected);
......
...@@ -88,7 +88,7 @@ TimeScaleConfigDialog::TimeScaleConfigDialog(const PrefsPtr &preferences, QWidge ...@@ -88,7 +88,7 @@ TimeScaleConfigDialog::TimeScaleConfigDialog(const PrefsPtr &preferences, QWidge
shownTimeZones += d->mPreferences->timeScaleTimezones(); shownTimeZones += d->mPreferences->timeScaleTimezones();
shownTimeZones.removeDuplicates(); shownTimeZones.removeDuplicates();
QList<TimeZoneNamePair> availList, selList; QVector<TimeZoneNamePair> availList, selList;
const auto zoneIds = QTimeZone::availableTimeZoneIds(); const auto zoneIds = QTimeZone::availableTimeZoneIds();
for (const auto &zoneId : qAsConst(zoneIds)) { for (const auto &zoneId : qAsConst(zoneIds)) {
// do not list timezones already shown // do not list timezones already shown
......
...@@ -487,8 +487,8 @@ void ListView::changeIncidenceDisplay(const Akonadi::Item &aitem, int action) ...@@ -487,8 +487,8 @@ void ListView::changeIncidenceDisplay(const Akonadi::Item &aitem, int action)
{ {
const Incidence::Ptr incidence = CalendarSupport::incidence(aitem); const Incidence::Ptr incidence = CalendarSupport::incidence(aitem);
ListViewItem *item = nullptr; ListViewItem *item = nullptr;
QDate f = d->mSelectedDates.first(); const QDate f = d->mSelectedDates.constFirst();
QDate l = d->mSelectedDates.last(); const QDate l = d->mSelectedDates.constLast();
QDate date; QDate date;
if (CalendarSupport::hasTodo(aitem)) { if (CalendarSupport::hasTodo(aitem)) {
......
...@@ -330,7 +330,7 @@ void MonthGraphicsItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWi ...@@ -330,7 +330,7 @@ void MonthGraphicsItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWi
} }
} }
void MonthGraphicsItem::setStartDate(const QDate &date) void MonthGraphicsItem::setStartDate(QDate date)
{ {
mStartDate = date; mStartDate = date;
} }
......
...@@ -169,7 +169,7 @@ public: ...@@ -169,7 +169,7 @@ public:
*/ */
QDate endDate() const; QDate endDate() const;
void setStartDate(const QDate &d); void setStartDate(QDate d);
void setDaySpan(int span); void setDaySpan(int span);
/** /**
......
...@@ -81,7 +81,7 @@ MonthCell *MonthScene::previousCell() const ...@@ -81,7 +81,7 @@ MonthCell *MonthScene::previousCell() const
return mPreviousCell; return mPreviousCell;
} }
int MonthScene::getRightSpan(const QDate &date) const int MonthScene::getRightSpan(QDate date) const
{ {
MonthCell *cell = mMonthCellMap.value(date); MonthCell *cell = mMonthCellMap.value(date);
if (!cell) { if (!cell) {
...@@ -91,7 +91,7 @@ int MonthScene::getRightSpan(const QDate &date) const ...@@ -91,7 +91,7 @@ int MonthScene::getRightSpan(const QDate &date) const
return 7 - cell->x() - 1; return 7 - cell->x() - 1;
} }
int MonthScene::getLeftSpan(const QDate &date) const int MonthScene::getLeftSpan(QDate date) const
{ {
MonthCell *cell = mMonthCellMap.value(date); MonthCell *cell = mMonthCellMap.value(date);
if (!cell) { if (!cell) {
......
...@@ -118,12 +118,12 @@ public: ...@@ -118,12 +118,12 @@ public:
/** /**
Get the space on the right of the cell associated to the date @p date. Get the space on the right of the cell associated to the date @p date.
*/ */
Q_REQUIRED_RESULT int getRightSpan(const QDate &date) const; Q_REQUIRED_RESULT int getRightSpan(QDate date) const;
/** /**
Get the space on the left of the cell associated to the date @p date. Get the space on the left of the cell associated to the date @p date.
*/ */
Q_REQUIRED_RESULT int getLeftSpan(const QDate &date) const; Q_REQUIRED_RESULT int getLeftSpan(QDate date) const;
/** /**
Returns the date in the first column of the row given by @p row. Returns the date in the first column of the row given by @p row.
......
...@@ -653,8 +653,8 @@ void MultiAgendaView::setChanges(Changes changes) ...@@ -653,8 +653,8 @@ void MultiAgendaView::setChanges(Changes changes)
void MultiAgendaView::setupScrollBar() void MultiAgendaView::setupScrollBar()
{ {
if (!d->mAgendaViews.isEmpty() && d->mAgendaViews.first()->agenda()) { if (!d->mAgendaViews.isEmpty() && d->mAgendaViews.constFirst()->agenda()) {
QScrollBar *scrollBar = d->mAgendaViews.first()->agenda()->verticalScrollBar(); QScrollBar *scrollBar = d->mAgendaViews.constFirst()->agenda()->verticalScrollBar();
d->mScrollBar->setMinimum(scrollBar->minimum()); d->mScrollBar->setMinimum(scrollBar->minimum());
d->mScrollBar->setMaximum(scrollBar->maximum()); d->mScrollBar->setMaximum(scrollBar->maximum());
d->mScrollBar->setSingleStep(scrollBar->singleStep()); d->mScrollBar->setSingleStep(scrollBar->singleStep());
......
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