From 5329f79aa45dfe12a2273e6b99630d3b9e22129f Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 15 Feb 2007 21:09:09 +0000 Subject: [PATCH] Monotone-Parent: eb31622ae90d2fb89289c5fd7f92a7a374d2a7ae Monotone-Revision: 29d76fd89f13195b427dd7ff6f09660b0abb56e6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-02-15T21:09:09 Monotone-Branch: ca.inverse.sogo --- UI/Scheduler/UIxAppointmentEditor.m | 4 +--- UI/Scheduler/UIxAppointmentView.m | 23 ++++++----------------- UI/Scheduler/UIxCalView.m | 2 +- UI/Scheduler/UIxComponentEditor.m | 16 +++------------- UI/Scheduler/UIxTaskEditor.m | 6 ++---- UI/Scheduler/UIxTaskView.m | 23 ++++++----------------- 6 files changed, 19 insertions(+), 55 deletions(-) diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index f8b194739..5c2d39c72 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -264,11 +264,9 @@ { iCalCalendar *calendar; iCalEvent *appointment; - SOGoAppointmentObject *clientObject; - clientObject = [self clientObject]; calendar = [iCalCalendar parseSingleFromSource: _iCalString]; - appointment = [clientObject firstEventFromCalendar: calendar]; + appointment = (iCalEvent *) [calendar firstChildWithTag: @"vevent"]; return appointment; } diff --git a/UI/Scheduler/UIxAppointmentView.m b/UI/Scheduler/UIxAppointmentView.m index cb4562abc..14b3b6ea0 100644 --- a/UI/Scheduler/UIxAppointmentView.m +++ b/UI/Scheduler/UIxAppointmentView.m @@ -162,25 +162,14 @@ - (iCalEvent *) appointment { - NSString *iCalString; - iCalCalendar *calendar; SOGoAppointmentObject *clientObject; - - if (appointment != nil) - return appointment; - clientObject = [self clientObject]; - - iCalString = [[self clientObject] valueForKey:@"iCalString"]; - if (![iCalString isNotNull] || [iCalString length] == 0) { - [self errorWithFormat:@"(%s): missing iCal string!", - __PRETTY_FUNCTION__]; - return nil; - } - - calendar = [iCalCalendar parseSingleFromSource: iCalString]; - appointment = [clientObject firstEventFromCalendar: calendar]; - [appointment retain]; + if (!appointment) + { + clientObject = [self clientObject]; + appointment = (iCalEvent *) [clientObject component]; + [appointment retain]; + } return appointment; } diff --git a/UI/Scheduler/UIxCalView.m b/UI/Scheduler/UIxCalView.m index 48b7cf9aa..b5b9e0383 100644 --- a/UI/Scheduler/UIxCalView.m +++ b/UI/Scheduler/UIxCalView.m @@ -1,4 +1,4 @@ -// $Id: UIxCalView.m 1021 2007-02-12 20:56:24Z wolfgang $ +// $Id: UIxCalView.m 1022 2007-02-13 22:12:43Z wolfgang $ #import "common.h" //#import diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 2b958f1aa..e23e664a8 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -848,23 +848,13 @@ { NSString *filename; iCalEntityObject *calObject; - id co; + SOGoCalendarComponent *co; if (componentLoaded) { co = [self clientObject]; - if ([co isKindOfClass: [SOGoAppointmentObject class]]) - { - calObject = (iCalEntityObject *) [co event]; - filename = [self _toolbarForCalObject: calObject]; - } - else if ([co isKindOfClass: [SOGoTaskObject class]]) - { - calObject = (iCalEntityObject *) [co task]; - filename = [self _toolbarForCalObject: calObject]; - } - else - filename = @""; + calObject = [co component]; + filename = [self _toolbarForCalObject: calObject]; } else filename = @""; diff --git a/UI/Scheduler/UIxTaskEditor.m b/UI/Scheduler/UIxTaskEditor.m index 9335c23a1..8ff0ff6e1 100644 --- a/UI/Scheduler/UIxTaskEditor.m +++ b/UI/Scheduler/UIxTaskEditor.m @@ -250,11 +250,9 @@ { iCalCalendar *calendar; iCalToDo *task; - SOGoTaskObject *clientObject; - clientObject = [self clientObject]; calendar = [iCalCalendar parseSingleFromSource: _iCalString]; - task = [clientObject firstTaskFromCalendar: calendar]; + task = (iCalToDo *) [calendar firstChildWithTag: @"vtodo"]; return task; } @@ -406,7 +404,7 @@ newStatus = [[self queryParameterForKey: @"status"] intValue]; taskObject = [self clientObject]; - task = [taskObject task]; + task = (iCalToDo *) [taskObject component]; switch (newStatus) { case 1: diff --git a/UI/Scheduler/UIxTaskView.m b/UI/Scheduler/UIxTaskView.m index 71bf79c82..0f31e9241 100644 --- a/UI/Scheduler/UIxTaskView.m +++ b/UI/Scheduler/UIxTaskView.m @@ -162,25 +162,14 @@ - (iCalToDo *) task { - NSString *iCalString; - iCalCalendar *calendar; SOGoTaskObject *clientObject; - - if (task != nil) - return task; - clientObject = [self clientObject]; - - iCalString = [[self clientObject] valueForKey:@"iCalString"]; - if (![iCalString isNotNull] || [iCalString length] == 0) { - [self errorWithFormat:@"(%s): missing iCal string!", - __PRETTY_FUNCTION__]; - return nil; - } - - calendar = [iCalCalendar parseSingleFromSource: iCalString]; - task = [clientObject firstTaskFromCalendar: calendar]; - [task retain]; + if (!task) + { + clientObject = [self clientObject]; + task = (iCalToDo *) [clientObject component]; + [task retain]; + } return task; }