From 607d7206766ca1bbeb98819b727411f8e0d83735 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 7 Sep 2006 14:13:03 +0000 Subject: [PATCH] Monotone-Parent: 321c07dcd402a9e1f67210981ec9fa1b6ac69ac5 Monotone-Revision: e791f856fa8cb6c49f52de50d8bcbfcc98922c88 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-07T14:13:03 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ UI/SOGoUI/UIxComponent.m | 41 +++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50917e67e..6125977db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-07 Wolfgang Sourdeau + + * UI/SOGoUI/UIxComponent.m ([UIxComponent -userFolderPath]): + return a path based on the object's context instead of the first + level in SOGo's object hierarchy... + 2006-09-06 Wolfgang Sourdeau * UI/Templates/SchedulerUI/UIxCalDayTable.wox: day columns can now diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 2c19171a5..e24e47d81 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -284,26 +284,29 @@ static BOOL uixDebugEnabled = NO; return [uri substringFromIndex: (r.location + 1)]; } -- (NSString *) _urlForTraversalObject: (int) traversal -{ - WOContext *ctx; - NSArray *traversalObjects; - NSString *url; - NSString *path; - - ctx = [self context]; - traversalObjects = [ctx objectTraversalStack]; - url = [[traversalObjects objectAtIndex: traversal] - baseURLInContext:ctx]; - path = [[NSURL URLWithString:url] path]; -// path = [path stringByAppendingPathComponent:[[ctx activeUser] login]]; - - return path; -} - - (NSString *) userFolderPath { - return [self _urlForTraversalObject: 1]; + WOContext *ctx; + NSString *url, *path; + NSEnumerator *objects; + SOGoObject *currentObject; + BOOL found; + + ctx = [self context]; + objects = [[ctx objectTraversalStack] objectEnumerator]; + currentObject = [objects nextObject]; + found = NO; + while (currentObject + && !found) + if ([currentObject isKindOfClass: [SOGoUserFolder class]]) + found = YES; + else + currentObject = [objects nextObject]; + + url = [currentObject baseURLInContext:ctx]; + path = [[NSURL URLWithString:url] path]; + + return path; } - (NSString *) applicationPath @@ -371,7 +374,7 @@ static BOOL uixDebugEnabled = NO; return rel; } - + /* date */ - (NSTimeZone *) viewTimeZone