[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepim/kalarm
From: David Jarvie <djarvie () kde ! org>
Date: 2010-11-11 1:09:13
Message-ID: 20101111010913.65DDCAC89E () svn ! kde ! org
[Download RAW message or body]
SVN commit 1195418 by djarvie:
Remove alarms from the internal calendar when their collection is disabled
M +16 -0 alarmcalendar.cpp
M +1 -0 alarmcalendar.h
--- trunk/KDE/kdepim/kalarm/alarmcalendar.cpp #1195417:1195418
@@ -158,6 +158,8 @@
connect(model, SIGNAL(eventsAdded(const AkonadiModel::EventList&)), \
SLOT(slotEventsAdded(const AkonadiModel::EventList&)));
connect(model, SIGNAL(eventsToBeRemoved(const AkonadiModel::EventList&)), \
SLOT(slotEventsToBeRemoved(const AkonadiModel::EventList&)));
connect(model, SIGNAL(eventChanged(const AkonadiModel::Event&)), \
SLOT(slotEventChanged(const AkonadiModel::Event&))); + connect(model, \
SIGNAL(collectionStatusChanged(const Akonadi::Collection&, AkonadiModel::Change, \
bool)), + SLOT(slotCollectionStatusChanged(const Akonadi::Collection&, \
AkonadiModel::Change, bool))); #else
AlarmResources* resources = AlarmResources::instance();
resources->setCalIDFunction(&KAlarm::Calendar::setKAlarmVersion);
@@ -637,6 +639,20 @@
#ifdef USE_AKONADI
/******************************************************************************
+* Called when the enabled or read-only status of a collection has changed.
+* If the collection is now disabled, remove its events from the calendar.
+*/
+void AlarmCalendar::slotCollectionStatusChanged(const Collection& collection, \
AkonadiModel::Change change, bool value) +{
+ if (change == AkonadiModel::Enabled && !value)
+ {
+ // The collection has been disabled.
+ // Remove its events from the map, but not from AkonadiModel.
+ removeKAEvents(collection.id(), false);
+ }
+}
+
+/******************************************************************************
* Called when events have been added to AkonadiModel.
* Add corresponding KAEvent instances to those held by AlarmCalendar.
*/
--- trunk/KDE/kdepim/kalarm/alarmcalendar.h #1195417:1195418
@@ -138,6 +138,7 @@
private slots:
void setAskResource(bool ask);
#ifdef USE_AKONADI
+ void slotCollectionStatusChanged(const Akonadi::Collection&, \
AkonadiModel::Change, bool value); void slotEventsAdded(const \
AkonadiModel::EventList&); void slotEventsToBeRemoved(const \
AkonadiModel::EventList&); void slotEventChanged(const \
AkonadiModel::Event&);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic