From 8c94cb173965ebde80d0339406334e8d85a76716 Mon Sep 17 00:00:00 2001 From: helge Date: Thu, 3 Mar 2005 22:54:37 +0000 Subject: [PATCH] fixed an issue with subfolder listing git-svn-id: http://svn.opengroupware.org/SOGo/trunk@625 d1b88da0-ebda-0310-925b-ed51d893ca5b --- OGoContentStore/ChangeLog | 4 ++++ OGoContentStore/GNUmakefile.preamble | 3 ++- OGoContentStore/OCSFolderManager.m | 15 +++++++++++---- OGoContentStore/Version | 2 +- OGoContentStore/ocs_ls.m | 23 ++++++++++++++--------- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/OGoContentStore/ChangeLog b/OGoContentStore/ChangeLog index 0fd38dc9..48e7c952 100644 --- a/OGoContentStore/ChangeLog +++ b/OGoContentStore/ChangeLog @@ -1,3 +1,7 @@ +2005-03-03 Helge Hess + + * OCSFolderManager.m: fixed a bug in subfolder listing (v0.9.23) + 2005-03-01 Marcus Mueller * v0.9.22 diff --git a/OGoContentStore/GNUmakefile.preamble b/OGoContentStore/GNUmakefile.preamble index 2ef90219..f94b0797 100644 --- a/OGoContentStore/GNUmakefile.preamble +++ b/OGoContentStore/GNUmakefile.preamble @@ -1,4 +1,4 @@ -# $Id$ +# compilation settings libOGoContentStore_LIBRARIES_DEPEND_UPON += \ -lGDLAccess \ @@ -7,6 +7,7 @@ libOGoContentStore_LIBRARIES_DEPEND_UPON += \ OCS_TOOL_LIBS += \ -lOGoContentStore \ + -lNGiCal \ -lGDLAccess \ -lNGExtensions -lEOControl \ -lDOM -lSaxObjC diff --git a/OGoContentStore/OCSFolderManager.m b/OGoContentStore/OCSFolderManager.m index 57dd90c5..16523079 100644 --- a/OGoContentStore/OCSFolderManager.m +++ b/OGoContentStore/OCSFolderManager.m @@ -209,11 +209,18 @@ static const char *OCSPathColumnPattern = "c_path%i"; if (_record == nil) return nil; folderTypeName = [_record objectForKey:@"cFolderType"]; - if ((folderType = [self folderTypeWithName:folderTypeName]) == nil) { - [self logWithFormat:@"ERROR(%s): got no type from folder record: %@", + if (![folderTypeName isNotNull]) { + [self logWithFormat:@"ERROR(%s): missing type in folder: %@", __PRETTY_FUNCTION__, _record]; return nil; } + if ((folderType = [self folderTypeWithName:folderTypeName]) == nil) { + [self logWithFormat: + @"ERROR(%s): could not resolve type '%@' of folder: %@", + __PRETTY_FUNCTION__, + folderTypeName, [_record valueForKey:@"cPath"]]; + return nil; + } folderId = [_record objectForKey:@"cFolderId"]; folderName = [_record objectForKey:@"cPath"]; @@ -478,7 +485,7 @@ static const char *OCSPathColumnPattern = "c_path%i"; if ((count = [records count]) == 0) return emptyArray; - + result = [NSMutableArray arrayWithCapacity:(count > 128 ? 128 : count)]; fname = [self internalNameFromPath:_path]; @@ -487,7 +494,7 @@ static const char *OCSPathColumnPattern = "c_path%i"; NSDictionary *record; NSString *sname, *spath; - record = [records objectAtIndex:0]; + record = [records objectAtIndex:i]; sname = [record objectForKey:OCSPathRecordName]; if (![sname hasPrefix:fname]) /* does not match at all ... */ continue; diff --git a/OGoContentStore/Version b/OGoContentStore/Version index d237ea4c..55399d44 100644 --- a/OGoContentStore/Version +++ b/OGoContentStore/Version @@ -2,7 +2,7 @@ MAJOR_VERSION=0 MINOR_VERSION=9 -SUBMINOR_VERSION:=22 +SUBMINOR_VERSION:=23 # v0.9.19 requires libNGiCal v4.5.40 # v0.9.18 requires libNGiCal v4.5.38 diff --git a/OGoContentStore/ocs_ls.m b/OGoContentStore/ocs_ls.m index 7e56daaa..c3ead10a 100644 --- a/OGoContentStore/ocs_ls.m +++ b/OGoContentStore/ocs_ls.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2004 SKYRIX Software AG + Copyright (C) 2004-2005 SKYRIX Software AG This file is part of OpenGroupware.org. @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #import @@ -64,7 +63,7 @@ [self logWithFormat:@"ls path: '%@'", _path]; -#if 0 +#if 0 // we do not necessarily need the whole hierarchy if (![self->folderManager folderExistsAtPath:_path]) [self logWithFormat:@"folder does not exist: '%@'", _path]; #endif @@ -83,12 +82,18 @@ folder = [self->folderManager folderAtPath:_path]; - NSLog(@"folder: %@", folder); - NSLog(@" can%s connect store: %@", [folder canConnectStore] ? "" : "not", - [[folder location] absoluteString]); - NSLog(@" can%s connect quick: %@", [folder canConnectQuick] ? "" : "not", - [[folder quickLocation] absoluteString]); - + if ([folder isNotNull]) { + NSLog(@"folder: %@", folder); + + NSLog(@" can%s connect store: %@", [folder canConnectStore] ? "" : "not", + [[folder location] absoluteString]); + NSLog(@" can%s connect quick: %@", [folder canConnectQuick] ? "" : "not", + [[folder quickLocation] absoluteString]); + } + else { + NSLog(@"ERROR: could not create folder object for path: '%@'", _path); + } + return 0; } -- 2.39.5