<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>111931</bug_id>
          
          <creation_ts>2005-09-02 16:47:13 +0000</creation_ts>
          <short_desc>choose last weekday unavailable</short_desc>
          <delta_ts>2006-11-05 19:32:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>korganizer</product>
          <component>general</component>
          <version>3.3</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Betty">elizabeth.silva</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>370442</commentid>
    <comment_count>0</comment_count>
    <who name="Betty">elizabeth.silva</who>
    <bug_when>2005-09-02 16:47:13 +0000</bug_when>
    <thetext>Version:           3.3 (using KDE 3.3.0, SuSE)
Compiler:          gcc version 3.3.4 (pre 3.3.5 20040809)
OS:                Linux (i686) release 2.6.8-24-default

The last weekday is setted as Saturday. It&apos;s not possible to change it to Friday, for example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>370448</commentid>
    <comment_count>1</comment_count>
    <who name="Bram Schoenmakers">me</who>
    <bug_when>2005-09-02 17:24:51 +0000</bug_when>
    <thetext>There&apos;s no such option to define the last weekday, only the first weekday (and even that option is not KOrganizer). So it&apos;s not entirely clear to me what you exactly mean. Could you please be a bit more descriptive? Do you want to set this for a particular view?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>480471</commentid>
    <comment_count>2</comment_count>
    <who name="Bram Schoenmakers">me</who>
    <bug_when>2006-10-28 14:52:46 +0000</bug_when>
    <thetext>Don&apos;t know what was wrong with me a year ago, but the bug is clear now :)

The calendars at the left should behave the same as the calendar in Kicker&apos;s Clock applet, regarding the start of the week option.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>483033</commentid>
    <comment_count>3</comment_count>
    <who name="Reinhold Kainhofer">reinhold</who>
    <bug_when>2006-11-02 19:21:39 +0000</bug_when>
    <thetext>Reassigning all KOrganizer bug reports and wishes to the newly created 
korganizer-devel mailing list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>484324</commentid>
    <comment_count>4</comment_count>
    <who name="Bram Schoenmakers">me</who>
    <bug_when>2006-11-05 19:32:07 +0000</bug_when>
    <thetext>SVN commit 602340 by bram:

o Make calendars in the left sidebar respect the First Day Of Week setting, defined in the control center
o Renaming some member variables and unused variable removed

BUG:111931



 M  +19 -25    kdatenavigator.cpp  
 M  +2 -4      kdatenavigator.h  


--- branches/KDE/3.5/kdepim/korganizer/kdatenavigator.cpp #602339:602340
@@ -64,21 +64,21 @@
 
   // Set up the heading fields.
   for( i = 0; i &lt; 7; i++ ) {
-    headings[i] = new QLabel( this );
-    headings[i]-&gt;setFont( QFont( generalFont, 10, QFont::Bold ) );
-    headings[i]-&gt;setAlignment( AlignCenter );
+    mHeadings[i] = new QLabel( this );
+    mHeadings[i]-&gt;setFont( QFont( generalFont, 10, QFont::Bold ) );
+    mHeadings[i]-&gt;setAlignment( AlignCenter );
 
-    topLayout-&gt;addWidget( headings[i], 1, i + 1 );
+    topLayout-&gt;addWidget( mHeadings[i], 1, i + 1 );
   }
 
   // Create the weeknumber labels
   for( i = 0; i &lt; 6; i++ ) {
-    weeknos[i] = new QLabel( this );
-    weeknos[i]-&gt;setAlignment( AlignCenter );
-    weeknos[i]-&gt;setFont( QFont( generalFont, 10 ) );
-    weeknos[i]-&gt;installEventFilter( this );
+    mWeeknos[i] = new QLabel( this );
+    mWeeknos[i]-&gt;setAlignment( AlignCenter );
+    mWeeknos[i]-&gt;setFont( QFont( generalFont, 10 ) );
+    mWeeknos[i]-&gt;installEventFilter( this );
 
-    topLayout-&gt;addWidget( weeknos[i], i + 2, 0 );
+    topLayout-&gt;addWidget( mWeeknos[i], i + 2, 0 );
   }
 
   mDayMatrix = new KODayMatrix( this, &quot;KDateNavigator::dayMatrix&quot; );
