From: helge Date: Thu, 8 Feb 2007 19:32:36 +0000 (+0000) Subject: applied a hack for gnustep-base compat X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fd628f30a3dc0014eb6079d574f6905e211f1e2;p=sope applied a hack for gnustep-base compat git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1412 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-gdl1/GDLContentStore/ChangeLog b/sope-gdl1/GDLContentStore/ChangeLog index f5fec6eb..afcd89ff 100644 --- a/sope-gdl1/GDLContentStore/ChangeLog +++ b/sope-gdl1/GDLContentStore/ChangeLog @@ -1,3 +1,9 @@ +2007-02-08 Wolfgang Sourdeau + + * GCSFolder.m: added a gnustep-base hack to properly format bool + numbers for SQL. Base returns YES or NO in -stringValue while + libFoundation/NGExt returns 0 or 1 (v4.5.39) + 2007-01-15 Wolfgang Sourdeau * GCSFolder.[hm], GCSFolderManager.m: added support for content table diff --git a/sope-gdl1/GDLContentStore/GCSFolder.m b/sope-gdl1/GDLContentStore/GCSFolder.m index 31dfae7c..dbb54fde 100644 --- a/sope-gdl1/GDLContentStore/GCSFolder.m +++ b/sope-gdl1/GDLContentStore/GCSFolder.m @@ -364,15 +364,24 @@ static GCSStringFormatter *stringFormatter = nil; if ([_value isKindOfClass:NSStringClass]) return [stringFormatter stringByFormattingString:_value]; - if ([_value isKindOfClass:NSNumberClass]) + if ([_value isKindOfClass:NSNumberClass]) { +#if GNUSTEP_BASE_LIBRARY + _value = [_value stringValue]; + return ([_value hasPrefix:@"Y"] || [_value hasPrefix:@"N"]) + ? ([_value boolValue] ? @"1" : @"0") + : _value; +#endif return [_value stringValue]; - + } + if ([_value isKindOfClass:NSCalendarDateClass]) { - /* be smart ... convert to timestamp */ - return [NSString stringWithFormat:@"%i", [_value timeIntervalSince1970]]; + /* be smart ... convert to timestamp. Note: we loose precision. */ + char buf[256]; + snprintf(buf, sizeof(buf), "%i", (int)[_value timeIntervalSince1970]); + return [NSString stringWithCString:buf]; } - [self logWithFormat:@"cannot handle value class: %@", [_value class]]; + [self errorWithFormat:@"cannot handle value class: %@", [_value class]]; return nil; } diff --git a/sope-gdl1/GDLContentStore/Version b/sope-gdl1/GDLContentStore/Version index 5d9ca27c..e1a5dabe 100644 --- a/sope-gdl1/GDLContentStore/Version +++ b/sope-gdl1/GDLContentStore/Version @@ -2,7 +2,7 @@ MAJOR_VERSION:=4 MINOR_VERSION:=5 -SUBMINOR_VERSION:=38 +SUBMINOR_VERSION:=39 # v4.5.29 requires libNGExtensions v4.5.161 # v4.5.26 does not require libNGiCal anymore