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

List:       kde-commits
Subject:    KDE/kdepim/incidenceeditor-ng
From:       Sergio Luis Martins <iamsergio () gmail ! com>
Date:       2010-12-14 14:31:58
Message-ID: 20101214143158.97556AC8A7 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1206471 by smartins:

Don't call weekdayIndex() here.

Bit 0 of the QBitArray is always monday, no matter what KGlobal::locale()->weekStartDay() says.
And that's documented in kweekdaycheckcombobox.h:setDays().

 M  +9 -6      incidencerecurrence.cpp  


--- trunk/KDE/kdepim/incidenceeditor-ng/incidencerecurrence.cpp #1206470:1206471
@@ -811,14 +811,17 @@
 
   setFrequency( 1 );
 
-  QBitArray days( 7 );
-  days.fill( 0 );
-  const int day = mUi->mWeekDayCombo->weekdayIndex( mDateTime->startDate() );
-  days.setBit( day );
+  // -1 because we want between 0 and 6
+  const int day = KGlobal::locale()->calendar()->dayOfWeek( mDateTime->startDate() ) - 1;
+
+  QBitArray checkDays( 7, 0 );
+  checkDays.setBit( day );
+
   QBitArray disableDays( 7, 0 );
-  disableDays.setBit( day, 1 );
-  mUi->mWeekDayCombo->setDays( days, disableDays );
+  disableDays.setBit( day );
 
+  mUi->mWeekDayCombo->setDays( checkDays, disableDays );
+
   mUi->mMonthlyCombo->setCurrentIndex( 0 ); // Recur on the nth of the month
   mUi->mYearlyCombo->setCurrentIndex( 0 );  // Recur on the nth of the month
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

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