author | eilers <eilers> | 2003-08-01 14:19:44 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-08-01 14:19:44 (UTC) |
commit | 34991bac7d96b1c17601be6a5607819342571e0c (patch) (side-by-side diff) | |
tree | 65d0bc2db22bcc1dc1b5eafdafd53b9cb08a6395 /core/pim/datebook/datebookweekheaderimpl.cpp | |
parent | 5346424fc26bde232a15aa34fbb720f86218b26f (diff) | |
download | opie-34991bac7d96b1c17601be6a5607819342571e0c.zip opie-34991bac7d96b1c17601be6a5607819342571e0c.tar.gz opie-34991bac7d96b1c17601be6a5607819342571e0c.tar.bz2 |
Merging changes from BRANCH_1_0 to HEAD..
Diffstat (limited to 'core/pim/datebook/datebookweekheaderimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookweekheaderimpl.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp index ff7626f..770410e 100644 --- a/core/pim/datebook/datebookweekheaderimpl.cpp +++ b/core/pim/datebook/datebookweekheaderimpl.cpp @@ -67,39 +67,47 @@ void DateBookWeekHeader::pickDate() m1->popup(mapToGlobal(labelDate->pos()+QPoint(0,labelDate->height()))); picker->setFocus(); } void DateBookWeekHeader::nextMonth() { + qWarning("nextMonth() " ); setDate(date.addDays(28)); } void DateBookWeekHeader::prevMonth() { + qWarning("prevMonth() " ); setDate(date.addDays(-28)); } void DateBookWeekHeader::nextWeek() { + qWarning("nextWeek() " ); setDate(date.addDays(7)); } void DateBookWeekHeader::prevWeek() { + qWarning("prevWeek() "); setDate(date.addDays(-7)); } void DateBookWeekHeader::setDate( int y, int m, int d ) { setDate(QDate(y,m,d)); } void DateBookWeekHeader::setDate(const QDate &d) { int year,week,dayofweek; date=d; dayofweek=d.dayOfWeek(); - if(bStartOnMonday) dayofweek--; + if(bStartOnMonday) + dayofweek--; + else if( dayofweek == 7 ) + /* we already have the right day -7 would lead to the current week..*/ + dayofweek = 0; + date=date.addDays(-dayofweek); - calcWeek(date,week,year,bStartOnMonday); QDate start=date; QDate stop=start.addDays(6); labelDate->setText( QString::number(start.day()) + "." + start.monthName(start.month()) + "-" + QString::number(stop.day()) + "." + |