summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/koagenda.cpp4
-rw-r--r--korganizer/koagendaitem.cpp2
-rw-r--r--korganizer/koagendaview.cpp2
-rw-r--r--korganizer/kodaymatrix.cpp2
-rw-r--r--korganizer/koeditorrecurrence.cpp172
-rw-r--r--korganizer/koeventviewer.cpp6
-rw-r--r--korganizer/kolistview.cpp4
-rw-r--r--korganizer/komonthview.cpp6
-rw-r--r--korganizer/kotodoeditor.cpp3
-rw-r--r--korganizer/kowhatsnextview.cpp4
11 files changed, 108 insertions, 99 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index a76f2ed..a9d42f0 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3750,25 +3750,25 @@ void CalendarView::deleteJournal(Journal *jour)
updateView();
}
emit updateSearchDialog();
}
void CalendarView::deleteEvent(Event *anEvent)
{
if (!anEvent) {
KNotifyClient::beep();
return;
}
- if (anEvent->recurrence()->doesRecur()) {
+ if (anEvent->doesRecur()) {
QDate itemDate = mViewManager->currentSelectionDate();
int km;
if (!itemDate.isValid()) {
//kdDebug() << "Date Not Valid" << endl;
if (KOPrefs::instance()->mConfirm) {
km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
i18n("KO/Pi Confirmation"),i18n("Delete All"));
if ( km == KMessageBox::Continue )
km = KMessageBox::No; // No = all below
} else
km = KMessageBox::No;
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 0dd5ef5..c738f7e 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -570,25 +570,25 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
mPopupItem = (KOAgendaItem *)object;
mPopupKind = 1;
if (me->button() == RightButton) {
mPopupKind = 3;
popupMenu();
} else if (me->button() == LeftButton) {
mActionItem = (KOAgendaItem *)object;
if (mActionItem) {
emit signalClearSelection();
slotClearSelection();
selectItem(mActionItem);
Incidence *incidence = mActionItem->incidence();
- if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) {
+ if ( incidence->isReadOnly() /*|| incidence->doesRecur() */) {
mActionItem = 0;
} else {
startItemAction(viewportPos);
}
}
}
} else { // ---------- viewport()
mPopupItem = 0;
mPopupKind = 2;
selectItem(0);
mActionItem = 0;
if (me->button() == RightButton) {
@@ -990,25 +990,25 @@ void KOAgenda::performItemAction(QPoint viewportPos)
mCurrentCellY = gy;
}
}
void KOAgenda::endItemAction()
{
if ( mItemMoved ) {
KOAgendaItem *placeItem = mActionItem->firstMultiItem();
if ( !placeItem ) {
placeItem = mActionItem;
}
- if ( placeItem->incidence()->recurrence()->doesRecur() ) {
+ if ( placeItem->incidence()->doesRecur() ) {
Incidence* oldInc = placeItem->incidence();
placeItem->recreateIncidence();
emit addToCalSignal(placeItem->incidence(), oldInc );
}
int type = mActionType;
if ( mAllDayMode )
type = -1;
KOAgendaItem *modifiedItem = placeItem;
//emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */);
QPtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems();
KOAgendaItem *item;
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 303a92a..49ad9b8 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -225,25 +225,25 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red );
if ( horLayout )
++xOff;
else
++yOff;
}
- if (mIncidence->recurrence()->doesRecur()) {
+ if (mIncidence->doesRecur()) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue );
if ( horLayout )
++xOff;
else
++yOff;
}
if (mIncidence->description().length() > 0) {
p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen );
if ( horLayout )
++xOff;
else
++yOff;
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index a01323a..04f30bb 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1192,25 +1192,25 @@ void KOAgendaView::fillAgenda()
Event *event = dayEvents.at(numEvent);
if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") )
if ( event->uid().left(15) == QString("last-syncEvent-") )
continue;
// kdDebug() << " Event: " << event->summary() << endl;
int beginX = currentDate.daysTo(event->dtStart().date()) + curCol;
int endX = currentDate.daysTo(event->dtEnd().date()) + curCol;
// kdDebug() << " beginX: " << beginX << " endX: " << endX << endl;
if (event->doesFloat()) {
- if (event->recurrence()->doesRecur()) {
+ if (event->doesRecur()) {
if (event->isMultiDay() ) {
endX = endX - beginX;// endX is now number of days
if ( event->recursOn( currentDate ) ) {
endX += curCol;
beginX = curCol;
mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX);
} else {
//qDebug("days endX %d curCol %d max Col %d %s",endX ,curCol, maxCol, currentDate.toString().latin1());
if ( curCol == maxCol && maxCol+1 < endX ) {
int i;
for ( i = 1; i< endX; ++i ) {
if ( event->recursOn( currentDate.addDays( -i ) ) )
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index ec1154a..057df0d 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -444,25 +444,25 @@ void KODayMatrix::updateViewTimed()
QPtrList<Event> events = mCalendar->events();
Event *event;
QDateTime dt;
bool ok;
bDays.fill( false);
pDays.fill( false);
hDays.fill( false);
eDays.fill( false);
mHolidays.clear();
QDate mStartDate = days[0];
QDate endDate = mStartDate.addDays( timeSpan );
for( event = events.first(); event; event = events.next() ) { // for event
- ushort recurType = event->recurrence()->doesRecur();
+ ushort recurType = event->doesRecur();
if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
(recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
continue;
}
if ( event->doesRecur() ) {
bool last;
QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last );
QDateTime incidenceEnd;
int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() );
bool invalid = false;
while( true ) {
if ( incidenceStart.isValid() ) {
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index de4e4f7..89504db 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -888,140 +888,146 @@ void KOEditorRecurrence::readEvent(Incidence *event)
else
dtEnd = ((Todo*)event)->dtDue();
setDefaults( event->dtStart(), dtEnd );
QBitArray rDays( 7 );
QPtrList<Recurrence::rMonthPos> rmp;
QPtrList<int> rmd;
int day = 0;
int count = 0;
int month = 0;
setDateTimes( event->dtStart(), dtEnd );
- Recurrence *r = event->recurrence();
- int f = r->frequency();
+
- int recurs = r->doesRecur();
+ int recurs = event->doesRecur();
mEnabledCheck->setChecked( recurs );
setEnabled( recurs );
int recurrenceType = RecurrenceChooser::Weekly;
-
- switch ( recurs ) {
- case Recurrence::rNone:
- setDefaults( event->dtStart(), dtEnd );
- break;
- case Recurrence::rDaily:
- recurrenceType = RecurrenceChooser::Daily;
- mDaily->setFrequency( f );
- break;
- case Recurrence::rWeekly:
- recurrenceType = RecurrenceChooser::Weekly;
- mWeekly->setFrequency( f );
- mWeekly->setDays( r->days() );
- break;
- case Recurrence::rMonthlyPos:
- // we only handle one possibility in the list right now,
- // so I have hardcoded calls with first(). If we make the GUI
- // more extended, this can be changed.
- recurrenceType = RecurrenceChooser::Monthly;
-
- rmp = r->monthPositions();
- if ( rmp.first()->negative )
- count = 5 - rmp.first()->rPos - 1;
- else
- count = rmp.first()->rPos - 1;
- day = 0;
- while ( !rmp.first()->rDays.testBit( day ) ) ++day;
- mMonthly->setByPos( count, day );
-
- mMonthly->setFrequency( f );
-
- break;
- case Recurrence::rMonthlyDay:
- recurrenceType = RecurrenceChooser::Monthly;
-
- rmd = r->monthDays();
- day = *rmd.first() - 1;
- mMonthly->setByDay( day );
-
- mMonthly->setFrequency( f );
-
- break;
- case Recurrence::rYearlyMonth:
- {
- recurrenceType = RecurrenceChooser::Yearly;
- //qDebug("Recurrence::rYearlyMonth: ");
- day = event->dtStart().date().day();
- rmd = r->yearNums();
- if ( rmd.count() > 0 )
- month = *rmd.first();
- else
- month = event->dtStart().date().month() ;
- mYearly->setByMonth( month, day );
+ if ( recurs ) {
+ Recurrence *r = event->recurrence();
+ int f = r->frequency();
+ switch ( recurs ) {
+ case Recurrence::rNone:
+ setDefaults( event->dtStart(), dtEnd );
+ break;
+ case Recurrence::rDaily:
+ recurrenceType = RecurrenceChooser::Daily;
+ mDaily->setFrequency( f );
+ break;
+ case Recurrence::rWeekly:
+ recurrenceType = RecurrenceChooser::Weekly;
+ mWeekly->setFrequency( f );
+ mWeekly->setDays( r->days() );
+ break;
+ case Recurrence::rMonthlyPos:
+ // we only handle one possibility in the list right now,
+ // so I have hardcoded calls with first(). If we make the GUI
+ // more extended, this can be changed.
+ recurrenceType = RecurrenceChooser::Monthly;
+
+ rmp = r->monthPositions();
+ if ( rmp.first()->negative )
+ count = 5 - rmp.first()->rPos - 1;
+ else
+ count = rmp.first()->rPos - 1;
+ day = 0;
+ while ( !rmp.first()->rDays.testBit( day ) ) ++day;
+ mMonthly->setByPos( count, day );
+
+ mMonthly->setFrequency( f );
+
+ break;
+ case Recurrence::rMonthlyDay:
+ recurrenceType = RecurrenceChooser::Monthly;
+
+ rmd = r->monthDays();
+ day = *rmd.first() - 1;
+ mMonthly->setByDay( day );
+
+ mMonthly->setFrequency( f );
+
+ break;
+ case Recurrence::rYearlyMonth:
+ {
+ recurrenceType = RecurrenceChooser::Yearly;
+ //qDebug("Recurrence::rYearlyMonth: ");
+ day = event->dtStart().date().day();
+ rmd = r->yearNums();
+ if ( rmd.count() > 0 )
+ month = *rmd.first();
+ else
+ month = event->dtStart().date().month() ;
+ mYearly->setByMonth( month, day );
#if 0
- //qDebug("2day = %d ",day );
- QPtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions();
- int month;
- if ( !monthlist.isEmpty() ) {
- month = monthlist.first()->rPos ;
- } else {
- month = event->dtStart().date().month() ;
- }
- mYearly->setByMonth( day, month );
+ //qDebug("2day = %d ",day );
+ QPtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions();
+ int month;
+ if ( !monthlist.isEmpty() ) {
+ month = monthlist.first()->rPos ;
+ } else {
+ month = event->dtStart().date().month() ;
+ }
+ mYearly->setByMonth( day, month );
#endif
- mYearly->setFrequency( f );
- }
+ mYearly->setFrequency( f );
+ }
- break;
- case Recurrence::rYearlyDay:
- //qDebug("Recurrence::rYearlyDay: ");
- recurrenceType = RecurrenceChooser::Yearly;
- mYearly->setByDay( event->dtStart().date().dayOfYear() );
- mYearly->setFrequency( f );
- break;
- default:
- setDefaults( event->dtStart(), dtEnd );
- break;
+ break;
+ case Recurrence::rYearlyDay:
+ //qDebug("Recurrence::rYearlyDay: ");
+ recurrenceType = RecurrenceChooser::Yearly;
+ mYearly->setByDay( event->dtStart().date().dayOfYear() );
+ mYearly->setFrequency( f );
+ break;
+ default:
+ setDefaults( event->dtStart(), dtEnd );
+ break;
+ }
}
-
mRecurrenceChooser->setType( recurrenceType );
showCurrentRule( recurrenceType );
mRecurrenceRange->setDateTimes( event->dtStart() );
- if ( r->doesRecur() ) {
+ if ( event->doesRecur() ) {
+ Recurrence *r = event->recurrence();
mRecurrenceRange->setDuration( r->duration() );
if ( r->duration() == 0 )
{
if ( r->endDate() < event->dtStart().date() )
mRecurrenceRange->setEndDate( event->dtStart().date() );
else
mRecurrenceRange->setEndDate( r->endDate() );
} else
mRecurrenceRange->setEndDate( event->dtStart().date() );
}
mExceptions->setDates( event->exDates() );
}
void KOEditorRecurrence::writeEvent( Incidence *event )
{
- Recurrence *r = event->recurrence();
+
- // clear out any old settings;
- r->unsetRecurs();
+ if ( !mEnabledCheck->isChecked() ) {
+ if ( event->doesRecur() )
+ event->recurrence()->unsetRecurs();
+ } else {
+ Recurrence *r = event->recurrence();
- if ( mEnabledCheck->isChecked() ) {
+ // clear out any old settings;
+ r->unsetRecurs();
int duration = mRecurrenceRange->duration();
QDate endDate;
if ( duration == 0 ) endDate = mRecurrenceRange->endDate();
int recurrenceType = mRecurrenceChooser->type();
if ( recurrenceType == RecurrenceChooser::Daily ) {
int freq = mDaily->frequency();
if ( duration != 0 ) r->setDaily( freq, duration );
else r->setDaily( freq, endDate );
} else if ( recurrenceType == RecurrenceChooser::Weekly ) {
int freq = mWeekly->frequency();
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index a690ab1..db695f5 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -338,27 +338,27 @@ void KOEventViewer::appendEvent(Event *event, int mode )
} else {
mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>")
.arg(event->dtStartTimeStr())
.arg(event->dtEndTimeStr()));
mText.append(i18n("<p><b>On:</b> %1</p> ")
.arg(event->dtStartDateStr( shortDate )));
}
}
if (!event->location().isEmpty()) {
addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) );
mMailSubject += i18n(" at ") + event->location();
}
- if (event->recurrence()->doesRecur()) {
+ if (event->doesRecur()) {
- QString recurText = event->recurrence()->recurrenceText();
+ QString recurText = event->recurrenceText();
addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
bool ok;
QDate start = QDate::currentDate();
QDateTime next;
next = event->getNextOccurence( QDateTime::currentDateTime() , &ok );
if ( ok ) {
if ( wideScreen ){
addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) );
} else {
addTag("p",i18n("<b>Next recurrence is on:</b>") );
addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
}
@@ -472,25 +472,25 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
}
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
addTag("i",i18n("This todo has been cancelled!"));
mText.append("<br>");
mText += "</font>";
mMailSubject += i18n("(cancelled)");
}
- if (event->recurrence()->doesRecur()) {
+ if (event->doesRecur()) {
QString recurText = event->recurrence()->recurrenceText();
addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
}
if (event->hasStartDate()) {
mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
}
if (event->hasDueDate()) {
mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
mMailSubject += i18n(" - " )+event->dtDueStr( true );
}
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index d25f671..e7a5e0e 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -124,25 +124,25 @@ bool ListItemVisitor::visit(Event *e)
else
mItem->setText(2,e->dtStartTimeStr());
mItem->setText(3,end);
if ( e->doesFloat() )
mItem->setText(4,"---");
else
mItem->setText(4,e->dtEndTimeStr());
if ( e->isAlarmEnabled() ) {
mItem->setText(5,e->alarms().first()->offsetText() );
} else {
mItem->setText(5, i18n("No"));
}
- mItem->setText(6, e->recurrence()->recurrenceText());
+ mItem->setText(6, e->recurrenceText());
if( ! e->doesRecur() )
mItem->setSortKey( 6, "-" );
mItem->setText(7,"---");
mItem->setText(8,"---");
mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No"));
mItem->setText(10,e->categoriesStr());
mItem->setText(11, KOPrefs::instance()->calName( e->calID() ));
mItem->setText(12, KGlobal::locale()->formatDateTime( e->lastModified(), true, true ));
QString key;
QDate d = e->lastModified().date();
QTime t = e->lastModified().time();
@@ -175,25 +175,25 @@ bool ListItemVisitor::visit(Todo *t)
}
} else {
mItem->setText(1,"---");
mItem->setText(2,"---");
}
mItem->setText(3,"---");
mItem->setText(4,"---");
if ( t->isAlarmEnabled() ) {
mItem->setText(5,t->alarms().first()->offsetText() );
} else {
mItem->setText(5, i18n("No"));
}
- mItem->setText(6, t->recurrence()->recurrenceText());
+ mItem->setText(6, t->recurrenceText());
if( ! t->doesRecur() )
mItem->setSortKey( 6, "-" );
if (t->hasDueDate()) {
mItem->setText(7,t->dtDueDateStr());
if (t->doesFloat()) {
mItem->setText(8,"---");
} else {
mItem->setText(8,t->dtDueTimeStr());
}
} else {
mItem->setText(7,"---");
mItem->setText(8,"---");
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 498d9b0..eea9a4d 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -778,25 +778,25 @@ int MonthViewCell::insertEvent(Event *event)
//pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() ));
} else {
pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
}
}
} else {
pal = mStandardPalette ;
}
pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor);
item->setPalette( pal );
- item->setRecur( event->recurrence()->doesRecur() );
+ item->setRecur( event->doesRecur() );
item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() );
item->setMoreInfo( event->description().length() > 0 );
#ifdef DESKTOP_VERSION
Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails,
KOPrefs::instance()->email());
if ( me != 0 ) {
if ( me->status() == Attendee::NeedsAction && me->RSVP())
item->setReply(true && multiday < 2);
else
item->setReply(false);
} else
item->setReply(false);
@@ -869,25 +869,25 @@ void MonthViewCell::insertTodo(Todo *todo)
//pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
pal = QPalette(KOPrefs::instance()->defaultColor( todo->calID() ), KOPrefs::instance()->defaultColor( todo->calID() ));
} else {
pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
}
}
} else {
pal = mStandardPalette ;
}
pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor);
item->setPalette( pal );
- item->setRecur( todo->recurrence()->doesRecur() );
+ item->setRecur( todo->doesRecur() );
item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() );
item->setMoreInfo( todo->description().length() > 0 );
insertItem( item , count());
#ifdef DESKTOP_VERSION
mToolTip.append( text );
#endif
}
void MonthViewCell::repaintfinishUpdateCell()
{
MonthViewItem *mitem = (MonthViewItem*) firstItem ();
while ( mitem ) {
mitem->setBlockRepaint( false );
@@ -1096,24 +1096,26 @@ void MonthViewCell::cellClicked( QListBoxItem *item )
return;
}
}
void MonthViewCell::contextMenu( QListBoxItem *item )
{
mMonthView->setPopupCell( this );
if ( !item ) {
mMonthView->showContextMenu( 0 );
return;
}
+ //selection( item );
+ //qApp->processEvents();
MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
Incidence *incidence = eventItem->incidence();
if ( incidence ) mMonthView->showContextMenu( incidence );
}
void MonthViewCell::selection( QListBoxItem *item )
{
if ( !item ) {
emit highlightIncidence( 0 , this, 0 );
return;
}
MonthViewItem * it = (static_cast<MonthViewItem *>( item ));
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 100a81b..682f83b 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -368,25 +368,26 @@ void KOTodoEditor::writeTodo(Todo *event)
mRecurrence->writeEvent(event);
if ( event->doesRecur() ) {
int addSec = -1 ;
if ( maybeComputeRecurrenceTime && event->percentComplete() == 100 )
addSec = 1;
event->setRecurrenceID( event->dtStart().addSecs( addSec ) );
event->setRecurDates();
} else {
event->setHasRecurrenceID( false );
}
} else {
event->setHasRecurrenceID( false );
- event->recurrence()->unsetRecurs();
+ if ( event->doesRecur() )
+ event->recurrence()->unsetRecurs();
}
}
bool KOTodoEditor::validateInput()
{
if (!mGeneral->validateInput()) return false;
if (!mDetails->validateInput()) return false;
return true;
}
int KOTodoEditor::msgItemDelete()
{
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index fafcb58..f88403c 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -498,25 +498,25 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
tempText += "<tr><td><b>";
if (ev->typeID() == eventID ) {
if (reply) {
if (!ev->doesFloat())
tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": ";
else
tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
} else {
if (!ev->doesFloat()) {
Event *event = static_cast<Event *>(ev);
QDateTime st,end;
- if ( event->recurrence()->doesRecur() ) {
+ if ( event->doesRecur() ) {
QDate recDate= mEventDate;
int days = event->dtStart().date().daysTo (event->dtEnd().date() );
while ( ! event->recursOn( recDate ) ) {
recDate = recDate.addDays( -1 );
}
st = QDateTime ( recDate, event->dtStart().time() );
end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() );
}
else {
st = event->dtStart();
end = event->dtEnd();
@@ -613,25 +613,25 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
if ( !needClose)
tempText +="[";
tempText += "a";
needClose =true;
}
if ( ev->description().length() > 0 ) {
if ( !needClose)
tempText +="[";
tempText += "i";
needClose =true;
}
- if ( ev->recurrence()->doesRecur() ) {
+ if ( ev->doesRecur() ) {
if ( !needClose)
tempText +="[";
tempText += "r";
needClose =true;
}
if ( needClose ) {
tempText += "] ";
}
if ( ev->cancelled() )
tempText += "</font>";
tempText += "<a ";
if (ev->typeID() == eventID ) tempText += "href=\"event:";