-rw-r--r-- | korganizer/koeditorrecurrence.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp index 0e74a99..e0380c4 100644 --- a/korganizer/koeditorrecurrence.cpp +++ b/korganizer/koeditorrecurrence.cpp @@ -404,48 +404,50 @@ ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) : boxLayout->addWidget( deleteExceptionButton, 3, 0 ); mExceptionList = new QListBox( box ); boxLayout->addMultiCellWidget( mExceptionList, 0, 3, 1, 1 ); boxLayout->setRowStretch( 4, 1 ); boxLayout->setColStretch( 1, 3 ); connect( addExceptionButton, SIGNAL( clicked() ), SLOT( addException() ) ); connect( changeExceptionButton, SIGNAL( clicked() ), SLOT( changeException() ) ); connect( deleteExceptionButton, SIGNAL( clicked() ), SLOT( deleteException() ) ); if ( QApplication::desktop()->width() < 480 ) { setMinimumWidth( 220 ); } else { setMinimumWidth( 440 ); mExceptionDateEdit->setMinimumWidth( 200 ); } } void ExceptionsWidget::setDefaults( const QDateTime &from ) { + mExceptionList->clear(); + mExceptionDates.clear(); mExceptionDateEdit->setDate( from.date() ); } void ExceptionsWidget::addException() { QDate date = mExceptionDateEdit->date(); QString dateStr = KGlobal::locale()->formatDate( date ); if( !mExceptionList->findItem( dateStr ) ) { mExceptionDates.append( date ); mExceptionList->insertItem( dateStr ); } } void ExceptionsWidget::changeException() { int pos = mExceptionList->currentItem(); if ( pos < 0 ) return; QDate date = mExceptionDateEdit->date(); mExceptionDates[ pos ] = date; mExceptionList->changeItem( KGlobal::locale()->formatDate( date ), pos ); } void ExceptionsWidget::deleteException() |