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

Fix clazy warning

parent 10884a8b
Pipeline #65014 passed with stage
in 8 minutes and 13 seconds
......@@ -782,7 +782,7 @@ bool Agenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
return true;
}
bool Agenda::ptInSelection(const QPoint &gpos) const
bool Agenda::ptInSelection(QPoint gpos) const
{
if (!d->mHasSelection) {
return false;
......@@ -796,7 +796,7 @@ bool Agenda::ptInSelection(const QPoint &gpos) const
return true;
}
void Agenda::startSelectAction(const QPoint &viewportPos)
void Agenda::startSelectAction(QPoint viewportPos)
{
Q_EMIT newStartSelectSignal();
......@@ -816,7 +816,7 @@ void Agenda::startSelectAction(const QPoint &viewportPos)
// updateContents();
}
void Agenda::performSelectAction(const QPoint &pos)
void Agenda::performSelectAction(QPoint pos)
{
const QPoint gpos = contentsToGrid(pos);
......@@ -861,7 +861,7 @@ void Agenda::endSelectAction(const QPoint &currentPos)
}
}
Agenda::MouseActionType Agenda::isInResizeArea(bool horizontal, const QPoint &pos, const AgendaItem::QPtr &item)
Agenda::MouseActionType Agenda::isInResizeArea(bool horizontal, QPoint pos, const AgendaItem::QPtr &item)
{
if (!item) {
return NOP;
......@@ -923,7 +923,7 @@ void Agenda::startItemAction(const QPoint &pos)
setActionCursor(d->mActionType, true);
}
void Agenda::performItemAction(const QPoint &pos)
void Agenda::performItemAction(QPoint pos)
{
QPoint gpos = contentsToGrid(pos);
......@@ -1310,7 +1310,7 @@ void Agenda::setActionCursor(int actionType, bool acting)
#endif
}
void Agenda::setNoActionCursor(const AgendaItem::QPtr &moveItem, const QPoint &pos)
void Agenda::setNoActionCursor(const AgendaItem::QPtr &moveItem, QPoint pos)
{
const KCalendarCore::Incidence::Ptr item = moveItem ? moveItem->incidence() : KCalendarCore::Incidence::Ptr();
......@@ -1645,7 +1645,7 @@ void Agenda::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
/*
Convert srcollview contents coordinates to agenda grid coordinates.
*/
QPoint Agenda::contentsToGrid(const QPoint &pos) const
QPoint Agenda::contentsToGrid(QPoint pos) const
{
int gx = int(QApplication::isRightToLeft() ? d->mColumns - pos.x() / d->mGridSpacingX : pos.x() / d->mGridSpacingX);
int gy = int(pos.y() / d->mGridSpacingY);
......@@ -1655,7 +1655,7 @@ QPoint Agenda::contentsToGrid(const QPoint &pos) const
/*
Convert agenda grid coordinates to scrollview contents coordinates.
*/
QPoint Agenda::gridToContents(const QPoint &gpos) const
QPoint Agenda::gridToContents(QPoint gpos) const
{
int x = int(QApplication::isRightToLeft() ? (d->mColumns - gpos.x()) * d->mGridSpacingX : gpos.x() * d->mGridSpacingX);
int y = int(gpos.y() * d->mGridSpacingY);
......@@ -1666,7 +1666,7 @@ QPoint Agenda::gridToContents(const QPoint &gpos) const
Return Y coordinate corresponding to time. Coordinates are rounded to
fit into the grid.
*/
int Agenda::timeToY(const QTime &time) const
int Agenda::timeToY(QTime time) const
{
int minutesPerCell = 24 * 60 / d->mRows;
int timeMinutes = time.hour() * 60 + time.minute();
......
......@@ -93,10 +93,10 @@ public:
void paintEvent(QPaintEvent *) override;
Q_REQUIRED_RESULT QPoint contentsToGrid(const QPoint &pos) const;
Q_REQUIRED_RESULT QPoint gridToContents(const QPoint &gpos) const;
Q_REQUIRED_RESULT QPoint contentsToGrid(QPoint pos) const;
Q_REQUIRED_RESULT QPoint gridToContents(QPoint gpos) const;
Q_REQUIRED_RESULT int timeToY(const QTime &time) const;
Q_REQUIRED_RESULT int timeToY(QTime time) const;
Q_REQUIRED_RESULT QTime gyToTime(int y) const;
Q_REQUIRED_RESULT QVector<int> minContentsY() const;
......@@ -252,16 +252,16 @@ protected:
@param pos The current mouse position
@param item The affected item
*/
MouseActionType isInResizeArea(bool horizontal, const QPoint &pos, const AgendaItem::QPtr &item);
MouseActionType isInResizeArea(bool horizontal, QPoint pos, const AgendaItem::QPtr &item);
/** Return whether the cell specified by the grid point belongs to the current select
*/
bool ptInSelection(const QPoint &gpos) const;
bool ptInSelection(QPoint gpos) const;
/** Start selecting time span. */
void startSelectAction(const QPoint &viewportPos);
void startSelectAction(QPoint viewportPos);
/** Select time span. */
void performSelectAction(const QPoint &viewportPos);
void performSelectAction(QPoint viewportPos);
/** Emd selecting time span. */
void endSelectAction(const QPoint &viewportPos);
......@@ -270,13 +270,13 @@ protected:
void startItemAction(const QPoint &viewportPos);
/** Move/resize agenda item */
void performItemAction(const QPoint &viewportPos);
void performItemAction(QPoint viewportPos);
/** End moving/resizing agenda item */
void endItemAction();
/** Set cursor, when no item action is in progress */
void setNoActionCursor(const AgendaItem::QPtr &moveItem, const QPoint &viewportPos);
void setNoActionCursor(const AgendaItem::QPtr &moveItem, QPoint viewportPos);
/** Sets the cursor according to the given action type.
@param actionType The type of action for which the cursor should be set.
@param acting If true, the corresponding action is running (e.g. the
......
......@@ -1023,7 +1023,7 @@ void AgendaItem::paintEvent(QPaintEvent *ev)
}
}
void AgendaItem::drawRoundedRect(QPainter *p, const QRect &rect, bool selected, const QColor &bgColor, bool frame, int ft, bool roundTop, bool roundBottom)
void AgendaItem::drawRoundedRect(QPainter *p, QRect rect, bool selected, const QColor &bgColor, bool frame, int ft, bool roundTop, bool roundBottom)
{
Q_UNUSED(ft)
if (!mValid) {
......
......@@ -267,7 +267,7 @@ private:
// paint all visible icons
void paintIcons(QPainter *p, int &x, int y, int ft);
void drawRoundedRect(QPainter *p, const QRect &rect, bool selected, const QColor &bgcolor, bool frame, int ft, bool roundTop, bool roundBottom);
void drawRoundedRect(QPainter *p, QRect rect, bool selected, const QColor &bgcolor, bool frame, int ft, bool roundTop, bool roundBottom);
Q_REQUIRED_RESULT QColor getCategoryColor() const;
Q_REQUIRED_RESULT QColor getFrameColor(const QColor &resourceColor, const QColor &categoryColor) const;
......
......@@ -247,7 +247,7 @@ public:
Returns a list of consecutive dates, starting with @p start and ending
with @p end. If either start or end are invalid, a list with
QDate::currentDate() is returned */
static QList<QDate> generateDateList(const QDate &start, const QDate &end);
static QList<QDate> generateDateList(QDate start, QDate end);
void changeColumns(int numColumns);
......@@ -360,7 +360,7 @@ void AgendaView::Private::changeColumns(int numColumns)
}
/** static */
QList<QDate> AgendaView::Private::generateDateList(const QDate &start, const QDate &end)
QList<QDate> AgendaView::Private::generateDateList(QDate start, QDate end)
{
QList<QDate> list;
......@@ -696,7 +696,7 @@ AgendaView::AgendaView(QDate start, QDate end, bool isInteractive, bool isSideBy
init(start, end);
}
AgendaView::AgendaView(const PrefsPtr &prefs, const QDate &start, const QDate &end, bool isInteractive, bool isSideBySide, QWidget *parent)
AgendaView::AgendaView(const PrefsPtr &prefs, QDate start, QDate end, bool isInteractive, bool isSideBySide, QWidget *parent)
: EventView(parent)
, d(new Private(this, isInteractive, isSideBySide))
{
......@@ -896,7 +896,7 @@ void AgendaView::connectAgenda(Agenda *agenda, Agenda *otherAgenda)
QOverload<const QList<QUrl> &, const QPoint &, bool>::of(&AgendaView::slotIncidencesDropped));
}
void AgendaView::slotIncidenceSelected(const KCalendarCore::Incidence::Ptr &incidence, const QDate &date)
void AgendaView::slotIncidenceSelected(const KCalendarCore::Incidence::Ptr &incidence, QDate date)
{
Akonadi::Item item = d->mViewCalendar->item(incidence);
if (item.isValid()) {
......@@ -904,7 +904,7 @@ void AgendaView::slotIncidenceSelected(const KCalendarCore::Incidence::Ptr &inci
}
}
void AgendaView::slotShowIncidencePopup(const KCalendarCore::Incidence::Ptr &incidence, const QDate &date)
void AgendaView::slotShowIncidencePopup(const KCalendarCore::Incidence::Ptr &incidence, QDate date)
{
Akonadi::Item item = d->mViewCalendar->item(incidence);
// qDebug() << "wanna see the popup for " << incidence->uid() << item.id();
......@@ -965,7 +965,7 @@ void AgendaView::zoomOutVertically()
}
}
void AgendaView::zoomInHorizontally(const QDate &date)
void AgendaView::zoomInHorizontally(QDate date)
{
QDate begin;
QDate newBegin;
......@@ -973,7 +973,7 @@ void AgendaView::zoomInHorizontally(const QDate &date)
int ndays, count;
begin = d->mSelectedDates.first();
ndays = begin.daysTo(d->mSelectedDates.last());
ndays = begin.daysTo(d->mSelectedDates.constLast());
// zoom with Action and are there a selected Incidence?, Yes, I zoom in to it.
if (!dateToZoom.isValid()) {
......@@ -998,7 +998,7 @@ void AgendaView::zoomInHorizontally(const QDate &date)
}
}
void AgendaView::zoomOutHorizontally(const QDate &date)
void AgendaView::zoomOutHorizontally(QDate date)
{
QDate begin;
QDate newBegin;
......@@ -1006,7 +1006,7 @@ void AgendaView::zoomOutHorizontally(const QDate &date)
int ndays, count;
begin = d->mSelectedDates.first();
ndays = begin.daysTo(d->mSelectedDates.last());
ndays = begin.daysTo(d->mSelectedDates.constLast());
// zoom with Action and are there a selected Incidence?, Yes, I zoom out to it.
if (!dateToZoom.isValid()) {
......@@ -1029,7 +1029,7 @@ void AgendaView::zoomOutHorizontally(const QDate &date)
}
}
void AgendaView::zoomView(const int delta, const QPoint &pos, const Qt::Orientation orient)
void AgendaView::zoomView(const int delta, QPoint pos, const Qt::Orientation orient)
{
// TODO find out why this is necessary. seems to be some kind of performance hack
static QDate zoomDate;
......@@ -1097,7 +1097,7 @@ void AgendaView::placeDecorationsFrame(QFrame *frame, bool decorationsFound, boo
}
}
void AgendaView::placeDecorations(DecorationList &decoList, const QDate &date, QWidget *labelBox, bool forWeek)
void AgendaView::placeDecorations(DecorationList &decoList, QDate date, QWidget *labelBox, bool forWeek)
{
for (CalendarDecoration::Decoration *deco : qAsConst(decoList)) {
const CalendarDecoration::Element::List elements = forWeek ? deco->weekElements(date) : deco->dayElements(date);
......@@ -1936,7 +1936,7 @@ void AgendaView::slotIncidencesDropped(const QList<QUrl> &items, const QPoint &g
#endif
}
static void setDateTime(KCalendarCore::Incidence::Ptr incidence, QDateTime dt, bool allDay)
static void setDateTime(KCalendarCore::Incidence::Ptr incidence, const QDateTime &dt, bool allDay)
{
incidence->setAllDay(allDay);
......
......@@ -66,12 +66,7 @@ class EVENTVIEWS_EXPORT AgendaView : public EventView
{
Q_OBJECT
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, QDate start, QDate end, bool isInteractive, bool isSideBySide = false, QWidget *parent = nullptr);
explicit AgendaView(QDate start, QDate end, bool isInteractive, bool isSideBySide = false, QWidget *parent = nullptr);
......@@ -151,13 +146,13 @@ public:
void enableAgendaUpdate(bool enable);
void setIncidenceChanger(Akonadi::IncidenceChanger *changer) override;
void zoomInHorizontally(const QDate &date = QDate());
void zoomOutHorizontally(const QDate &date = QDate());
void zoomInHorizontally(QDate date = QDate());
void zoomOutHorizontally(QDate date = QDate());
void zoomInVertically();
void zoomOutVertically();
void zoomView(const int delta, const QPoint &pos, const Qt::Orientation orient = Qt::Horizontal);
void zoomView(const int delta, QPoint pos, const Qt::Orientation orient = Qt::Horizontal);
void clearTimeSpanSelection();
......@@ -220,8 +215,8 @@ protected Q_SLOTS:
void alignAgendas();
private Q_SLOTS:
void slotIncidenceSelected(const KCalendarCore::Incidence::Ptr &incidence, const QDate &date);
void slotShowIncidencePopup(const KCalendarCore::Incidence::Ptr &incidence, const QDate &date);
void slotIncidenceSelected(const KCalendarCore::Incidence::Ptr &incidence, QDate date);
void slotShowIncidencePopup(const KCalendarCore::Incidence::Ptr &incidence, QDate date);
void slotEditIncidence(const KCalendarCore::Incidence::Ptr &incidence);
void slotShowIncidence(const KCalendarCore::Incidence::Ptr &incidence);
void slotDeleteIncidence(const KCalendarCore::Incidence::Ptr &incidence);
......@@ -236,7 +231,7 @@ private:
using DecorationList = QList<EventViews::CalendarDecoration::Decoration *>;
bool loadDecorations(const QStringList &decorations, DecorationList &decoList);
void placeDecorationsFrame(QFrame *frame, bool decorationsFound, bool isTop);
void placeDecorations(EventViews::AgendaView::DecorationList &decoList, const QDate &date, QWidget *labelBox, bool forWeek);
void placeDecorations(EventViews::AgendaView::DecorationList &decoList, QDate date, QWidget *labelBox, bool forWeek);
#endif
friend class TimeLabelsZone;
......
......@@ -259,18 +259,18 @@ Element::List Decoration::createYearElements(const QDate &)
return Element::List();
}
QDate Decoration::weekDate(const QDate &date)
QDate Decoration::weekDate(QDate date)
{
QDate result = date;
return result.addDays(date.dayOfWeek() - 1);
}
QDate Decoration::monthDate(const QDate &date)
QDate Decoration::monthDate(QDate date)
{
return {date.year(), date.month(), 1};
}
QDate Decoration::yearDate(const QDate &date)
QDate Decoration::yearDate(QDate date)
{
return {date.year(), 1, 1};
}
......@@ -223,17 +223,17 @@ protected:
/**
Map all dates of the same week to a single date.
*/
QDate weekDate(const QDate &date);
QDate weekDate(QDate date);
/**
Map all dates of the same month to a single date.
*/
QDate monthDate(const QDate &date);
QDate monthDate(QDate date);
/**
Map all dates of the same year to a single date.
*/
QDate yearDate(const QDate &date);
QDate yearDate(QDate date);
private:
QMap<QDate, Element::List> mDayElements;
......
......@@ -48,7 +48,7 @@ TimeLabels::TimeLabels(const QTimeZone &zone, int rows, TimeLabelsZone *parent,
updateConfig();
}
void TimeLabels::mousePosChanged(const QPoint &pos)
void TimeLabels::mousePosChanged(QPoint pos)
{
colorMousePos();
mMousePos->move(0, pos.y());
......
......@@ -65,7 +65,7 @@ private:
Q_REQUIRED_RESULT QString cellToSuffix(const int cell) const;
/** update the position of the marker showing the mouse position */
void mousePosChanged(const QPoint &pos);
void mousePosChanged(QPoint pos);
void showMousePos();
void hideMousePos();
......
......@@ -105,7 +105,7 @@ void EventView::setHolidayRegions(const QStringList &regions)
}
}
int EventView::showMoveRecurDialog(const Incidence::Ptr &inc, const QDate &date)
int EventView::showMoveRecurDialog(const Incidence::Ptr &inc, QDate date)
{
QDateTime dateTime(date, {}, Qt::LocalTime);
......
......@@ -249,7 +249,7 @@ public:
Q_REQUIRED_RESULT QDateTime actualStartDateTime() const;
Q_REQUIRED_RESULT QDateTime actualEndDateTime() const;
Q_REQUIRED_RESULT int showMoveRecurDialog(const KCalendarCore::Incidence::Ptr &incidence, const QDate &date);
Q_REQUIRED_RESULT int showMoveRecurDialog(const KCalendarCore::Incidence::Ptr &incidence, QDate date);
/**
Handles key events, opens the new event dialog when enter is pressed, activates type ahead.
......
......@@ -81,7 +81,7 @@ QColor EventViews::resourceColor(const Akonadi::Item &item, const PrefsPtr &pref
return resourceColor(item.parentCollection(), preferences);
}
int EventViews::yearDiff(const QDate &start, const QDate &end)
int EventViews::yearDiff(QDate start, QDate end)
{
return end.year() - start.year();
}
......
......@@ -74,7 +74,7 @@ EVENTVIEWS_EXPORT void setResourceColor(const Akonadi::Collection &collection, c
Returns the number of years between the @p start QDate and the @p end QDate
(i.e. the difference in the year number of both dates)
*/
Q_REQUIRED_RESULT int yearDiff(const QDate &start, const QDate &end);
Q_REQUIRED_RESULT int yearDiff(QDate start, QDate end);
/**
Equivalent to SmallIcon( name ), but uses QPixmapCache.
......
......@@ -42,7 +42,7 @@ JournalDateView::~JournalDateView()
{
}
void JournalDateView::setDate(const QDate &date)
void JournalDateView::setDate(QDate date)
{
mDate = date;
Q_EMIT setDateSignal(date);
......@@ -241,7 +241,7 @@ void JournalFrame::setCalendar(const Akonadi::ETMCalendar::Ptr &calendar)
mCalendar = calendar;
}
void JournalFrame::setDate(const QDate &date)
void JournalFrame::setDate(QDate date)
{
mDate = date;
}
......
......@@ -61,7 +61,7 @@ public Q_SLOTS:
mChanger = changer;
}
void setDate(const QDate &date);
void setDate(QDate date);
Q_SIGNALS:
void printJournal(const KCalendarCore::Journal::Ptr &, bool preview);
......@@ -97,7 +97,7 @@ public:
void addJournal(const Akonadi::Item &journal);
Akonadi::Item::List journals() const;
void setDate(const QDate &date);
void setDate(QDate date);
QDate date() const
{
return mDate;
......
......@@ -42,7 +42,7 @@ JournalView::~JournalView()
{
}
void JournalView::appendJournal(const Akonadi::Item &journal, const QDate &dt)
void JournalView::appendJournal(const Akonadi::Item &journal, QDate dt)
{
JournalDateView *entry = nullptr;
if (mEntries.contains(dt)) {
......
......@@ -39,7 +39,7 @@ public:
return KCalendarCore::DateList();
}
void appendJournal(const Akonadi::Item &journal, const QDate &dt);
void appendJournal(const Akonadi::Item &journal, QDate dt);
/** documentation in baseview.h */
void getHighlightMode(bool &highlightEvents, bool &highlightTodos, bool &highlightJournals);
......
......@@ -103,9 +103,9 @@ public:
{
}
void addIncidences(const Akonadi::ETMCalendar::Ptr &calendar, const KCalendarCore::Incidence::List &incidenceList, const QDate &date);
void addIncidence(const Akonadi::ETMCalendar::Ptr &calendar, const KCalendarCore::Incidence::Ptr &, const QDate &date);
void addIncidence(const Akonadi::ETMCalendar::Ptr &calendar, const Akonadi::Item &, const QDate &date);
void addIncidences(const Akonadi::ETMCalendar::Ptr &calendar, const KCalendarCore::Incidence::List &incidenceList, QDate date);
void addIncidence(const Akonadi::ETMCalendar::Ptr &calendar, const KCalendarCore::Incidence::Ptr &, QDate date);
void addIncidence(const Akonadi::ETMCalendar::Ptr &calendar, const Akonadi::Item &, QDate date);
ListViewItem *getItemForIncidence(const Akonadi::Item &);
QTreeWidget *mTreeWidget = nullptr;
......@@ -375,14 +375,14 @@ void ListView::showAll()
d->addIncidences(calendar(), calendar()->incidences(), QDate());
}
void ListView::Private::addIncidences(const Akonadi::ETMCalendar::Ptr &calendar, const KCalendarCore::Incidence::List &incidences, const QDate &date)
void ListView::Private::addIncidences(const Akonadi::ETMCalendar::Ptr &calendar, const KCalendarCore::Incidence::List &incidences, QDate date)
{
for (const KCalendarCore::Incidence::Ptr &incidence : incidences) {
addIncidence(calendar, incidence, date);
}
}
void ListView::Private::addIncidence(const Akonadi::ETMCalendar::Ptr &calendar, const Akonadi::Item &item, const QDate &date)
void ListView::Private::addIncidence(const Akonadi::ETMCalendar::Ptr &calendar, const Akonadi::Item &item, QDate date)
{
Q_ASSERT(calendar);
if (item.isValid() && item.hasPayload<KCalendarCore::Incidence::Ptr>()) {
......@@ -390,7 +390,7 @@ void ListView::Private::addIncidence(const Akonadi::ETMCalendar::Ptr &calendar,
}
}
void ListView::Private::addIncidence(const Akonadi::ETMCalendar::Ptr &calendar, const KCalendarCore::Incidence::Ptr &incidence, const QDate &date)
void ListView::Private::addIncidence(const Akonadi::ETMCalendar::Ptr &calendar, const KCalendarCore::Incidence::Ptr &incidence, QDate date)
{
if (!incidence) {
return;
......
......@@ -55,7 +55,7 @@ void ScrollIndicator::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
}
//-------------------------------------------------------------
MonthCell::MonthCell(int id, const QDate &date, QGraphicsScene *scene)
MonthCell::MonthCell(int id, QDate date, QGraphicsScene *scene)
: mId(id)
, mDate(date)
, mScene(scene)
......
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