summaryrefslogtreecommitdiff
path: root/core/pim/datebook
Unidiff
Diffstat (limited to 'core/pim/datebook') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp24
-rw-r--r--core/pim/datebook/datebookweekheaderimpl.cpp11
-rw-r--r--core/pim/datebook/datebookweeklst.cpp43
-rw-r--r--core/pim/datebook/datebookweeklst.h1
4 files changed, 45 insertions, 34 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 10a9b59..07d7164 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -194,2 +194,4 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
194 194
195 connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) );
196 connect( qApp, SIGNAL( reload()), this, SLOT( reload() ) );
195 /* 197 /*
@@ -404,2 +406,4 @@ void DateBook::insertEvent( const Event &e )
404 Event dupEvent=e; 406 Event dupEvent=e;
407 if(!dupEvent.isValidUid() ) // tkcRom seems to be different
408 dupEvent.assignUid();
405 dupEvent.setLocation(defaultLocation); 409 dupEvent.setLocation(defaultLocation);
@@ -445,11 +449,13 @@ void DateBook::duplicateEvent( const Event &e )
445 } 449 }
446 /* 450 /*
447 * The problem: 451 * The problem:
448 * DateBookDB does remove repeating events not by uid but by the time 452 * DateBookDB does remove repeating events not by uid but by the time
449 * the recurrence was created 453 * the recurrence was created
450 * so we need to update that time as well 454 * so we need to update that time as well
451 */ 455 */
452 Event::RepeatPattern rp = newEv.repeatPattern(); 456 Event::RepeatPattern rp = newEv.repeatPattern();
453 rp.createTime = ::time( NULL ); 457 rp.createTime = ::time( NULL );
454 newEv.setRepeat( TRUE, rp ); // has repeat and repeatPattern... 458 newEv.setRepeat( TRUE, rp ); // has repeat and repeatPattern...
459 if( newEv.uid() == e.uid() || !newEv.isValidUid() )
460 newEv.assignUid();
455 461
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp
index 770410e..84b4f1b 100644
--- a/core/pim/datebook/datebookweekheaderimpl.cpp
+++ b/core/pim/datebook/datebookweekheaderimpl.cpp
@@ -100,8 +100,8 @@ void DateBookWeekHeader::setDate(const QDate &d) {
100 dayofweek=d.dayOfWeek(); 100 dayofweek=d.dayOfWeek();
101 if(bStartOnMonday) 101 if(bStartOnMonday)
102 dayofweek--; 102 dayofweek--;
103 else if( dayofweek == 7 ) 103 else if( dayofweek == 7 )
104 /* we already have the right day -7 would lead to the current week..*/ 104 // we already have the right day -7 would lead to the current week..
105 dayofweek = 0; 105 dayofweek = 0;
106 106
107 date=date.addDays(-dayofweek); 107 date=date.addDays(-dayofweek);
@@ -111,6 +111,7 @@ void DateBookWeekHeader::setDate(const QDate &d) {
111 labelDate->setText( QString::number(start.day()) + "." + 111 labelDate->setText( QString::number(start.day()) + "." +
112 start.monthName(start.month()) + "-" + 112 Calendar::nameOfMonth( start.month()) + "-" +
113 QString::number(stop.day()) + "." + 113 QString::number(stop.day()) + "." +
114 start.monthName(stop.month()) +" ("+ 114 Calendar::nameOfMonth( stop.month()) +" ("+
115 tr("w")+":"+QString::number( week ) +")"); 115 tr("w")+":"+QString::number( week ) +")");
116 date = d; // bugfix: 0001126 - date has to be the selected date, not monday!
116 emit dateChanged(date); 117 emit dateChanged(date);
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index aad1f3a..24fb0ba 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -2,3 +2,2 @@
2 2
3#include "datebookweekheaderimpl.h"
4 3
@@ -6,7 +5,2 @@
6 5
7#include <qpe/calendar.h>
8#include <qpe/datebookdb.h>
9#include <qpe/event.h>
10#include <qpe/qpeapplication.h>
11#include <qpe/timestring.h>
12#include <qpe/datebookmonth.h> 6#include <qpe/datebookmonth.h>
@@ -14,15 +8,6 @@
14#include <qpe/resource.h> 8#include <qpe/resource.h>
9#include <qpe/calendar.h>
15 10
16#include <qdatetime.h>
17#include <qheader.h>
18#include <qlabel.h>
19#include <qlayout.h> 11#include <qlayout.h>
20#include <qpainter.h>
21#include <qpopupmenu.h>
22#include <qtimer.h>
23#include <qstyle.h>
24#include <qtoolbutton.h> 12#include <qtoolbutton.h>
25#include <qvbox.h>
26#include <qsizepolicy.h>
27#include <qabstractlayout.h>
28#include <qtl.h> 13#include <qtl.h>
@@ -75,6 +60,7 @@ void DateBookWeekLstHeader::setDate(const QDate &d) {
75 labelDate->setText( QString::number(start.day()) + "." + 60 labelDate->setText( QString::number(start.day()) + "." +
76 start.monthName(start.month()) + "-" + 61 Calendar::nameOfMonth( start.month() ) + "-" +
77 QString::number(stop.day()) + "." + 62 QString::number(stop.day()) + "." +
78 start.monthName(stop.month()) +" ("+ 63 Calendar::nameOfMonth( stop.month()) +" ("+
79 tr("w")+":"+QString::number( week ) +")"); 64 tr("w")+":"+QString::number( week ) +")");
65 date = d; // bugfix: 0001126 - date has to be the selected date, not monday!
80 emit dateChanged(date); 66 emit dateChanged(date);
@@ -127,4 +113,6 @@ DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool /* onM */,
127 113
114 //dont use dayOfWeek() to save space !
128 label->setText( QString(QObject::tr(QString(QChar(day)))) + " " +QString::number(d.day()) ); 115 label->setText( QString(QObject::tr(QString(QChar(day)))) + " " +QString::number(d.day()) );
129 add->setText("+"); 116
117 add->setText("+");
130 118
@@ -343,4 +331,19 @@ QDate DateBookWeekLst::date() {
343 331
332// return the date at the beginning of the week...
333// copied from DateBookWeek
334QDate DateBookWeekLst::weekDate() const
335{
336 QDate d=bdate;
337
338 // Calculate offset to first day of week.
339 int dayoffset=d.dayOfWeek();
340 if(bStartOnMonday) dayoffset--;
341 else if( dayoffset == 7 )
342 dayoffset = 0;
343
344 return d.addDays(-dayoffset);
345}
346
344void DateBookWeekLst::getEvents() { 347void DateBookWeekLst::getEvents() {
345 QDate start = date(); 348 QDate start = weekDate(); //date();
346 QDate stop = start.addDays(6); 349 QDate stop = start.addDays(6);
diff --git a/core/pim/datebook/datebookweeklst.h b/core/pim/datebook/datebookweeklst.h
index 0bfbcda..f683ce7 100644
--- a/core/pim/datebook/datebookweeklst.h
+++ b/core/pim/datebook/datebookweeklst.h
@@ -122,2 +122,3 @@ public:
122 QDate date(); 122 QDate date();
123 QDate weekDate() const;
123 124