summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Jarvie <djarvie@kde.org>2012-01-25 23:43:36 (GMT)
committerDavid Jarvie <djarvie@kde.org>2012-01-25 23:53:03 (GMT)
commitc5735fa45baadc2b001814a440da9b9f3f97f438 (patch)
tree43ee5de13e89de6aaafa81a45c1bd62273d4db65
parent7cd6a3eb9f6255ee51acd9b0ab72cbde824803a1 (diff)
Only give choice of fully writable calendars for saving new alarms in
When a new alarm was saved, calendars which were not writable due to them being in an old KAlarm format were wrongly included in the choice of calendars to save the alarm in. Backport of be4fa3e8519c40693c7250995efd79174cd67ebb (master).
-rw-r--r--kalarm/Changelog5
-rw-r--r--kalarm/collectionmodel.cpp14
-rw-r--r--kalarm/kalarm.h2
3 files changed, 12 insertions, 9 deletions
diff --git a/kalarm/Changelog b/kalarm/Changelog
index ded9a54..415fd09 100644
--- a/kalarm/Changelog
+++ b/kalarm/Changelog
@@ -1,6 +1,9 @@
KAlarm Change Log
-=== Version 2.8.0 --- 16 January 2012 ===
+=== Version 2.8.1 --- 26 January 2012 ===
+- [Akonadi] Don't give option to save new alarms in old format calendars.
+
+=== Version 2.8.0 (KDE 4.8.0) --- 16 January 2012 ===
- Use Akonadi as the default calendar access method.
- Allow user to stop playback after clicking Try in audio alarm edit dialogue.
diff --git a/kalarm/collectionmodel.cpp b/kalarm/collectionmodel.cpp
index 5d11bfd..439124e 100644
--- a/kalarm/collectionmodel.cpp
+++ b/kalarm/collectionmodel.cpp
@@ -1,7 +1,7 @@
/*
* collectionmodel.cpp - Akonadi collection models
* Program: kalarm
- * Copyright © 2007-2011 by David Jarvie <djarvie@kde.org>
+ * Copyright © 2007-2012 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -125,12 +125,12 @@ bool CollectionMimeTypeFilterModel::filterAcceptsRow(int sourceRow, const QModel
return false;
if (mAlarmType != CalEvent::EMPTY && !collection.contentMimeTypes().contains(CalEvent::mimeType(mAlarmType)))
return false;
- if (mEnabledOnly)
- {
- if (!collection.hasAttribute<CollectionAttribute>()
- || !collection.attribute<CollectionAttribute>()->isEnabled(mAlarmType))
- return false;
- }
+ if ((mWritableOnly || mEnabledOnly) && !collection.hasAttribute<CollectionAttribute>())
+ return false;
+ if (mWritableOnly && collection.attribute<CompatibilityAttribute>()->compatibility() != KACalendar::Current)
+ return false;
+ if (mEnabledOnly && !collection.attribute<CollectionAttribute>()->isEnabled(mAlarmType))
+ return false;
return true;
}
diff --git a/kalarm/kalarm.h b/kalarm/kalarm.h
index e399074..b78b0f5 100644
--- a/kalarm/kalarm.h
+++ b/kalarm/kalarm.h
@@ -28,7 +28,7 @@
#else
#define VERSION_SUFFIX "-res"
#endif
-#define KALARM_VERSION "2.8.0" VERSION_SUFFIX
+#define KALARM_VERSION "2.8.1" VERSION_SUFFIX
#define KALARM_NAME "KAlarm"
#define KALARM_DBUS_SERVICE "org.kde.kalarm" // D-Bus service name of KAlarm application