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
public:
Private(EventIndicator *parent, EventIndicator::Location loc)
: q(parent)
, mColumns(1)
: mColumns(1)
, mLocation(loc)
, q(parent)
{
mEnabled.resize(mColumns);
......@@ -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)
, d(new Private(this, isInteractive, isSideBySide))
{
......@@ -732,7 +732,7 @@ AgendaView::AgendaView(const PrefsPtr &prefs, const QDate &start, const QDate &e
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);
......@@ -2152,7 +2152,7 @@ void AgendaView::setHolidayMasks()
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());
for (int i = 0; i < d->mSelectedDates.count(); ++i) {
d->mHolidayMask[i] = !workDays.contains(d->mSelectedDates[ i ]);
......
......@@ -86,7 +86,7 @@ class EVENTVIEWS_EXPORT AgendaView : public EventView
public:
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;
......@@ -240,7 +240,7 @@ private Q_SLOTS:
void slotDeleteIncidence(const KCalendarCore::Incidence::Ptr &incidence);
private:
void init(const QDate &start, const QDate &end);
void init(QDate start, QDate end);
bool filterByCollectionSelection(const KCalendarCore::Incidence::Ptr &incidence);
void setupTimeLabel(TimeLabels *timeLabel);
bool displayIncidence(const KCalendarCore::Incidence::Ptr &incidence, bool createSelected);
......
......@@ -88,7 +88,7 @@ TimeScaleConfigDialog::TimeScaleConfigDialog(const PrefsPtr &preferences, QWidge
shownTimeZones += d->mPreferences->timeScaleTimezones();
shownTimeZones.removeDuplicates();
QList<TimeZoneNamePair> availList, selList;
QVector<TimeZoneNamePair> availList, selList;
const auto zoneIds = QTimeZone::availableTimeZoneIds();
for (const auto &zoneId : qAsConst(zoneIds)) {
// do not list timezones already shown
......
......@@ -487,8 +487,8 @@ void ListView::changeIncidenceDisplay(const Akonadi::Item &aitem, int action)
{
const Incidence::Ptr incidence = CalendarSupport::incidence(aitem);
ListViewItem *item = nullptr;
QDate f = d->mSelectedDates.first();
QDate l = d->mSelectedDates.last();
const QDate f = d->mSelectedDates.constFirst();
const QDate l = d->mSelectedDates.constLast();
QDate date;
if (CalendarSupport::hasTodo(aitem)) {
......
......@@ -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;
}
......
......@@ -169,7 +169,7 @@ public:
*/
QDate endDate() const;
void setStartDate(const QDate &d);
void setStartDate(QDate d);
void setDaySpan(int span);
/**
......
......@@ -81,7 +81,7 @@ MonthCell *MonthScene::previousCell() const
return mPreviousCell;
}
int MonthScene::getRightSpan(const QDate &date) const
int MonthScene::getRightSpan(QDate date) const
{
MonthCell *cell = mMonthCellMap.value(date);
if (!cell) {
......@@ -91,7 +91,7 @@ int MonthScene::getRightSpan(const QDate &date) const
return 7 - cell->x() - 1;
}
int MonthScene::getLeftSpan(const QDate &date) const
int MonthScene::getLeftSpan(QDate date) const
{
MonthCell *cell = mMonthCellMap.value(date);
if (!cell) {
......
......@@ -118,12 +118,12 @@ public:
/**
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.
*/
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.
......
......@@ -653,8 +653,8 @@ void MultiAgendaView::setChanges(Changes changes)
void MultiAgendaView::setupScrollBar()
{
if (!d->mAgendaViews.isEmpty() && d->mAgendaViews.first()->agenda()) {
QScrollBar *scrollBar = d->mAgendaViews.first()->agenda()->verticalScrollBar();
if (!d->mAgendaViews.isEmpty() && d->mAgendaViews.constFirst()->agenda()) {
QScrollBar *scrollBar = d->mAgendaViews.constFirst()->agenda()->verticalScrollBar();
d->mScrollBar->setMinimum(scrollBar->minimum());
d->mScrollBar->setMaximum(scrollBar->maximum());
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