summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp21
-rw-r--r--libkcal/kincidenceformatter.cpp22
-rw-r--r--libkcal/recurrence.cpp2
-rw-r--r--microkde/kdeui/ktoolbar.cpp2
-rw-r--r--microkde/kdeui/ktoolbar.h2
5 files changed, 30 insertions, 19 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index de11c13..39921a0 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -305,16 +305,19 @@ void KOEventViewer::appendEvent(Event *event, int mode )
addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
- bool last;
+ bool ok;
QDate start = QDate::currentDate();
- QDate next;
- next = event->recurrence()->getPreviousDate( start , &last );
- if ( !last ) {
- next = event->recurrence()->getNextDate( start.addDays( - 1 ) );
+ QDateTime next;
+ next = event->getNextOccurence( QDateTime::currentDateTime() , &ok );
+ if ( ok ) {
addTag("p",i18n("<b>Next recurrence is on:</b>") );
- addTag("p", KGlobal::locale()->formatDate( next, shortDate ));
- QDateTime nextdt = QDateTime( next, event->dtStart().time());
- mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true );
+ addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
+ mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true );
} else {
+ bool last;
+ QDate nextd;
+ nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last );
+ if ( last ) {
addTag("p",i18n("<b>Last recurrence was on:</b>") );
- addTag("p", KGlobal::locale()->formatDate( next, shortDate ));
+ addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
+ }
}
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 6d07d4c..0d9c3f4 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -106,13 +106,19 @@ void KIncidenceFormatter::setEvent(Event *event)
addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
- bool last;
+
+ bool ok;
QDate start = QDate::currentDate();
- QDate next;
- next = event->recurrence()->getPreviousDate( start , &last );
- if ( !last ) {
- next = event->recurrence()->getNextDate( start.addDays( - 1 ) );
- addTag("p",i18n("Next recurrence is on: ")+ KGlobal::locale()->formatDate( next, shortDate ) );
- //addTag("p", KGlobal::locale()->formatDate( next, shortDate ));
+ QDateTime next;
+ next = event->getNextOccurence( QDateTime::currentDateTime() , &ok );
+ if ( ok ) {
+ addTag("p",i18n("<b>Next recurrence is on:</b>") );
+ addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
+
} else {
+ bool last;
+ QDate nextd;
+ nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last );
+ if ( last ) {
addTag("p",i18n("<b>Last recurrence was on:</b>") );
- addTag("p", KGlobal::locale()->formatDate( next, shortDate ));
+ addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
+ }
}
diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp
index e84f672..5181eaf 100644
--- a/libkcal/recurrence.cpp
+++ b/libkcal/recurrence.cpp
@@ -881,2 +881,3 @@ QDate Recurrence::getNextDate(const QDate &preDate, bool *last) const
case rYearlyPos:
+ qDebug("Recurrence::getNextDate: MAY BE BROKEN ");
return getNextDateNoTime(preDate, last);
@@ -1168,2 +1169,3 @@ QDate Recurrence::getNextDateNoTime(const QDate &preDate, bool *last) const
{
+
if (last)
diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp
index 09ad0c8..35d4916 100644
--- a/microkde/kdeui/ktoolbar.cpp
+++ b/microkde/kdeui/ktoolbar.cpp
@@ -880,3 +880,3 @@ void KToolBar::setBarPos (BarPosition bpos)
-KToolBar::BarPosition KToolBar::barPos() const
+const KToolBar::BarPosition KToolBar::barPos()
{
diff --git a/microkde/kdeui/ktoolbar.h b/microkde/kdeui/ktoolbar.h
index 49ff856..7a5c114 100644
--- a/microkde/kdeui/ktoolbar.h
+++ b/microkde/kdeui/ktoolbar.h
@@ -748,3 +748,3 @@ public:
*/
- BarPosition barPos() const;
+ const BarPosition barPos();