summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookweekheaderimpl.cpp
authorumopapisdn <umopapisdn>2003-05-13 22:58:18 (UTC)
committer umopapisdn <umopapisdn>2003-05-13 22:58:18 (UTC)
commit1e0e2f57472538bd880967ebe061c8f39a7e270b (patch) (side-by-side diff)
treefcc070d53148385f93c0dc6ab5443d5100be0d26 /core/pim/datebook/datebookweekheaderimpl.cpp
parent45c0386de12b107e54e4d020d54eb05517a9efac (diff)
downloadopie-1e0e2f57472538bd880967ebe061c8f39a7e270b.zip
opie-1e0e2f57472538bd880967ebe061c8f39a7e270b.tar.gz
opie-1e0e2f57472538bd880967ebe061c8f39a7e270b.tar.bz2
Bugfix: (Bug #0000902) Adding events in weekview shouldn't create them as events on the first day of the week but rather the last visited day.
Diffstat (limited to 'core/pim/datebook/datebookweekheaderimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookweekheaderimpl.cpp26
1 files changed, 1 insertions, 25 deletions
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp
index fd792e2..ff7626f 100644
--- a/core/pim/datebook/datebookweekheaderimpl.cpp
+++ b/core/pim/datebook/datebookweekheaderimpl.cpp
@@ -105,7 +105,7 @@ void DateBookWeekHeader::setDate(const QDate &d) {
QString::number(stop.day()) + "." +
start.monthName(stop.month()) +" ("+
tr("w")+":"+QString::number( week ) +")");
- emit dateChanged(year,week);
+ emit dateChanged(date);
}
void DateBookWeekHeader::setStartOfWeek( bool onMonday )
@@ -113,27 +113,3 @@ void DateBookWeekHeader::setStartOfWeek( bool onMonday )
bStartOnMonday = onMonday;
setDate( date );
}
-
-// dateFromWeek
-// compute the date from the week in the year
-QDate dateFromWeek( int week, int year, bool startOnMonday )
-{
- QDate d;
- d.setYMD( year, 1, 1 );
- int dayOfWeek = d.dayOfWeek();
- if ( startOnMonday ) {
- if ( dayOfWeek <= 4 ) {
- d = d.addDays( ( week - 1 ) * 7 - dayOfWeek + 1 );
- } else {
- d = d.addDays( (week) * 7 - dayOfWeek + 1 );
- }
- } else {
- if ( dayOfWeek <= 4 || dayOfWeek == 7) {
- d = d.addDays( ( week - 1 ) * 7 - dayOfWeek % 7 );
- } else {
- d = d.addDays( ( week ) * 7 - dayOfWeek % 7 );
- }
- }
- return d;
-}
-