From 156f58c6df81d7d834a9a05106b069288c7e68cb Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 28 Oct 2010 16:10:58 +0000 Subject: [PATCH] Monotone-Parent: e4af1bcb0f6a6fc58eedf3cbb01b463d2b262c00 Monotone-Revision: e8b5a9f2cdf8cecaf58804b50b6324d1e330a8cb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-28T16:10:58 Monotone-Branch: ca.inverse.sogo --- .../Appointments/SOGoAppointmentFolders.m | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentFolders.m b/SoObjects/Appointments/SOGoAppointmentFolders.m index 8ac1ad33a..e1077c27d 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolders.m +++ b/SoObjects/Appointments/SOGoAppointmentFolders.m @@ -422,29 +422,18 @@ static SoSecurityManager *sm = nil; - (NSString *) _fixedWebCalendarKey: (NSString *) oldKey { NSString *newKey; - NSRange lastOccurrence, fullOccurrence; + NSRange lastOccurrence; lastOccurrence = [oldKey rangeOfString: @":Calendar/" options: NSBackwardsSearch]; - if ([oldKey rangeOfString: @":Calendar/"].location != lastOccurrence.location) + if ([oldKey rangeOfString: @":Calendar/"].location + != lastOccurrence.location) { - fullOccurrence - = [oldKey rangeOfString: - [NSString stringWithFormat: @"%@:Calendar/", - owner] - options: NSBackwardsSearch]; - if (fullOccurrence.location != NSNotFound) - { - newKey = [oldKey substringFromIndex: fullOccurrence.location]; - [self logWithFormat: @"fixed erroneous calendar key: '%@' -> '%@'", - oldKey, newKey]; - } - else - { - [self errorWithFormat: @"calendar key cannot be fixed: '%@'", - oldKey]; - newKey = nil; - } + newKey + = [NSString stringWithFormat: @"%@%@", owner, + [oldKey substringFromIndex: lastOccurrence.location]]; + [self logWithFormat: @"fixed erroneous calendar key: '%@' -> '%@'", + oldKey, newKey]; } else newKey = nil;