File bnc731187-69554e88-korganizer-month-boundary-spanning-events.diff of Package kdepim4.openSUSE_12.1
Patch-upstream: yes
commit 69554e88f51faa7c02d6453286790542a39b7ed8
Author: Sergio Martins <iamsergio@gmail.com>
Date: Sat Nov 19 14:58:53 2011 +0000
Event crossing month bounderies wasn't being shown.
Patch by Reimar Imhof.
I changed it a bit and replaced downcasts with date roles.
BUG: 286876
BUG: 286984
(cherry picked from commit 4fbd25490042b4994d410b54c901078e31e61994)
diff --git a/calendarviews/eventviews/month/monthview.cpp b/calendarviews/eventviews/month/monthview.cpp
index 4efd80b..7012cfe 100644
--- a/calendarviews/eventviews/month/monthview.cpp
+++ b/calendarviews/eventviews/month/monthview.cpp
@@ -527,21 +527,12 @@ void MonthView::reloadIncidences()
removeFilteredOccurrences( todo, dateTimeList );
}
} else {
- KDateTime dateToAdd;
+ const KDateTime dtStart = incidence->dateTime( KCalCore::Incidence::RoleDisplayStart );
+ const KDateTime dtEnd = incidence->dateTime( KCalCore::Incidence::RoleDisplayEnd );
- if ( KCalCore::Todo::Ptr todo = CalendarSupport::todo( aitem ) ) {
- if ( todo->hasDueDate() ) {
- dateToAdd = todo->dtDue();
- }
- } else {
- dateToAdd = incidence->dtStart();
+ if ( dtEnd >= actualStartDateTime() && dtStart <= actualEndDateTime() ) {
+ dateTimeList += dtStart;
}
-
- if ( dateToAdd >= actualStartDateTime() &&
- dateToAdd <= actualEndDateTime() ) {
- dateTimeList += dateToAdd;
- }
-
}
KCalCore::DateTimeList::const_iterator t;
const bool busyDay = colorMonthBusyDays && makesWholeDayBusy( incidence );