Fix for bug 2007

This commit is contained in:
Ludovic Marcotte
2013-09-30 10:50:27 -04:00
parent 3cce9b2012
commit 05990e9a14
6 changed files with 54 additions and 46 deletions

View File

@@ -37,24 +37,6 @@
@implementation UIxCalMainActions
- (NSString *) displayNameForUrl: (NSString *) calendarURL
{
NSString *rc, *tmp;
tmp = [calendarURL lastPathComponent];
if (tmp)
{
if ([[tmp pathExtension] caseInsensitiveCompare: @"ics"] == NSOrderedSame)
rc = [tmp substringToIndex: [tmp length] - 4];
else
rc = tmp;
}
else
rc = [self labelForKey: @"Web Calendar"];
return rc;
}
- (WOResponse *) addWebCalendarAction
{
WORequest *r;
@@ -70,11 +52,12 @@
if ([urlString length] > 0)
{
folders = [self clientObject];
displayName = [self displayNameForUrl: urlString];
folder = [folders newWebCalendarWithName: displayName
atURL: urlString];
folder = [folders newWebCalendarWithURL: urlString
nameInContainer: nil];
if (folder)
{
displayName = [folder displayName];
response = [self responseWithStatus: 200];
[response setHeader: @"application/json" forKey: @"content-type"];