summaryrefslogtreecommitdiffabout
path: root/libkcal/calendarlocal.cpp
authorzautrix <zautrix>2004-06-29 11:59:46 (UTC)
committer zautrix <zautrix>2004-06-29 11:59:46 (UTC)
commitda43dbdc6c82453228f34766fc74585615cba938 (patch) (side-by-side diff)
tree16576932cea08bf117b2d0320b0d5f66ee8ad093 /libkcal/calendarlocal.cpp
parent627489ea2669d3997676bc3cee0f5d0d0c16c4d4 (diff)
downloadkdepimpi-da43dbdc6c82453228f34766fc74585615cba938.zip
kdepimpi-da43dbdc6c82453228f34766fc74585615cba938.tar.gz
kdepimpi-da43dbdc6c82453228f34766fc74585615cba938.tar.bz2
New lib ical.Some minor changes as well.
Diffstat (limited to 'libkcal/calendarlocal.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 8ff8b14..3c572f0 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -96,6 +96,37 @@ void CalendarLocal::close()
setModified( false );
}
+
+bool CalendarLocal::addAnniversaryNoDup( Event *event )
+{
+ QString cat;
+ bool isBirthday = true;
+ if( event->categoriesStr() == i18n( "Anniversary" ) ) {
+ isBirthday = false;
+ cat = i18n( "Anniversary" );
+ } else if( event->categoriesStr() == i18n( "Birthday" ) ) {
+ isBirthday = true;
+ cat = i18n( "Birthday" );
+ } else {
+ qDebug("addAnniversaryNoDup called without fitting category! ");
+ return false;
+ }
+ Event * eve;
+ for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) {
+ if ( !(eve->categories().contains( cat ) ))
+ continue;
+ // now we have an event with fitting category
+ if ( eve->dtStart().date() != event->dtStart().date() )
+ continue;
+ // now we have an event with fitting category+date
+ if ( eve->summary() != event->summary() )
+ continue;
+ // now we have an event with fitting category+date+summary
+ return false;
+ }
+ return addEvent( event );
+
+}
bool CalendarLocal::addEventNoDup( Event *event )
{
Event * eve;