From 93e053e1f39c10088af95bb366f5692002b741db Mon Sep 17 00:00:00 2001 From: helge Date: Thu, 21 Apr 2005 16:35:30 +0000 Subject: [PATCH] fixed for new -describeResults: API git-svn-id: http://svn.opengroupware.org/SOPE/trunk@752 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-gdl1/GDLAccess/ChangeLog | 6 ++++++ sope-gdl1/GDLAccess/EOAdaptorChannel.h | 3 ++- sope-gdl1/GDLAccess/EOAdaptorChannel.m | 5 ++++- sope-gdl1/GDLAccess/Version | 2 +- sope-gdl1/PostgreSQL/ChangeLog | 4 ++++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.h | 21 ++------------------- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m | 6 ++++-- sope-gdl1/PostgreSQL/Version | 4 +++- sope-gdl1/SQLite3/ChangeLog | 8 ++++++++ sope-gdl1/SQLite3/NSString+SQLiteVal.m | 2 +- sope-gdl1/SQLite3/SQLiteChannel.h | 19 +------------------ sope-gdl1/SQLite3/SQLiteChannel.m | 6 ++++-- sope-gdl1/SQLite3/Version | 4 +++- 13 files changed, 43 insertions(+), 47 deletions(-) diff --git a/sope-gdl1/GDLAccess/ChangeLog b/sope-gdl1/GDLAccess/ChangeLog index 460dc487..46dffe22 100644 --- a/sope-gdl1/GDLAccess/ChangeLog +++ b/sope-gdl1/GDLAccess/ChangeLog @@ -1,3 +1,9 @@ +2005-04-21 Helge Hess + + * EOAdaptorChannel.[hm]: added -describeResults: as a public method, + implemented -describeResults based on that (adaptors now need to + override -describeResults:) (v4.5.50) + 2005-04-12 Helge Hess * v4.5.49 diff --git a/sope-gdl1/GDLAccess/EOAdaptorChannel.h b/sope-gdl1/GDLAccess/EOAdaptorChannel.h index efce51fe..aa555a0b 100644 --- a/sope-gdl1/GDLAccess/EOAdaptorChannel.h +++ b/sope-gdl1/GDLAccess/EOAdaptorChannel.h @@ -106,7 +106,8 @@ describedByQualifier:(EOSQLQualifier *)aQualifier fetchOrder:(NSArray *)aFetchOrder lock:(BOOL)aLockFlag; -- (NSArray*)describeResults; // override +- (NSArray *)describeResults:(BOOL)_beautifyNames; // override +- (NSArray *)describeResults; - (NSMutableDictionary*)fetchAttributes:(NSArray *)attributes withZone:(NSZone *)zone; - (BOOL)isFetchInProgress; diff --git a/sope-gdl1/GDLAccess/EOAdaptorChannel.m b/sope-gdl1/GDLAccess/EOAdaptorChannel.m index df54956d..61f213d5 100644 --- a/sope-gdl1/GDLAccess/EOAdaptorChannel.m +++ b/sope-gdl1/GDLAccess/EOAdaptorChannel.m @@ -398,10 +398,13 @@ return nil; } -- (NSArray *)describeResults { +- (NSArray *)describeResults:(BOOL)_beautifyNames { [self subclassResponsibility:_cmd]; return nil; } +- (NSArray *)describeResults { + return [self describeResults:YES]; +} - (NSMutableDictionary *)fetchAttributes:(NSArray *)attributes withZone:(NSZone *)_zone diff --git a/sope-gdl1/GDLAccess/Version b/sope-gdl1/GDLAccess/Version index 704a8fa2..f7227d67 100644 --- a/sope-gdl1/GDLAccess/Version +++ b/sope-gdl1/GDLAccess/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=49 +SUBMINOR_VERSION:=50 diff --git a/sope-gdl1/PostgreSQL/ChangeLog b/sope-gdl1/PostgreSQL/ChangeLog index 19a0b570..7de6d4cd 100644 --- a/sope-gdl1/PostgreSQL/ChangeLog +++ b/sope-gdl1/PostgreSQL/ChangeLog @@ -1,3 +1,7 @@ +2005-04-21 Helge Hess + + * PostgreSQL72Channel.m: changed for -describeResults: API (v4.5.41) + 2005-01-14 Helge Hess * EOAttribute+PostgreSQL72.m: map PG oid's to NSStrings (avoids issues diff --git a/sope-gdl1/PostgreSQL/PostgreSQL72Channel.h b/sope-gdl1/PostgreSQL/PostgreSQL72Channel.h index a36b9f76..346eeadb 100644 --- a/sope-gdl1/PostgreSQL/PostgreSQL72Channel.h +++ b/sope-gdl1/PostgreSQL/PostgreSQL72Channel.h @@ -27,7 +27,7 @@ #ifndef ___PostgreSQL72_Channel_H___ #define ___PostgreSQL72_Channel_H___ -#import +#include #include @class NSArray, NSString, NSMutableDictionary; @@ -69,23 +69,6 @@ typedef struct { - (void)setDebugEnabled:(BOOL)_flag; - (BOOL)isDebugEnabled; -- (BOOL)isOpen; -- (BOOL)openChannel; -- (void)closeChannel; - -- (NSMutableDictionary *)primaryFetchAttributes:(NSArray *)_attributes - withZone:(NSZone *)_zone; - -- (BOOL)evaluateExpression:(NSString *)_expression; - -// cancelFetch is always called to terminate a fetch -// (even by primaryFetchAttributes) -// it frees all fetch-local variables -- (void)cancelFetch; - -// uses dataFormat type information to create EOAttribute objects -- (NSArray *)describeResults; - @end @interface NSObject(Sybase10ChannelDelegate) @@ -98,4 +81,4 @@ typedef struct { @end -#endif +#endif /* ___PostgreSQL72_Channel_H___ */ diff --git a/sope-gdl1/PostgreSQL/PostgreSQL72Channel.m b/sope-gdl1/PostgreSQL/PostgreSQL72Channel.m index fc7dbc57..d3b9165d 100644 --- a/sope-gdl1/PostgreSQL/PostgreSQL72Channel.m +++ b/sope-gdl1/PostgreSQL/PostgreSQL72Channel.m @@ -307,7 +307,7 @@ static int openConnectionCount = 0; [super cancelFetch]; } -- (NSArray *)describeResults { +- (NSArray *)describeResults:(BOOL)_beautifyNames { int cnt; NSMutableArray *result = nil; NSMutableDictionary *usedNames = nil; @@ -327,7 +327,9 @@ static int openConnectionCount = 0; columnName = [[StringClass alloc] initWithCString:self->fieldInfo[cnt].name]; - attrName = [columnName _pgModelMakeInstanceVarName]; + attrName = _beautifyNames + ? [columnName _pgModelMakeInstanceVarName] + : columnName; if ([[usedNames objectForKey:attrName] boolValue]) { // TODO: move name generation code to different method! diff --git a/sope-gdl1/PostgreSQL/Version b/sope-gdl1/PostgreSQL/Version index 879a0a4c..05ec198e 100644 --- a/sope-gdl1/PostgreSQL/Version +++ b/sope-gdl1/PostgreSQL/Version @@ -1,3 +1,5 @@ # version file -SUBMINOR_VERSION:=40 +SUBMINOR_VERSION:=41 + +# v4.5.41 requires libGDLAccess v4.5.50 diff --git a/sope-gdl1/SQLite3/ChangeLog b/sope-gdl1/SQLite3/ChangeLog index 1d00e394..5291a2ac 100644 --- a/sope-gdl1/SQLite3/ChangeLog +++ b/sope-gdl1/SQLite3/ChangeLog @@ -1,3 +1,11 @@ +2005-04-21 Helge Hess + + * v4.5.17 + + * NSString+SQLiteVal.m: fixed a gcc 3.4.3 warning + + * SQLiteChannel.m: changed for -describeResults: API + 2005-04-12 Helge Hess * SQLiteChannel.m: bumped max connection count from 15 to 150 (v4.5.16) diff --git a/sope-gdl1/SQLite3/NSString+SQLiteVal.m b/sope-gdl1/SQLite3/NSString+SQLiteVal.m index 8a407f06..f5104c67 100644 --- a/sope-gdl1/SQLite3/NSString+SQLiteVal.m +++ b/sope-gdl1/SQLite3/NSString+SQLiteVal.m @@ -93,7 +93,7 @@ static Class EOExprClass = Nil; if (EOExprClass == Nil) EOExprClass = [EOQuotedExpression class]; expr = [[EOExprClass alloc] initWithExpression:expr quote:@"'" escape:@"\\'"]; - s = [[expr expressionValueForContext:nil] retain]; + s = [[(EOQuotedExpression *)expr expressionValueForContext:nil] retain]; [expr release]; return [s autorelease]; } diff --git a/sope-gdl1/SQLite3/SQLiteChannel.h b/sope-gdl1/SQLite3/SQLiteChannel.h index c2ba56bc..43670cad 100644 --- a/sope-gdl1/SQLite3/SQLiteChannel.h +++ b/sope-gdl1/SQLite3/SQLiteChannel.h @@ -26,7 +26,7 @@ #ifndef ___SQLite_Channel_H___ #define ___SQLite_Channel_H___ -#import +#include @class NSArray, NSString, NSMutableDictionary; @@ -52,23 +52,6 @@ - (void)setDebugEnabled:(BOOL)_flag; - (BOOL)isDebugEnabled; -- (BOOL)isOpen; -- (BOOL)openChannel; -- (void)closeChannel; - -- (NSMutableDictionary *)primaryFetchAttributes:(NSArray *)_attributes - withZone:(NSZone *)_zone; - -- (BOOL)evaluateExpression:(NSString *)_expression; - -// cancelFetch is always called to terminate a fetch -// (even by primaryFetchAttributes) -// it frees all fetch-local variables -- (void)cancelFetch; - -// uses dataFormat type information to create EOAttribute objects -- (NSArray *)describeResults; - @end @interface NSObject(Sybase10ChannelDelegate) diff --git a/sope-gdl1/SQLite3/SQLiteChannel.m b/sope-gdl1/SQLite3/SQLiteChannel.m index b77a05cd..a44bf264 100644 --- a/sope-gdl1/SQLite3/SQLiteChannel.m +++ b/sope-gdl1/SQLite3/SQLiteChannel.m @@ -247,7 +247,7 @@ static int openConnectionCount = 0; [super cancelFetch]; } -- (NSArray *)describeResults { +- (NSArray *)describeResults:(BOOL)_beautifyNames { // TODO: make exception-less method int cnt, fieldCount; NSMutableArray *result = nil; @@ -289,7 +289,9 @@ static int openConnectionCount = 0; columnName = [NSString stringWithCString: sqlite3_column_name(self->statement, cnt)]; - attrName = [columnName _sqlite3ModelMakeInstanceVarName]; + attrName = _beautifyNames + ? [columnName _sqlite3ModelMakeInstanceVarName] + : columnName; if ([[usedNames objectForKey:attrName] boolValue]) { int cnt2 = 0; diff --git a/sope-gdl1/SQLite3/Version b/sope-gdl1/SQLite3/Version index a80c05fb..937ad5bb 100644 --- a/sope-gdl1/SQLite3/Version +++ b/sope-gdl1/SQLite3/Version @@ -1,3 +1,5 @@ # Version file -SUBMINOR_VERSION:=16 +SUBMINOR_VERSION:=17 + +# v4.5.17 requires libGDLAccess v4.5.50 -- 2.39.5