@@ -147,15 +147,14 @@
 
   const KCalendarSystem *calsys = KOGlobals::self()-&gt;calendarSystem();
   int m_fstDayOfWkCalsys = calsys-&gt;dayOfWeek( dayone );
+  int weekstart = KGlobal::locale()-&gt;weekStartDay();
 
   // If month begins on Monday and Monday is first day of week,
   // month should begin on second line. Sunday doesn&apos;t have this problem.
-  int nextLine = ( ( m_fstDayOfWkCalsys == 1) &amp;&amp;
-                   ( KGlobal::locale()-&gt;weekStartDay() == 1 ) ) ? 7 : 0;
+  int nextLine = m_fstDayOfWkCalsys &lt;= weekstart ? 7 : 0;
 
   // update the matrix dates
-  int index = ( KGlobal::locale()-&gt;weekStartDay() == 1 ? 1 : 0 ) -
-              m_fstDayOfWkCalsys - nextLine;
+  int index = weekstart - m_fstDayOfWkCalsys - nextLine;
 
   dayone = dayone.addDays( index );
 
@@ -190,7 +189,7 @@
     } else {
       weeknum.setNum( weeknumstart );
     }
-    weeknos[i]-&gt;setText( weeknum );
+    mWeeknos[i]-&gt;setText( weeknum );
   }
 
 // each updateDates is followed by an updateView -&gt; repaint is issued there !
@@ -215,18 +214,13 @@
 void KDateNavigator::updateConfig()
 {
   int day;
+  int weekstart = KGlobal::locale()-&gt;weekStartDay();
   for( int i = 0; i &lt; 7; i++ ) {
-    // take the first letter of the day name to be the abbreviation
-    if ( KGlobal::locale()-&gt;weekStartDay() == 1 ) {
-      day = i + 1;
-    } else {
-      if ( i == 0 ) day = 7;
-      else day = i;
-    }
+    day = weekstart + i &lt;= 7 ? weekstart + i : ( weekstart + i ) % 7;
     QString dayName = KOGlobals::self()-&gt;calendarSystem()-&gt;weekDayName( day,
                                                                         true );
     if ( KOPrefs::instance()-&gt;mCompactDialogs ) dayName = dayName.left( 1 );
-    headings[i]-&gt;setText( dayName );
+    mHeadings[i]-&gt;setText( dayName );
   }
 
   // FIXME: Use actual config setting here
@@ -237,9 +231,9 @@
 {
   for( int i = 0; i &lt; 6; i++ ) {
     if( enabled )
-      weeknos[i]-&gt;show();
+      mWeeknos[i]-&gt;show();
     else
-      weeknos[i]-&gt;hide();
+      mWeeknos[i]-&gt;hide();
   }
 }
 
@@ -270,7 +264,7 @@
   if ( e-&gt;type() == QEvent::MouseButtonPress ) {
     int i;
     for( i = 0; i &lt; 6; ++i ) {
-      if ( o == weeknos[ i ] ) {
+      if ( o == mWeeknos[ i ] ) {
         QDate weekstart = mDayMatrix-&gt;getDate( i * 7 );
         emit weekClicked( weekstart );
         break;
--- branches/KDE/3.5/kdepim/korganizer/kdatenavigator.h #602339:602340
@@ -99,16 +99,14 @@
   private:
     NavigatorBar *mNavigatorBar;
 
-    QLabel *headings[ 7 ];
-    QLabel *weeknos[ 7 ];
+    QLabel *mHeadings[ 7 ];
+    QLabel *mWeeknos[ 7 ];
 
     KODayMatrix *mDayMatrix;
 
     KCal::DateList mSelectedDates;
     QDate mBaseDate;
 
-    const QString *curHeaders;
-
     // Disabling copy constructor and assignment operator
     KDateNavigator( const KDateNavigator &amp; );
     KDateNavigator &amp;operator=( const KDateNavigator &amp; );
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>