Changeset View
Changeset View
Standalone View
Standalone View
src/etmcalendar.cpp
Show First 20 Lines • Show All 543 Lines • ▼ Show 20 Line(s) | 542 | KCalCore::Alarm::List ETMCalendar::alarms(const QDateTime &from, | |||
---|---|---|---|---|---|
544 | bool excludeBlockedAlarms) const | 544 | bool excludeBlockedAlarms) const | ||
545 | { | 545 | { | ||
546 | Q_D(const ETMCalendar); | 546 | Q_D(const ETMCalendar); | ||
547 | KCalCore::Alarm::List alarmList; | 547 | KCalCore::Alarm::List alarmList; | ||
548 | QHashIterator<Akonadi::Item::Id, Akonadi::Item> i(d->mItemById); | 548 | QHashIterator<Akonadi::Item::Id, Akonadi::Item> i(d->mItemById); | ||
549 | while (i.hasNext()) { | 549 | while (i.hasNext()) { | ||
550 | const Akonadi::Item item = i.next().value(); | 550 | const Akonadi::Item item = i.next().value(); | ||
551 | 551 | | |||
552 | Akonadi::Collection parentCollection; // must have same lifetime as blockedAttr | ||||
552 | BlockAlarmsAttribute *blockedAttr = nullptr; | 553 | BlockAlarmsAttribute *blockedAttr = nullptr; | ||
553 | 554 | | |||
554 | if (excludeBlockedAlarms) { | 555 | if (excludeBlockedAlarms) { | ||
555 | // take the collection from m_collectionMap, because we need the up-to-date collection attrs | 556 | // take the collection from m_collectionMap, because we need the up-to-date collection attrs | ||
556 | Akonadi::Collection parentCollection = d->mCollectionMap.value(item.storageCollectionId()); | 557 | parentCollection = d->mCollectionMap.value(item.storageCollectionId()); | ||
557 | if (parentCollection.isValid() && parentCollection.hasAttribute<BlockAlarmsAttribute>()) { | 558 | if (parentCollection.isValid() && parentCollection.hasAttribute<BlockAlarmsAttribute>()) { | ||
558 | blockedAttr = parentCollection.attribute<BlockAlarmsAttribute>(); | 559 | blockedAttr = parentCollection.attribute<BlockAlarmsAttribute>(); | ||
559 | if (blockedAttr->isEverythingBlocked()) { | 560 | if (blockedAttr->isEverythingBlocked()) { | ||
560 | continue; | 561 | continue; | ||
561 | } | 562 | } | ||
562 | } | 563 | } | ||
563 | } | 564 | } | ||
564 | 565 | | |||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |