summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookweeklst.cpp
authoreilers <eilers>2003-08-01 14:19:44 (UTC)
committer eilers <eilers>2003-08-01 14:19:44 (UTC)
commit34991bac7d96b1c17601be6a5607819342571e0c (patch) (side-by-side diff)
tree65d0bc2db22bcc1dc1b5eafdafd53b9cb08a6395 /core/pim/datebook/datebookweeklst.cpp
parent5346424fc26bde232a15aa34fbb720f86218b26f (diff)
downloadopie-34991bac7d96b1c17601be6a5607819342571e0c.zip
opie-34991bac7d96b1c17601be6a5607819342571e0c.tar.gz
opie-34991bac7d96b1c17601be6a5607819342571e0c.tar.bz2
Merging changes from BRANCH_1_0 to HEAD..
Diffstat (limited to 'core/pim/datebook/datebookweeklst.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebookweeklst.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index 7817042..aad1f3a 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -58,13 +58,18 @@ DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const ch
DateBookWeekLstHeader::~DateBookWeekLstHeader(){}
void DateBookWeekLstHeader::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 same 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()) + "." +
@@ -114,13 +119,13 @@ DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool /* onM */,
const char* name,
WFlags fl )
: DateBookWeekLstDayHdrBase(parent, name, fl) {
date=d;
- static const char *wdays={"MTWTFSSM"};
+ static const QString wdays=tr("MTWTFSSM", "Week days");
char day=wdays[d.dayOfWeek()-1];
label->setText( QString(QObject::tr(QString(QChar(day)))) + " " +QString::number(d.day()) );
add->setText("+");
if (d == QDate::currentDate()) {
@@ -234,12 +239,13 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
dayOrder[0]=7;
}
// Calculate offset to first day of week.
int dayoffset=d.dayOfWeek();
if(bStartOnMonday) dayoffset--;
+ else if( dayoffset == 7 ) dayoffset = 0;
for (int i=0; i<7; i++) {
// Header
DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,this);
connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
connect(hdr, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &, const QString &)),