calendarui/views/dayview/src/calendayutils.cpp
changeset 81 ce92091cbd61
parent 70 a5ed90760192
child 83 5aadd1120515
--- a/calendarui/views/dayview/src/calendayutils.cpp	Mon Sep 20 12:44:39 2010 +0530
+++ b/calendarui/views/dayview/src/calendayutils.cpp	Tue Oct 05 13:57:00 2010 +0530
@@ -140,23 +140,31 @@
     return mMainWindow;
 }
 
-/*!
- \brief getEventValidStartEndTime
- \brief Get event's valid start/end time from agenda entry.
+/*
+ * Get event's start/end time fromm agenda entry.
+ * Start/end time are validated to be within the current day (the case of
+ * multi-day events)
+ * @param start [out] valid start time
+ * @param end [out] valid end time
+ * @param entry [in] agenda entry asociated with the event.
+ * @param currentDate [in] current date
  */
-void CalenDayUtils::getEventValidStartEndTime( QDateTime& start, QDateTime& end, 
-                                    const AgendaEntry& entry, QDateTime& currentDate )
+void CalenDayUtils::getEventValidStartEndTime(
+    QDateTime& start,
+    QDateTime& end,
+    const AgendaEntry& entry,
+    QDateTime& currentDate)
 {
     start = entry.startTime();
     end = entry.endTime();
-    
-    if ( !CalenDateUtils::onSameDay( start, currentDate ) ) {
-        start = CalenDateUtils::beginningOfDay( currentDate );
+
+    if (!CalenDateUtils::onSameDay(start, currentDate)) {
+        start = CalenDateUtils::beginningOfDay(currentDate);
     }
-    
-    if ( !CalenDateUtils::onSameDay( end, currentDate ) ) {
-       QDateTime tommorrow( currentDate.addDays( 1 ));
-       end = CalenDateUtils::beginningOfDay( tommorrow ).addSecs( -60 );
+
+    if (!CalenDateUtils::onSameDay(end, currentDate)) {
+        QDateTime tommorrow(currentDate.addDays(1));
+        end = CalenDateUtils::beginningOfDay(tommorrow).addSecs(-60);
     }
 }