Added support for remote iCal calendars.

Monotone-Parent: a1fe20acf2d2d8408bcf2e8c36a38204f8d1bfad
Monotone-Revision: bb2513b08d345dfc89b0cd702a39ac0eeb276c3d

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-09-10T17:26:57
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert
2009-09-10 17:26:57 +00:00
parent cec888b0c0
commit 9d46c890d1
30 changed files with 579 additions and 36 deletions
+2 -26
View File
@@ -20,7 +20,6 @@
*/
#import <Foundation/Foundation.h>
#import <SoObjects/SOGo/NSArray+Utilities.h>
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
#import <SoObjects/SOGo/NSString+Utilities.h>
@@ -98,13 +97,12 @@
{
SOGoAppointmentFolder *folder;
NSMutableDictionary *rc;
NSArray *components;
WORequest *request;
WOResponse *response;
NSString *fileContent;
id data;
iCalCalendar *additions;
int i, count, imported;
int imported;
imported = 0;
rc = [NSMutableDictionary dictionary];
@@ -124,29 +122,7 @@
&& [fileContent hasPrefix: @"BEGIN:"])
{
additions = [iCalCalendar parseSingleFromSource: fileContent];
if (additions)
{
components = [additions events];
count = [components count];
for (i = 0; i < count; i++)
if ([folder importComponent: [components objectAtIndex: i]])
imported++;
components = [additions todos];
count = [components count];
for (i = 0; i < count; i++)
if ([folder importComponent: [components objectAtIndex: i]])
imported++;
components = [additions journals];
count = [components count];
for (i = 0; i < count; i++)
if ([folder importComponent: [components objectAtIndex: i]])
imported++;
components = [additions freeBusys];
count = [components count];
for (i = 0; i < count; i++)
if ([folder importComponent: [components objectAtIndex: i]])
imported++;
}
imported = [folder importCalendar: additions];
}
[rc setObject: [NSNumber numberWithInt: imported]