From: wolfgang Date: Wed, 12 Mar 2008 23:13:45 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1388 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=421121f1ad8ffa9a8fbe22c0e5d430dd3d6ae39a;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1388 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index 3aedecfb..b2af91ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-03-10 Wolfgang Sourdeau + + * UI/Scheduler/UIxCalMonthViewOld.m ([UIxCalMonthViewOld + -endDate]): removed useless method. + + * SoObjects/SOGo/NSCalendarDate+SOGo.m + ([-dayOfWeeK:_dayoffsetFromSunday:_offset]): removed useless + method. + ([-sundayOfWeek]): removed useless method. + 2008-03-07 Wolfgang Sourdeau * OGoContentStore/OCSContactFieldExtractor.m diff --git a/SoObjects/SOGo/NSCalendarDate+SOGo.h b/SoObjects/SOGo/NSCalendarDate+SOGo.h index 61ad14f1..de31ca69 100644 --- a/SoObjects/SOGo/NSCalendarDate+SOGo.h +++ b/SoObjects/SOGo/NSCalendarDate+SOGo.h @@ -34,11 +34,8 @@ inTimeZone: (NSTimeZone *) timeZone; - (BOOL) isDateInSameMonth: (NSCalendarDate *) _other; -- (NSCalendarDate *) dayOfWeeK: (unsigned) _day - offsetFromSunday: (unsigned) _off; -- (NSCalendarDate *) sundayOfWeek; -- (NSString *) shortDateString; +- (NSString *) shortDateString; - (NSString *) rfc822DateString; + (id) distantFuture; diff --git a/SoObjects/SOGo/NSCalendarDate+SOGo.m b/SoObjects/SOGo/NSCalendarDate+SOGo.m index 7da91718..46ac1f22 100644 --- a/SoObjects/SOGo/NSCalendarDate+SOGo.m +++ b/SoObjects/SOGo/NSCalendarDate+SOGo.m @@ -83,29 +83,6 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr", ([_other monthOfYear] == [self monthOfYear])); } -- (NSCalendarDate *) dayOfWeeK: (unsigned) _day - offsetFromSunday: (unsigned) _offset -{ - unsigned dayOfWeek, distance; - - /* perform "locale" correction */ - dayOfWeek = (7 + [self dayOfWeek] - _offset) % 7; - - _day = (_day % 7); - if(_day == dayOfWeek) - return self; - - distance = _day - dayOfWeek; - return [self dateByAddingYears:0 months:0 days:distance]; -} - -/* this implies that monday is the start of week! */ - -- (NSCalendarDate *) sundayOfWeek -{ - return [self dayOfWeeK:6 offsetFromSunday:1]; -} - - (NSString *) shortDateString { NSString *str; diff --git a/SoObjects/SOGo/SOGoDateFormatter.m b/SoObjects/SOGo/SOGoDateFormatter.m index 97eb90b5..be1772a9 100644 --- a/SoObjects/SOGo/SOGoDateFormatter.m +++ b/SoObjects/SOGo/SOGoDateFormatter.m @@ -32,12 +32,6 @@ if ((self = [super init])) { locale = nil; -// locale = [_locale retain]; - -// if ([[locale objectForKey:@"NSLocaleCode"] isEqualToString: @"fr"]) -// shortDateFormat = SOGoDateDMYFormat; -// else -// shortDateFormat = SOGoDateISOFormat; shortDateFormat = nil; longDateFormat = nil; timeFormat = nil; @@ -80,12 +74,6 @@ ASSIGN (timeFormat, newFormat); } -// - (void) setFullWeekdayNameAndDetails -// { -// auxFormatAction = formatAction; -// formatAction = @selector(fullWeekdayNameAndDetailsForDate:); -// } - /* operation */ - (NSString *) _date: (NSCalendarDate *) date @@ -139,114 +127,4 @@ return formattedString; } -// /* Helpers */ - -// - (NSString *)shortDayOfWeek:(int)_day { -// return [[locale objectForKey:@"NSShortWeekDayNameArray"] -// objectAtIndex:_day]; -// } - -// - (NSString *)fullDayOfWeek:(int)_day { -// return [[locale objectForKey:@"NSWeekDayNameArray"] -// objectAtIndex:_day]; -// } - -// - (NSString *)shortMonthOfYear:(int)_month { -// return [[locale objectForKey:@"NSShortMonthNameArray"] -// objectAtIndex:_month - 1]; -// } - -// - (NSString *)fullMonthOfYear:(int)_month { -// return [[locale objectForKey:@"NSMonthNameArray"] -// objectAtIndex:_month - 1]; -// } - - -/* Private API */ - -// - (NSString *) fullWeekdayNameAndDetailsForDate: (NSCalendarDate *) _date -// { -// NSMutableString *desc; - -// if (_date) -// { -// desc = [NSMutableString stringWithCapacity:24]; -// [desc appendString:[self fullDayOfWeek:[_date dayOfWeek]]]; -// [desc appendString:@", "]; -// [desc appendString:[self performSelector:auxFormatAction -// withObject:_date]]; -// [desc appendString:@" "]; -// [desc appendFormat:@"%02d:%02d ", [_date hourOfDay], [_date minuteOfHour]]; -// [desc appendString:[[_date timeZone] abbreviation]]; -// } -// else -// desc = nil; - -// return desc; -// } - -// - (NSString *) _separatorForFormat: (unsigned int) format -// { -// NSString *separator; - -// switch (format & (3)) -// { -// case SOGoDateDotFormat: -// separator = @"."; -// break; -// case SOGoDateDashFormat: -// separator = @"."; -// break; -// default: -// separator = @"/"; -// } - -// return separator; -// } - -// - (NSString *) _dateFormatForDate: (NSCalendarDate *) date -// withFormat: (unsigned int) format -// andSeparator: (NSString *) separator -// { -// NSString *day, *month, *year; -// NSString *formattedDate; - -// day = [NSString stringWithFormat: @"%.2d", [date dayOfMonth]]; -// month = [NSString stringWithFormat: @"%.2d", [date monthOfYear]]; -// if (format & SOGoDateTwoDigitsYearFormat) -// year = [NSString stringWithFormat: @"%.2d", [date yearOfCommonEra] % 100]; -// else -// year = [NSString stringWithFormat: @"%.4d", [date yearOfCommonEra]]; - -// if (format & SOGoDateDMYFormat) -// formattedDate = [NSString stringWithFormat: @"%@%@%@%@%@", -// day, separator, month, separator, year]; -// else if (format & SOGoDateMDYFormat) -// formattedDate = [NSString stringWithFormat: @"%@%@%@%@%@", -// month, separator, day, separator, year]; -// else -// formattedDate = [NSString stringWithFormat: @"%@%@%@%@%@", -// year, separator, month, separator, day]; - -// return formattedDate; -// } - -// - (NSString *) date: (NSCalendarDate *) date -// withFormat: (unsigned int) format -// { -// NSString *separator; - -// separator = [self _separatorForFormat: format]; - -// return [self _dateFormatForDate: date -// withFormat: format -// andSeparator: separator]; -// } - -// - (NSString *) date: (NSCalendarDate *) date -// withNSFormat: (NSNumber *) format -// { -// return [self date: date withFormat: [format unsignedIntValue]]; -// } - @end /* SOGoDateFormatter */ diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 2444791a..0a707bc5 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -497,24 +497,24 @@ static BOOL uixDebugEnabled = NO; languages: languages]; } -- (NSString *) localizedNameForDayOfWeek:(unsigned)_dayOfWeek { - NSString *key = [dayLabelKeys objectAtIndex:_dayOfWeek % 7]; - return [self labelForKey:key]; +- (NSString *) localizedNameForDayOfWeek: (unsigned) dayOfWeek +{ + return [self labelForKey: [dayLabelKeys objectAtIndex: dayOfWeek % 7]]; } -- (NSString *)localizedAbbreviatedNameForDayOfWeek:(unsigned)_dayOfWeek { - NSString *key = [abbrDayLabelKeys objectAtIndex:_dayOfWeek % 7]; - return [self labelForKey:key]; +- (NSString *) localizedAbbreviatedNameForDayOfWeek: (unsigned) dayOfWeek +{ + return [self labelForKey: [abbrDayLabelKeys objectAtIndex: dayOfWeek % 7]]; } -- (NSString *)localizedNameForMonthOfYear:(unsigned)_monthOfYear { - NSString *key = [monthLabelKeys objectAtIndex:(_monthOfYear - 1) % 12]; - return [self labelForKey:key]; +- (NSString *) localizedNameForMonthOfYear: (unsigned) monthOfYear +{ + return [self labelForKey: [monthLabelKeys objectAtIndex: (monthOfYear - 1) % 12]]; } -- (NSString *)localizedAbbreviatedNameForMonthOfYear:(unsigned)_monthOfYear { - NSString *key = [abbrMonthLabelKeys objectAtIndex:(_monthOfYear - 1) % 12]; - return [self labelForKey:key]; +- (NSString *) localizedAbbreviatedNameForMonthOfYear: (unsigned) monthOfYear +{ + return [self labelForKey: [abbrMonthLabelKeys objectAtIndex: (monthOfYear - 1) % 12]]; } /* HTTP method safety */ diff --git a/UI/Scheduler/UIxCalMonthOverview.m b/UI/Scheduler/UIxCalMonthOverview.m index 5ab7be0d..ce59b9e0 100644 --- a/UI/Scheduler/UIxCalMonthOverview.m +++ b/UI/Scheduler/UIxCalMonthOverview.m @@ -9,71 +9,71 @@ @implementation UIxCalMonthOverview - (void)dealloc { - [self->currentWeekStart release]; + [currentWeekStart release]; [super dealloc]; } - (void)configureFormatters { [super configureFormatters]; - [self->aptFormatter setShortTitleOnly]; - [self->privateAptFormatter setPrivateTitleOnly]; + [aptFormatter setShortTitleOnly]; + [privateAptFormatter setPrivateTitleOnly]; } - (void)setDayIndex:(int)_idx { - self->dayIndex = _idx; + dayIndex = _idx; } - (int)dayIndex { - return self->dayIndex; + return dayIndex; } - (void)setDayOfWeek:(int)_day { - self->dayOfWeek = _day; + dayOfWeek = _day; } - (int)dayOfWeek { - return self->dayOfWeek; + return dayOfWeek; } - (void)setCurrentWeekStartDate:(NSCalendarDate *)_date { - ASSIGN(self->currentWeekStart, _date); + ASSIGN(currentWeekStart, _date); } - (NSCalendarDate *)currentWeekStartDate { - return self->currentWeekStart; + return currentWeekStart; } - (void)setWeekOfYear:(int)_week { - NSCalendarDate *date; + NSCalendarDate *date; - self->weekOfYear = _week; - if(_week == 52 || _week == 53) - date = [[self startOfMonth] mondayOfWeek]; - else - date = [self startOfMonth]; - date = [date mondayOfWeek:_week]; - [self setCurrentWeekStartDate:date]; + weekOfYear = _week; + if(_week == 52 || _week == 53) + date = [[self startOfMonth] mondayOfWeek]; + else + date = [self startOfMonth]; + date = [date mondayOfWeek:_week]; + [self setCurrentWeekStartDate:date]; } - (int)weekOfYear { - return self->weekOfYear; + return weekOfYear; } - (int)year { - return [[self startOfMonth] yearOfCommonEra]; + return [[self startOfMonth] yearOfCommonEra]; } - (int)month { - return [[self startOfMonth] monthOfYear]; + return [[self startOfMonth] monthOfYear]; } - (NSString *)localizedDayOfWeekName { - return [self localizedNameForDayOfWeek:self->dayOfWeek]; + return [self localizedNameForDayOfWeek:dayOfWeek]; } - (NSDictionary *)currentWeekQueryParameters { - return [self queryParametersBySettingSelectedDate:self->currentWeekStart]; + return [self queryParametersBySettingSelectedDate:currentWeekStart]; } @@ -81,17 +81,17 @@ - (NSString *)weekStyle { - if([self->currentWeekStart isDateInSameWeek:[NSCalendarDate date]]) - return @"monthoverview_week_hilite"; - return @"monthoverview_week"; + if([currentWeekStart isDateInSameWeek:[NSCalendarDate date]]) + return @"monthoverview_week_hilite"; + return @"monthoverview_week"; } - (NSString *)contentStyle { - if([self->currentDay isToday]) - return @"monthoverview_content_hilite"; - else if([self->currentDay monthOfYear] != [[self startOfMonth] monthOfYear]) - return @"monthoverview_content_dimmed"; - return @"monthoverview_content"; + if([currentDay isToday]) + return @"monthoverview_content_hilite"; + else if([currentDay monthOfYear] != [[self startOfMonth] monthOfYear]) + return @"monthoverview_content_dimmed"; + return @"monthoverview_content"; } diff --git a/UI/Scheduler/UIxCalMonthViewOld.m b/UI/Scheduler/UIxCalMonthViewOld.m index 292e98ca..d44de015 100644 --- a/UI/Scheduler/UIxCalMonthViewOld.m +++ b/UI/Scheduler/UIxCalMonthViewOld.m @@ -7,27 +7,20 @@ @implementation UIxCalMonthViewOld -- (NSCalendarDate *)startOfMonth { +- (NSCalendarDate *) startOfMonth +{ return [[[super startDate] firstDayOfMonth] beginOfDay]; } -- (NSCalendarDate *)startDate { +- (NSCalendarDate *) startDate +{ return [[self startOfMonth] mondayOfWeek]; } -- (NSCalendarDate *)endDate { - NSCalendarDate *date; - - date = [self startOfMonth]; - date = [date dateByAddingYears:0 months:0 days:[date numberOfDaysInMonth] - hours:0 minutes:0 seconds:0]; - date = [[date sundayOfWeek] endOfDay]; - return date; -} - /* URLs */ -- (NSDictionary *)prevMonthQueryParameters { +- (NSDictionary *) prevMonthQueryParameters +{ NSCalendarDate *date; date = [[self startOfMonth] dateByAddingYears:0 months:-1 days:0 @@ -35,7 +28,8 @@ return [self queryParametersBySettingSelectedDate:date]; } -- (NSDictionary *)nextMonthQueryParameters { +- (NSDictionary *)nextMonthQueryParameters +{ NSCalendarDate *date; date = [[self startOfMonth] dateByAddingYears:0 months:1 days:0