diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(KDEPIMLIBS_VERSION_MAJOR 4) set(KDEPIMLIBS_VERSION_MINOR 13) set(KDEPIMLIBS_VERSION_PATCH 0) -set(KDEPIMLIBS_VERSION_KOLAB 24) +set(KDEPIMLIBS_VERSION_KOLAB 25) set(KDEPIMLIBS_VERSION ${KDEPIMLIBS_VERSION_MAJOR}.${KDEPIMLIBS_VERSION_MINOR}.${KDEPIMLIBS_VERSION_PATCH}.${KDEPIMLIBS_VERSION_KOLAB}) diff --git a/akonadi/calendar/calendarbase.cpp b/akonadi/calendar/calendarbase.cpp --- a/akonadi/calendar/calendarbase.cpp +++ b/akonadi/calendar/calendarbase.cpp @@ -246,8 +246,15 @@ << "Please fix it. Ignoring this incidence."; return; } - const QString calendar = QString::number(item.parentCollection().id()); + QString calendar = QString::number(item.parentCollection().id()); + + // With virtual collections, it can happen, that we have exceptions in other calendars that the mainevent. + // For displaying all exceptions, we have to save them also in storage collection to have a unified way to get all exceptions. + if ((item.parentCollection().id() != item.storageCollectionId()) && (incidence->hasRecurrenceId() || incidence->recurs())) { + calendar = QString::number(item.storageCollectionId()); + } Q_ASSERT(!calendar.isEmpty()); + const QString uniqueInstanceIdentifier = calendar + incidence->instanceIdentifier(); if (mItemIdByUniqueInstanceIdentifier.contains(uniqueInstanceIdentifier) && mItemIdByUniqueInstanceIdentifier[uniqueInstanceIdentifier].id() != item.id()) { @@ -282,21 +289,11 @@ incidence->setCustomProperty("VOLATILE", "AKONADI-ID", QString::number(item.id())); incidence->cancelUpdates(); - // With virtual collections, it can happen, that we have exceptions in other calendars that the mainevent. - // For displaying all exceptions, we have to save them also in storage collection to have a unified way to get all exceptions. - if ((item.parentCollection().id() != item.storageCollectionId()) && (incidence->hasRecurrenceId() || incidence->recurs())) { - const bool result = q->MultiCalendar::addIncidenceToCalendar(QString::number(item.storageCollectionId()), incidence); - if (!result) { - kError() << "Error adding incidence " << itemToString(item); - Q_ASSERT(false); - } - } else { - // Must be the last one due to re-entrancy - const bool result = q->MultiCalendar::addIncidenceToCalendar(calendar, incidence); - if (!result) { - kError() << "Error adding incidence " << itemToString(item); - Q_ASSERT(false); - } + // Must be the last one due to re-entrancy + const bool result = q->MultiCalendar::addIncidenceToCalendar(calendar, incidence); + if (!result) { + kError() << "Error adding incidence " << itemToString(item); + Q_ASSERT(false); } } diff --git a/akonadi/calendar/etmcalendar_p.h b/akonadi/calendar/etmcalendar_p.h --- a/akonadi/calendar/etmcalendar_p.h +++ b/akonadi/calendar/etmcalendar_p.h @@ -173,7 +173,7 @@ QHash mCollections; QSet mCollectionJobs; - QHash mItemByStorageCollection; + QMultiHash mItemByStorageCollection; }; }