-rw-r--r-- | korganizer/calendarview.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 08909ed..f179c58 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1606,8 +1606,13 @@ bool CalendarView::importBday() { #ifndef KORG_NOKABC #ifdef DESKTOP_VERSION + int curCal = mCalendar->defaultCalendar(); + int bd = mCalEditView->getBirtdayID(); + if ( bd == 0 ) + return; + mCalendar->setDefaultCalendar( bd ); KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); KABC::AddressBook::Iterator it; int count = 0; for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { @@ -1644,8 +1649,9 @@ bool CalendarView::importBday() if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) ++addCount; } } + mCalendar->setDefaultCalendar( curCal ); updateView(); topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); #else //DESKTOP_VERSION @@ -1665,11 +1671,19 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd const QStringList& anniversaryList, const QStringList& realNameList, const QStringList& emailList, const QStringList& assembledNameList, const QStringList& uidList) { + //qDebug("KO::CalendarView::insertBirthdays"); if (uid == this->name()) - { + { + int curCal = mCalendar->defaultCalendar(); + int bd = mCalEditView->getBirtdayID(); + if ( bd == 0 ) + return; + mCalendar->setDefaultCalendar( bd ); + + int count = birthdayList.count(); int addCount = 0; KCal::Attendee* a = 0; @@ -1730,8 +1744,9 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd ++addCount; } } + mCalendar->setDefaultCalendar( curCal ); updateView(); topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); } |