From c270e1e720760ed84b0a3a290f25e6d9f99ef74e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 12 Apr 2012 23:45:23 +0000 Subject: [PATCH] Monotone-Parent: 24e2e177451529a5708c7cc70a324ed3ce6c9a64 Monotone-Revision: 827061cfd7bb39eead69601b6015cb0ff6ebf1f1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-12T23:45:23 --- .../Appointments/SOGoAppointmentFolder.m | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 7e99e2bc7..58d847187 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -556,8 +556,15 @@ static NSNumber *sharedYes = nil; [title stringByReplacingString: @"'" withString: @"''"]]]; if (component) - [baseWhere addObject: [NSString stringWithFormat: @"c_component = '%@'", - component]]; + { + if ([component isEqualToString: @"vtodo"] && ![self showCalendarTasks]) + return [NSArray array]; + else + [baseWhere addObject: [NSString stringWithFormat: @"c_component = '%@'", + component]]; + } + else if (![self showCalendarTasks]) + [baseWhere addObject: @"c_component != 'vtodo'"]; if ([filters length]) [baseWhere addObject: filters]; @@ -1108,8 +1115,15 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir baseWhere = [NSMutableArray arrayWithCapacity: 32]; if (_component) - [baseWhere addObject: [NSMutableString stringWithFormat: @"c_component = '%@'", - _component]]; + { + if ([_component isEqualToString: @"vtodo"] && ![self showCalendarTasks]) + return [NSArray array]; + else + [baseWhere addObject: [NSString stringWithFormat: @"c_component = '%@'", + _component]]; + } + else if (![self showCalendarTasks]) + [baseWhere addObject: @"c_component != 'vtodo'"]; if (_startDate) {