summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp25
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
@@ -1002,8 +1002,5 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
hb->addWidget( mNavigatorBar );
hb->addWidget( mWidStack );
- mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
mShowWeekView = KOPrefs::instance()->mMonthViewWeek;
- if ( mShowWeekView )
- mWeekStartsMonday = true;
updatePossible = false;
//updatePossible = true;
@@ -1218,7 +1215,7 @@ void KOMonthView::updateConfig()
{
- mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
+ int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
- if ( mShowWeekView ) {
+ if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) {
mWeekStartsMonday = true;
}
@@ -1260,18 +1257,14 @@ 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() )
@@ -1295,4 +1288,5 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
QPtrVector<KOWeekButton> *weekLabels;
int weekNum = 6;
+ mStartDate = start;
if ( mShowWeekView ) {
weekNum = 1;
@@ -1300,4 +1294,7 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
dayLabels = &mDayLabelsW;
weekLabels = &mWeekLabelsW;
+ if ( !KGlobal::locale()->weekStartsMonday() ) {
+ mStartDate = mStartDate.addDays( 1 );
+ }
} else {
cells = &mCells;
@@ -1306,6 +1303,9 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
}
- mStartDate = start;
+ int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
+ if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) {
+ mWeekStartsMonday = true;
+ }
int startWeekDay = mWeekStartsMonday ? 1 : 7;
@@ -1313,5 +1313,4 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
mStartDate = mStartDate.addDays( -1 );
}
-
bool primary = false;
uint i;