calendarui/views/dayview/src/calendayinfo.cpp
changeset 77 b0711afde476
parent 50 579cc610882e
--- a/calendarui/views/dayview/src/calendayinfo.cpp	Thu Sep 02 20:25:23 2010 +0300
+++ b/calendarui/views/dayview/src/calendayinfo.cpp	Fri Sep 17 08:29:05 2010 +0300
@@ -21,6 +21,7 @@
 #include "calenagendautils.h"
 #include "calenconstants.h"
 #include "calendateutils.h"
+#include "calendayutils.h"
 
 namespace
 {
@@ -50,9 +51,9 @@
         iRegionList[i].Close();
     }
     iRegionList.clear();
-    iUntimedEvents.clear();//Close();
-    iTodoEvents.clear();//Close();
-    iAlldayEvents.clear();//Close();
+    iUntimedEvents.clear();
+    iTodoEvents.clear();
+    iAlldayEvents.clear();
 }
 
 /*!
@@ -63,10 +64,10 @@
     for (int i = 0; i < iRegionList.count(); i++) {
         iRegionList[i].Close();
     }
-    iRegionList.clear();//Reset();
-    iUntimedEvents.clear();//Reset();
-    iTodoEvents.clear();//Reset();
-    iAlldayEvents.clear();//Reset();
+    iRegionList.clear();
+    iUntimedEvents.clear();
+    iTodoEvents.clear();
+    iAlldayEvents.clear();
 
     iUntimedSlotCount = 0;
     iFirstUntimedSlot = KFSCalStartingHour * iSlotsInHour;
@@ -87,8 +88,16 @@
 
     int startIndex = SlotIndexForStartTime(aItemInfo.iStartTime);
     int endIndex = SlotIndexForEndTime(aItemInfo.iEndTime);
-    if (endIndex == startIndex) {
-        endIndex++;
+    
+    // 10.1 update: the minimum height of event is defined by UI spec.,
+    // so number of occupied slots must be verified to hold at least bubble
+    // with minimum possible height
+    qreal slotHeight = CalenDayUtils::instance()->hourElementHeight()
+        / iSlotsInHour;
+    int minSlotsInEvent = qRound((CalenDayUtils::instance()->minEventHeight()
+        / slotHeight) + 0.5);
+    if (endIndex < startIndex + minSlotsInEvent) {
+        endIndex = startIndex + minSlotsInEvent;
     }
     if (iRegionList.count() > 0) {
         // the timed events must be added in order