summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1d5a57e..257a4dd 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1514,29 +1514,32 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd
}
bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
{
//qDebug("addAnni ");
Event * ev = new Event();
if ( a ) {
ev->addAttendee( a );
}
QString kind;
- if ( birthday )
+ if ( birthday ) {
kind = i18n( "Birthday" );
- else
+ ev->setSummary( name + " (" + QString::number(date.year()) +")");
+ }
+ else {
kind = i18n( "Anniversary" );
- ev->setSummary( name + " - " + kind );
+ ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind );
+ }
ev->setOrganizer(a->email());
ev->setCategories( kind );
ev->setDtStart( QDateTime(date) );
ev->setDtEnd( QDateTime(date) );
ev->setFloats( true );
Recurrence * rec = ev->recurrence();
rec->setYearly(Recurrence::rYearlyMonth,1,-1);
rec->addYearlyNum( date.month() );
if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
delete ev;
return false;
}
@@ -2502,39 +2505,41 @@ void CalendarView::showDatePicker( )
mDatePickerMode = 1;
mDatePicker->setDate( mNavigator->selectedDates().first() );
}
void CalendarView::showEventEditor()
{
#ifdef DESKTOP_VERSION
mEventEditor->show();
#else
if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
+ qApp->processEvents();
delete mEventEditor;
mEventEditor = mDialogManager->getEventEditor();
topLevelWidget()->setCaption( i18n("") );
}
mEventEditor->showMaximized();
#endif
}
void CalendarView::showTodoEditor()
{
#ifdef DESKTOP_VERSION
mTodoEditor->show();
#else
if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
+ qApp->processEvents();
delete mTodoEditor;
mTodoEditor = mDialogManager->getTodoEditor();
topLevelWidget()->setCaption( i18n("") );
}
mTodoEditor->showMaximized();
#endif
}
void CalendarView::cloneIncidence()
{
Incidence *incidence = currentSelection();
if ( !incidence ) incidence = mTodoList->selectedIncidences().first();