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

List:       kde-commits
Subject:    KDE/kdepim/libkdepim
From:       Sergio Luis Martins <iamsergio () gmail ! com>
Date:       2010-12-14 14:32:01
Message-ID: 20101214143201.9EE73AC8AA () svn ! kde ! org
[Download RAW message or body]

SVN commit 1206472 by smartins:

Rename "index" to "dayOfWeek", so it has the same meaning as in other parts of the code.
"dayOfWeek" is always absolute and monday is always the first day.
"index" is the index of a "dayOfWeek" on a QBitArray that starts with KGlobal::locale()->weekStartDay().

 M  +3 -5      kweekdaycheckcombo.cpp  


--- trunk/KDE/kdepim/libkdepim/kweekdaycheckcombo.cpp #1206471:1206472
@@ -35,15 +35,13 @@
   QStringList checkedItems;
   for ( int i = 0; i < 7; ++i ) {
     // i is the nr of the combobox, not the day of week!
-    // label=(i+weekStart+6)%7 + 1;
-    // index in CheckBox array(=day): label-1
-    const int index = ( i + weekStart + 6 ) % 7;
+    const int dayOfWeek = ( i + weekStart + 6 ) % 7;
 
-    const QString weekDayName = calSys->weekDayName( index + 1, KCalendarSystem::ShortDayName );
+    const QString weekDayName = calSys->weekDayName( dayOfWeek + 1, KCalendarSystem::ShortDayName );
     addItem( weekDayName );
     // by default Monday - Friday should be checked
     // which corresponds to index 0 - 4;
-    if ( first5Checked && index < 5 ) {
+    if ( first5Checked && dayOfWeek < 5 ) {
       checkedItems << weekDayName;
     }
   }
[prev in list] [next in list] [prev in thread] [next in thread] 

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