diff --git a/src/icalformat_p.cpp b/src/icalformat_p.cpp --- a/src/icalformat_p.cpp +++ b/src/icalformat_p.cpp @@ -1013,7 +1013,7 @@ r.by_set_pos[index++] = static_cast(*it); } - QList byd = recur->byDays(); + const QList &byd = recur->byDays(); int day; index = 0; for (QList::ConstIterator dit = byd.constBegin(); diff --git a/src/icaltimezones.cpp b/src/icaltimezones.cpp --- a/src/icaltimezones.cpp +++ b/src/icaltimezones.cpp @@ -246,7 +246,7 @@ } // Found a phase combination which hasn't yet been processed const int preOffset = (i > 0) ? transits.at(i - 1).offsetFromUtc : 0; - const auto transit = transits.at(i); + const auto &transit = transits.at(i); if (transit.offsetFromUtc == preOffset) { transitionsDone[i] = true; while (++i < trcount) { @@ -651,7 +651,6 @@ * Note that we had to get DTSTART, TZOFFSETFROM, TZOFFSETTO before reading * recurrences. */ - const QDateTime klocalStart(localStart); const QDateTime maxTime(MAX_DATE()); Recurrence recur; icalproperty *p = icalcomponent_get_first_property(c, ICAL_ANY_PROPERTY); @@ -694,7 +693,7 @@ ICalFormat icf; ICalFormatImpl impl(&icf); impl.readRecurrence(icalproperty_get_rrule(p), &r); - r.setStartDt(klocalStart); + r.setStartDt(localStart); // The end date time specified in an RRULE should be in UTC. // Convert to local time to avoid timesInInterval() getting things wrong. if (r.duration() == 0) { @@ -704,7 +703,7 @@ r.setEndDt(end.addSecs(prevOffset)); } } - const auto dts = r.timesInInterval(klocalStart, maxTime); + const auto dts = r.timesInInterval(localStart, maxTime); for (int i = 0, end = dts.count(); i < end; ++i) { QDateTime utc = dts[i]; utc.setTimeSpec(Qt::UTC); diff --git a/src/recurrence.cpp b/src/recurrence.cpp --- a/src/recurrence.cpp +++ b/src/recurrence.cpp @@ -649,7 +649,7 @@ days.fill(0); RecurrenceRule *rrule = defaultRRuleConst(); if (rrule) { - QList bydays = rrule->byDays(); + const QList &bydays = rrule->byDays(); for (int i = 0; i < bydays.size(); ++i) { if (bydays.at(i).pos() == 0) { days.setBit(bydays.at(i).day() - 1); diff --git a/src/todo.cpp b/src/todo.cpp --- a/src/todo.cpp +++ b/src/todo.cpp @@ -550,11 +550,9 @@ QLatin1String Todo::iconName(const QDateTime &recurrenceId) const { - QDateTime occurrenceDT = recurrenceId; - - const bool usesCompletedTaskPixmap = isCompleted() || - (recurs() && occurrenceDT.isValid() && - occurrenceDT < dtDue(false)); + const bool usesCompletedTaskPixmap = + isCompleted() || + (recurs() && recurrenceId.isValid() && (recurrenceId < dtDue(false))); if (usesCompletedTaskPixmap) { return QLatin1String("task-complete");