File r899977.diff of Package kdepim4

Subject: korganizer: paint the all-day item headers
From: wstephenson@suse.de
Bug: 
Patch-upstream: 899977
--- korganizer/koagendaitem.cpp	(revision 899976)
+++ korganizer/koagendaitem.cpp	(revision 899977)
@@ -31,6 +31,7 @@
 
 #include <kcal/icaldrag.h>
 #include <kcal/incidence.h>
+#include <kcal/event.h>
 #include <kcal/todo.h>
 #include <kcal/incidenceformatter.h>
 #include <kcal/vcaldrag.h>
@@ -978,15 +979,33 @@ void KOAgendaItem::paintEvent( QPaintEve
 
   if ( mIncidence->allDay() ) {
     shortH = longH = "";
+    if ( mIncidence->type() == "Event" ) {
+      if ( static_cast<Event*>( mIncidence )->isMultiDay( KOPrefs::instance()->timeSpec() ) ) {
+        // multi-day, all-day event
+        shortH =
+          i18n( "%1 - %2",
+                KGlobal::locale()->formatDate(
+                  mIncidence->dtStart().toTimeSpec( KOPrefs::instance()->timeSpec() ).date() ),
+                KGlobal::locale()->formatDate(
+                  mIncidence->dtEnd().toTimeSpec( KOPrefs::instance()->timeSpec() ).date() ) );
+        longH = shortH;
+
+        // paint headline
+        drawRoundedRect(
+          &p,
+          QRect( fmargin, fmargin, width() - fmargin * 2, - fmargin * 2 + margin + hlHeight ),
+          mSelected, frameColor, false, ft, roundTop, false );
+      } else {
+        // single-day, all-day event
 
-    if ( ( mIncidence->type() != "Todo" ) &&
-         ( mIncidence->dtStart() != mIncidence->dtEnd() ) ) { // multi days
-      shortH = longH =
-               i18n( "%1 - %2",
-                     KGlobal::locale()->formatDate(
-                       mIncidence->dtStart().toTimeSpec( KOPrefs::instance()->timeSpec() ).date() ),
-                     KGlobal::locale()->formatDate(
-                       mIncidence->dtEnd().toTimeSpec( KOPrefs::instance()->timeSpec() ).date() ) );
+        // paint headline
+        drawRoundedRect(
+          &p,
+          QRect( fmargin, fmargin, width() - fmargin * 2, - fmargin * 2 + margin + hlHeight ),
+          mSelected, frameColor, false, ft, roundTop, false );
+      }
+    } else {
+      // to-do
 
       // paint headline
       drawRoundedRect(
Index: korganizer/koagendaitem.cpp
===================================================================
openSUSE Build Service is sponsored by