-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() | |||
1606 | { | 1606 | { |
1607 | #ifndef KORG_NOKABC | 1607 | #ifndef KORG_NOKABC |
1608 | 1608 | ||
1609 | #ifdef DESKTOP_VERSION | 1609 | #ifdef DESKTOP_VERSION |
1610 | int curCal = mCalendar->defaultCalendar(); | ||
1611 | int bd = mCalEditView->getBirtdayID(); | ||
1612 | if ( bd == 0 ) | ||
1613 | return; | ||
1614 | mCalendar->setDefaultCalendar( bd ); | ||
1610 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 1615 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
1611 | KABC::AddressBook::Iterator it; | 1616 | KABC::AddressBook::Iterator it; |
1612 | int count = 0; | 1617 | int count = 0; |
1613 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 1618 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
@@ -1644,8 +1649,9 @@ bool CalendarView::importBday() | |||
1644 | if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) | 1649 | if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) |
1645 | ++addCount; | 1650 | ++addCount; |
1646 | } | 1651 | } |
1647 | } | 1652 | } |
1653 | mCalendar->setDefaultCalendar( curCal ); | ||
1648 | updateView(); | 1654 | updateView(); |
1649 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); | 1655 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); |
1650 | #else //DESKTOP_VERSION | 1656 | #else //DESKTOP_VERSION |
1651 | 1657 | ||
@@ -1665,11 +1671,19 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd | |||
1665 | const QStringList& anniversaryList, const QStringList& realNameList, | 1671 | const QStringList& anniversaryList, const QStringList& realNameList, |
1666 | const QStringList& emailList, const QStringList& assembledNameList, | 1672 | const QStringList& emailList, const QStringList& assembledNameList, |
1667 | const QStringList& uidList) | 1673 | const QStringList& uidList) |
1668 | { | 1674 | { |
1675 | |||
1669 | //qDebug("KO::CalendarView::insertBirthdays"); | 1676 | //qDebug("KO::CalendarView::insertBirthdays"); |
1670 | if (uid == this->name()) | 1677 | if (uid == this->name()) |
1671 | { | 1678 | { |
1679 | int curCal = mCalendar->defaultCalendar(); | ||
1680 | int bd = mCalEditView->getBirtdayID(); | ||
1681 | if ( bd == 0 ) | ||
1682 | return; | ||
1683 | mCalendar->setDefaultCalendar( bd ); | ||
1684 | |||
1685 | |||
1672 | int count = birthdayList.count(); | 1686 | int count = birthdayList.count(); |
1673 | int addCount = 0; | 1687 | int addCount = 0; |
1674 | KCal::Attendee* a = 0; | 1688 | KCal::Attendee* a = 0; |
1675 | 1689 | ||
@@ -1730,8 +1744,9 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd | |||
1730 | ++addCount; | 1744 | ++addCount; |
1731 | } | 1745 | } |
1732 | } | 1746 | } |
1733 | 1747 | ||
1748 | mCalendar->setDefaultCalendar( curCal ); | ||
1734 | updateView(); | 1749 | updateView(); |
1735 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); | 1750 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); |
1736 | 1751 | ||
1737 | } | 1752 | } |