[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdepim/korganizer
From:       Till Adam <adam () kde ! org>
Date:       2005-05-01 12:27:00
Message-ID: 20050501122700.5C5E0669 () office ! kde ! org
[Download RAW message or body]

CVS commit by tilladam: 

Better fix and user warning for the invalid weekly recurrence problem.
Thanks, Reinhold, for showing me the error of my ways.


  M +5 -11     koeditorrecurrence.cpp   1.86


--- kdepim/korganizer/koeditorrecurrence.cpp  #1.85:1.86
@@ -1352,11 +1352,6 @@ void KOEditorRecurrence::writeIncidence(
       int freq = mWeekly->frequency();
       const QBitArray &days = mWeekly->days();
-      bool valid = false; // make sure at least one day is set
-      for ( int i = 0; i<7; i++ ) valid = valid || days.testBit( i );
-      invalidRecurrence = !valid;
-      if ( !invalidRecurrence ) {
       if ( duration != 0 ) r->setWeekly( freq, days, duration );
       else r->setWeekly( freq, days, endDate );
-      }
   } else if ( recurrenceType == RecurrenceChooser::Monthly ) {
       int freq = mMonthly->frequency();
@@ -1417,7 +1412,4 @@ void KOEditorRecurrence::writeIncidence(
     } // end "Yearly"
 
-  if ( invalidRecurrence )
-    r->unsetRecurs();
-  else
     incidence->setExDates( mExceptions->dates() );
 }
@@ -1447,5 +1439,7 @@ bool KOEditorRecurrence::validateInput()
     for ( int i=0; i<7; ++i ) valid = valid || days.testBit( i );
     if ( !valid ) {
-      // FIXME message box
+      KMessageBox::sorry( 0,
+        i18n("A weekly recurring event or task has to have at least one weekday "
+             "associated with it.") );
       return false;
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic