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

Fix clazy warning

parent 666ce664
Pipeline #27374 passed with stage
in 37 minutes and 59 seconds
......@@ -1435,7 +1435,7 @@ protected:
QAction *mDelete = nullptr;
};
void ActionManager::processIncidenceSelection(const Akonadi::Item &item, const QDate &date)
void ActionManager::processIncidenceSelection(const Akonadi::Item &item, QDate date)
{
//qCDebug(KORGANIZER_LOG) << "ActionManager::processIncidenceSelection()";
Q_UNUSED(date);
......@@ -1669,12 +1669,12 @@ void ActionManager::openTodoEditor(const QString &summary, const QString &descri
action != KOPrefs::TodoAttachLink);
}
void ActionManager::openJournalEditor(const QDate &date)
void ActionManager::openJournalEditor(QDate date)
{
mCalendarView->newJournal(date);
}
void ActionManager::openJournalEditor(const QString &text, const QDate &date)
void ActionManager::openJournalEditor(const QString &text, QDate date)
{
mCalendarView->newJournal(text, date);
}
......@@ -1699,17 +1699,17 @@ void ActionManager::showEventView()
mCalendarView->viewManager()->showEventView();
}
void ActionManager::goDate(const QDate &date)
void ActionManager::goDate(QDate date)
{
mCalendarView->goDate(date);
}
void ActionManager::goDate(const QString &date)
void ActionManager::goDate(QString date)
{
goDate(QLocale().toDate(date));
}
void ActionManager::showDate(const QDate &date)
void ActionManager::showDate(QDate date)
{
mCalendarView->showDate(date);
}
......
......@@ -158,17 +158,17 @@ public Q_SLOTS:
void openTodoEditor(const QString &summary, const QString &description, const QString &uri, const QString &file, const QStringList &attendees, const QString &attachmentMimetype);
void openTodoEditor(const QString &summary, const QString &description, const QStringList &attachmentUris, const QStringList &attendees, const QStringList &attachmentMimetypes, bool attachmentIsInline);
void openJournalEditor(const QDate &date);
void openJournalEditor(const QString &text, const QDate &date);
void openJournalEditor(QDate date);
void openJournalEditor(const QString &text, QDate date);
void openJournalEditor(const QString &text);
void showJournalView();
void showTodoView();
void showEventView();
void goDate(const QDate &);
void goDate(const QString &);
void showDate(const QDate &date);
void goDate(QDate);
void goDate(QString);
void showDate(QDate date);
public:
QString localFileName();
......@@ -195,7 +195,7 @@ public Q_SLOTS:
*/
void updateConfig();
void processIncidenceSelection(const Akonadi::Item &item, const QDate &date);
void processIncidenceSelection(const Akonadi::Item &item, QDate date);
void keyBindings();
/**
......
......@@ -258,7 +258,7 @@ CalendarView::CalendarView(QWidget *parent)
mDateNavigator, &DateNavigator::selectNext);
connect(mDateNavigatorContainer, &DateNavigatorContainer::datesSelected,
mDateNavigator, QOverload<const KCalendarCore::DateList &, const QDate &>::of(&DateNavigator::selectDates));
mDateNavigator, QOverload<const KCalendarCore::DateList &, QDate >::of(&DateNavigator::selectDates));
connect(mViewManager, &KOViewManager::datesSelected,
mDateNavigator, [this](const KCalendarCore::DateList &dates) {
......@@ -552,12 +552,12 @@ void CalendarView::writeFilterSettings(KConfig *config)
}
}
void CalendarView::goDate(const QDate &date)
void CalendarView::goDate(QDate date)
{
mDateNavigator->selectDate(date);
}
void CalendarView::showDate(const QDate &date)
void CalendarView::showDate(QDate date)
{
int dateCount = mDateNavigator->datesCount();
if (dateCount == 7) {
......@@ -1175,7 +1175,7 @@ void CalendarView::newJournal(const Akonadi::Collection &collection)
dialog->load(item);
}
void CalendarView::newJournal(const QString &text, const QDate &date)
void CalendarView::newJournal(const QString &text, QDate date)
{
IncidenceEditorNG::IncidenceDefaults defaults
= IncidenceEditorNG::IncidenceDefaults::minimalIncidenceDefaults();
......@@ -1586,7 +1586,7 @@ void CalendarView::moveIncidenceToResource(const Akonadi::Item &item, const Akon
#endif
}
void CalendarView::dissociateOccurrences(const Akonadi::Item &item, const QDate &date)
void CalendarView::dissociateOccurrences(const Akonadi::Item &item, QDate date)
{
const KCalendarCore::Incidence::Ptr incidence = CalendarSupport::incidence(item);
......@@ -2534,7 +2534,7 @@ void CalendarView::addIncidenceOn(const Akonadi::Item &itemadd, const QDate &dt)
mChanger->createIncidence(incidence, Akonadi::Collection(), this);
}
void CalendarView::moveIncidenceTo(const Akonadi::Item &itemmove, const QDate &dt)
void CalendarView::moveIncidenceTo(const Akonadi::Item &itemmove, QDate dt)
{
if (!CalendarSupport::hasIncidence(itemmove)) {
KMessageBox::sorry(
......
......@@ -397,7 +397,7 @@ public Q_SLOTS:
void newJournal();
void newJournal(const QDate &date);
void newJournal(const QString &text, const QDate &date = QDate());
void newJournal(const QString &text, QDate date = QDate());
void newJournal(const Akonadi::Collection &collection);
void configureCurrentView();
......@@ -406,7 +406,7 @@ public Q_SLOTS:
void toggleTodoCompleted(const Akonadi::Item &incidence);
void copyIncidenceToResource(const Akonadi::Item &incidence, const Akonadi::Collection &col);
void moveIncidenceToResource(const Akonadi::Item &incidence, const Akonadi::Collection &col);
void dissociateOccurrences(const Akonadi::Item &incidence, const QDate &date);
void dissociateOccurrences(const Akonadi::Item &incidence, QDate date);
/**
Check if clipboard contains vCalendar event. The signal pasteEnabled() is
......@@ -541,10 +541,10 @@ public Q_SLOTS:
void showEventViewer(bool);
/** Move the current view date to the specified date */
void goDate(const QDate &date);
void goDate(QDate date);
/** Show the given date without changing date selection length. */
void showDate(const QDate &date);
void showDate(QDate date);
/** Move the current view date to today */
void goToday();
......@@ -574,7 +574,7 @@ public Q_SLOTS:
void showErrorMessage(const QString &);
void schedule(KCalendarCore::iTIPMethod, const Akonadi::Item &incidence);
void addIncidenceOn(const Akonadi::Item &incidence, const QDate &);
void moveIncidenceTo(const Akonadi::Item &incidence, const QDate &);
void moveIncidenceTo(const Akonadi::Item &incidence, QDate);
void filterActivated(int filterNum);
void resourcesChanged();
......
......@@ -50,7 +50,7 @@ int DateNavigator::datesCount() const
return mSelectedDates.count();
}
void DateNavigator::selectDates(const KCalendarCore::DateList &dateList, const QDate &preferredMonth)
void DateNavigator::selectDates(const KCalendarCore::DateList &dateList, QDate preferredMonth)
{
if (!dateList.isEmpty()) {
mSelectedDates = dateList;
......@@ -58,16 +58,14 @@ void DateNavigator::selectDates(const KCalendarCore::DateList &dateList, const Q
}
}
void DateNavigator::selectDate(const QDate &date)
void DateNavigator::selectDate(QDate date)
{
QDate d = date;
if (!d.isValid()) {
if (!date.isValid()) {
qCDebug(KORGANIZER_LOG) << "an invalid date was passed as a parameter!";
d = QDate::currentDate();
date = QDate::currentDate();
}
mSelectedDates.clear();
mSelectedDates.append(d);
mSelectedDates.append(date);
emitSelected();
}
......@@ -91,7 +89,7 @@ void DateNavigator::selectDates(const QDate &d, int count, const QDate &preferre
emitSelected(preferredMonth);
}
void DateNavigator::selectWeekByDay(int weekDay, const QDate &d, const QDate &preferredMonth)
void DateNavigator::selectWeekByDay(int weekDay, QDate d, QDate preferredMonth)
{
int dateCount = mSelectedDates.count();
bool weekStart = (weekDay == KOGlobals::self()->firstDayOfWeek());
......@@ -126,7 +124,7 @@ void DateNavigator::selectWorkWeek()
selectWorkWeek(mSelectedDates.first());
}
void DateNavigator::selectWorkWeek(const QDate &d)
void DateNavigator::selectWorkWeek(QDate d)
{
const int weekStart = KOGlobals::self()->firstDayOfWeek();
const int dayOfWeek = d.dayOfWeek();
......
......@@ -50,8 +50,8 @@ public:
Q_REQUIRED_RESULT int datesCount() const;
public Q_SLOTS:
void selectDates(const KCalendarCore::DateList &, const QDate &preferredMonth = QDate());
void selectDate(const QDate &);
void selectDates(const KCalendarCore::DateList &, QDate preferredMonth = QDate());
void selectDate(QDate);
void selectDates(int count);
void selectDates(const QDate &, int count, const QDate &preferredMonth = QDate());
......@@ -60,9 +60,9 @@ public Q_SLOTS:
void selectWeek(const QDate &, const QDate &preferredMonth = QDate());
void selectWorkWeek();
void selectWorkWeek(const QDate &);
void selectWorkWeek(QDate);
void selectWeekByDay(int weekDay, const QDate &, const QDate &preferredMonth = QDate());
void selectWeekByDay(int weekDay, QDate, QDate preferredMonth = QDate());
void selectToday();
......
......@@ -182,6 +182,7 @@ void FilterEdit::saveChanges()
QStringList categoryList;
const int numberOfCat(mCatList->count());
categoryList.reserve(numberOfCat);
for (int i = 0; i < numberOfCat; ++i) {
QListWidgetItem *item = mCatList->item(i);
if (item) {
......
......@@ -140,7 +140,7 @@ void KODayMatrix::addSelectedDaysTo(KCalendarCore::DateList &selDays)
}
}
void KODayMatrix::setSelectedDaysFrom(const QDate &start, const QDate &end)
void KODayMatrix::setSelectedDaysFrom(QDate start, QDate end)
{
if (mStartDate.isValid()) {
mSelStart = mStartDate.daysTo(start);
......@@ -183,7 +183,7 @@ void KODayMatrix::setUpdateNeeded()
mPendingChanges = true;
}
void KODayMatrix::updateView(const QDate &actdate)
void KODayMatrix::updateView(QDate actdate)
{
if (!actdate.isValid() || NUMDAYS < 1) {
return;
......@@ -884,7 +884,7 @@ void KODayMatrix::resizeEvent(QResizeEvent *)
}
/* static */
QPair<QDate, QDate> KODayMatrix::matrixLimits(const QDate &month)
QPair<QDate, QDate> KODayMatrix::matrixLimits(QDate month)
{
QDate d(month.year(), month.month(), 1);
......
......@@ -85,7 +85,7 @@ public:
/** returns the first and last date of the 6*7 matrix that displays @p month
* @param month The month we want to get matrix boundaries
*/
static Q_REQUIRED_RESULT QPair<QDate, QDate> matrixLimits(const QDate &month);
static Q_REQUIRED_RESULT QPair<QDate, QDate> matrixLimits(QDate month);
/**
Associate a calendar with this day matrix. If there is a calendar, the
......@@ -101,7 +101,7 @@ public:
* @param actdate recalculates the day matrix to show NUMDAYS starting
* from this date.
*/
void updateView(const QDate &actdate);
void updateView(QDate actdate);
/**
Update incidence states of dates. Depending of the preferences days with
......@@ -134,7 +134,7 @@ public:
* @param start start of the new selection
* @param end end date of the new selection
*/
void setSelectedDaysFrom(const QDate &start, const QDate &end);
void setSelectedDaysFrom(QDate start, QDate end);
/**
Clear all selections.
......
......@@ -86,7 +86,7 @@ int KOGlobals::firstDayOfWeek() const
return KOPrefs::instance()->mWeekStartDay + 1;
}
QList<QDate> KOGlobals::workDays(const QDate &startDate, const QDate &endDate) const
QList<QDate> KOGlobals::workDays(QDate startDate, QDate endDate) const
{
QList<QDate> result;
......
......@@ -53,7 +53,7 @@ public:
/**
Returns a list containing work days between @p start and @end.
*/
Q_REQUIRED_RESULT QList<QDate> workDays(const QDate &start, const QDate &end) const;
Q_REQUIRED_RESULT QList<QDate> workDays(QDate start, QDate end) const;
Q_REQUIRED_RESULT int getWorkWeekMask();
......
......@@ -58,7 +58,7 @@ QColor KOHelper::resourceColor(const Akonadi::Item &item)
return EventViews::resourceColor(item, KOPrefs::instance()->eventViewsPreferences());
}
int KOHelper::yearDiff(const QDate &start, const QDate &end)
int KOHelper::yearDiff(QDate start, QDate end)
{
return end.year() - start.year();
}
......
......@@ -65,7 +65,7 @@ KORGANIZERPRIVATE_EXPORT void setResourceColor(const Akonadi::Collection &collec
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)
*/
KORGANIZERPRIVATE_EXPORT Q_REQUIRED_RESULT int yearDiff(const QDate &start, const QDate &end);
KORGANIZERPRIVATE_EXPORT Q_REQUIRED_RESULT int yearDiff(QDate start, QDate end);
/**
Return true if it's the standard calendar
......
......@@ -262,7 +262,7 @@ void KOViewManager::updateView()
}
}
void KOViewManager::updateView(const QDate &start, const QDate &end, const QDate &preferredMonth)
void KOViewManager::updateView(QDate start, QDate end, QDate preferredMonth)
{
if (mCurrentView && mCurrentView != mTodoView) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
......
......@@ -90,7 +90,7 @@ public:
void setDocumentId(const QString &);
void updateView();
void updateView(const QDate &start, const QDate &end, const QDate &preferredMonth);
void updateView(QDate start, QDate end, QDate preferredMonth);
void goMenu(bool enable);
void raiseCurrentView();
......
......@@ -258,7 +258,7 @@ public:
mDayBegin = new KTimeComboBox(this);
datetimeLayout->addWidget(new QLabel(KOPrefs::instance()->dayBeginsItem()->label(), this), 1, 0);
datetimeLayout->addWidget(mDayBegin, 1, 1);
connect(mDayBegin, &KTimeComboBox::currentIndexChanged, this, &KOPrefsDialogTime::slotConfigChanged);
connect(mDayBegin, qOverload<int>(&KTimeComboBox::currentIndexChanged), this, &KOPrefsDialogTime::slotConfigChanged);
QGroupBox *holidaysGroupBox
= new QGroupBox(i18nc("@title:group", "Holidays"), regionalPage);
......
......@@ -165,12 +165,12 @@ void KOAgendaView::zoomOutVertically()
d->mAgendaView->zoomOutVertically();
}
void KOAgendaView::zoomInHorizontally(const QDate &date)
void KOAgendaView::zoomInHorizontally(QDate date)
{
d->mAgendaView->zoomInHorizontally(date);
}
void KOAgendaView::zoomOutHorizontally(const QDate &date)
void KOAgendaView::zoomOutHorizontally(QDate date)
{
d->mAgendaView->zoomOutHorizontally(date);
}
......
......@@ -99,8 +99,8 @@ public Q_SLOTS:
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();
......
......@@ -49,7 +49,7 @@ StyledCalendarDelegate::~StyledCalendarDelegate()
{
}
static QRect enableButtonRect(const QRect &rect, int pos = 1)
static QRect enableButtonRect(QRect rect, int pos = 1)
{
//2px border on each side of the icon
static int border = 2;
......
......@@ -130,7 +130,7 @@ void NavigatorBar::selectDates(const KCalendarCore::DateList &dateList)
mMonth->setText(i18nc("monthname", "%1",
QLocale().standaloneMonthName(mDate.month(), QLocale::LongFormat)));
mYear->setText(i18nc("4 digit year", "%1",
QLocale().toString(mDate, QLatin1String("yyyy"))));
QLocale().toString(mDate, QStringLiteral("yyyy"))));
}
}
......
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