summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Krause <[email protected]>2017-04-08 18:23:38 +0200
committerVolker Krause <[email protected]>2017-04-08 18:23:38 +0200
commitaf87c91bee41eb867003c389ef076b56875f8835 (patch)
tree63b23602f8cb0b0f1f208e678ee445f72a146ba6
parent5ad230a4e8cb859fac0cf6007231d4c0966768af (diff)
Port some KDateTime::Spec usage considering this is always LocalTime
-rw-r--r--src/agenda/agendaview.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/agenda/agendaview.cpp b/src/agenda/agendaview.cpp
index 459ccb3..33c1a6b 100644
--- a/src/agenda/agendaview.cpp
+++ b/src/agenda/agendaview.cpp
@@ -333,9 +333,6 @@ AgendaItem::List AgendaView::Private::agendaItems(const QString &uid) const
bool AgendaView::Private::mightBeVisible(const KCalCore::Incidence::Ptr &incidence) const
{
KCalCore::Todo::Ptr todo = incidence.dynamicCast<KCalCore::Todo>();
- const KDateTime::Spec timeSpec = q->preferences()->timeSpec();
- KDateTime firstVisibleDateTime(mSelectedDates.first(), timeSpec);
- KDateTime lastVisibleDateTime(mSelectedDates.last(), timeSpec);
// KDateTime::toTimeSpec() is expensive, so lets first compare only the date,
// to see if the incidence is visible.
@@ -350,17 +347,17 @@ bool AgendaView::Private::mightBeVisible(const KCalCore::Incidence::Ptr &inciden
if (!incidence->recurs()) {
// If DTEND/DTDUE is before the 1st visible column
- if (incidence->dateTime(KCalCore::Incidence::RoleEnd).date().daysTo(firstVisibleDateTime.date()) > 2) {
+ if (incidence->dateTime(KCalCore::Incidence::RoleEnd).date().daysTo(mSelectedDates.first()) > 2) {
return false;
}
// if DTSTART is after the last visible column
- if (!todo && lastVisibleDateTime.date().daysTo(incidence->dtStart().date()) > 2) {
+ if (!todo && mSelectedDates.last().daysTo(incidence->dtStart().date()) > 2) {
return false;
}
// if DTDUE is after the last visible column
- if (todo && lastVisibleDateTime.date().daysTo(todo->dtDue().date()) > 2) {
+ if (todo && mSelectedDates.last().daysTo(todo->dtDue().date()) > 2) {
return false;
}
}
@@ -593,7 +590,7 @@ void AgendaView::Private::insertIncidence(const KCalCore::Incidence::Ptr &incide
}
const KDateTime::Spec timeSpec = q->preferences()->timeSpec();
- const QDate today = KDateTime::currentDateTime(timeSpec).date();
+ const QDate today = QDateTime::currentDateTime().date();
if (todo && todo->isOverdue() && today >= insertAtDate) {
mAllDayAgenda->insertAllDayItem(incidence, recurrenceId, curCol, curCol,
createSelected);