-rw-r--r-- | korganizer/komonthview.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 9085775..d825493 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -1001,10 +1001,7 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) #endif hb->addWidget( mNavigatorBar ); hb->addWidget( mWidStack ); - mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); mShowWeekView = KOPrefs::instance()->mMonthViewWeek; - if ( mShowWeekView ) - mWeekStartsMonday = true; updatePossible = false; //updatePossible = true; mCells.setAutoDelete( true ); @@ -1217,9 +1214,9 @@ void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, void KOMonthView::updateConfig() { - mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); + int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); - if ( mShowWeekView ) { + if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) { mWeekStartsMonday = true; } QFontMetrics fontmetric(mDayLabels[0]->font()); @@ -1259,20 +1256,16 @@ void KOMonthView::updateDayLabels() mDayLabelsT = &mDayLabelsW; for (int i = 0; i < 7; i++) { - if (mWeekStartsMonday) { + { bool show = mShortDayLabelsW; if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) show = true; (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); - } else { - if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsW)); - else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsW)); - } } mDayLabelsT = &mDayLabels; for (int i = 0; i < 7; i++) { - if (mWeekStartsMonday) { + if (KGlobal::locale()->weekStartsMonday() || KOPrefs::instance()->mMonthViewSatSunTog ) { bool show = mShortDayLabelsM; if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) show = true; @@ -1294,25 +1287,31 @@ void KOMonthView::showDates(const QDate &start, const QDate &) QPtrVector<QLabel> *dayLabels; QPtrVector<KOWeekButton> *weekLabels; int weekNum = 6; + mStartDate = start; if ( mShowWeekView ) { weekNum = 1; cells = &mCellsW; dayLabels = &mDayLabelsW; weekLabels = &mWeekLabelsW; + if ( !KGlobal::locale()->weekStartsMonday() ) { + mStartDate = mStartDate.addDays( 1 ); + } } else { cells = &mCells; dayLabels = &mDayLabels; weekLabels = &mWeekLabels; } - mStartDate = start; + int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); + if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) { + mWeekStartsMonday = true; + } int startWeekDay = mWeekStartsMonday ? 1 : 7; while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { mStartDate = mStartDate.addDays( -1 ); } - bool primary = false; uint i; for( i = 0; i < (*cells).size(); ++i ) { |