discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

differences between gnustep and libFoundation while porting ogo


From: Sebastian Reitenbach
Subject: differences between gnustep and libFoundation while porting ogo
Date: Thu, 12 Feb 2009 08:16:48 +0100
User-agent: KMail/1.9.9

Hi,

znek fixed my svn problems that I have with opengroupware, and I was able to 
merge the trunk into my gnustep branch. After doing so, now there seems to be 
a difference in how NSURLHandler seems to work:

I did not got that exception when I did linked against libFoundation:
Application Server caught exception:

  session: 3052305201499313FD
  element: 00b4993150981273408.5
  context: <0x0x81273408[WOContext]: 00b4993150981273408 app=ogo-webui-1.1 
sn=3052305201499313FD eid=00b4993150981273408.5 
rqeid=00a499314ea81273c08.0.17.1.3.b._favorites_.1.1.0.1.1.2.button.5.1.1.map>
  request: <WORequest[0x0x7c2f5188]: method=GET 
uri=/OpenGroupware.woa/wo/3052305201499313FD/00a499314ea81273c08.0.17.1.3.b._favorites_.1.1.0.1.1.2.button.5.1.1.map
 
app=OpenGroupware rqKey=wo 
rqPath=3052305201499313FD/00a499314ea81273c08.0.17.1.3.b._favorites_.1.1.0.1.1.2.button.5.1.1.map>

  class:   NSException
  name:    NSGenericException
  reason:  subclass WOHTTPURLHandle(class) should override cachedHandleForURL:
  info:
 
So I took a look what GSHTTPURLHandler is doing, and for now I added the 
following to WOHTTPURLHandle class in SOPE:
+ (NSURLHandle*) cachedHandleForURL: (NSURL*)newUrl
{
  NSURLHandle   *obj = nil;
  return obj;
}

that made the problem disappear. As helge always says, it works for him on 
libFoundation and on Cocoa, the difference seems to be in GNUstep ???

Getting that out of the way, made me run into the next exception:
 Application Server caught exception:

  session: 26BD26BD0149931DF0
  element: 00b49931f1180026408.5
  context: <0x0x80026408[WOContext]: 00b49931f1180026408 app=ogo-webui-1.1 
sn=26BD26BD0149931DF0 eid=00b49931f1180026408.5 
rqeid=00a49931f077e880408.0.17.1.3.b.0.9.0.1.5.0.1.1.2.button.5.1.1.map>
  request: <WORequest[0x0x7c634708]: method=GET 
uri=/OpenGroupware.woa/wo/26BD26BD0149931DF0/00a49931f077e880408.0.17.1.3.b.0.9.0.1.5.0.1.1.2.button.5.1.1.map
 
app=OpenGroupware rqKey=wo 
rqPath=26BD26BD0149931DF0/00a49931f077e880408.0.17.1.3.b.0.9.0.1.5.0.1.1.2.button.5.1.1.map>

  class:   NSException
  name:    NSInvalidArgumentException
  reason:  -initWithString: given nil string
  info:

I had this in my code:
  if ([_company respondsToSelector:@selector(firstname)]) {
      fullName = [[NSString alloc]initWithFormat:@"%@ %@", [_company 
valueForKey:@"firstname"], [_company name]];
      email = [[NSString alloc] initWithString:[_company 
valueForKey:@"email1"]];
  } else {
    fullName = [[NSString alloc]initWithString:[_company name]];
      email = [[NSString alloc] initWithString:[_company 
valueForKey:@"email"]];
  }


and I had to change it to make it work, now it looks like this:


  if ([_company respondsToSelector:@selector(firstname)]) {
    if ([_company valueForKey:@"firstname"] != nil)
      fullName = [[NSString alloc]initWithFormat:@"%@ %@", [_company 
valueForKey:@"firstname"], [_company name]];
    else
      fullName = [[NSString alloc]initWithFormat:@"%@", [_company name]];

    if ([_company valueForKey:@"email1"] != nil)
      email = [[NSString alloc] initWithString:[_company 
valueForKey:@"email1"]];
    else
      email = [[NSString alloc] initWithString:@""];
  } else {
    fullName = [[NSString alloc]initWithString:[_company name]];
    if ([_company valueForKey:@"email"] != nil)
      email = [[NSString alloc] initWithString:[_company 
valueForKey:@"email"]];
    else
      email = [[NSString alloc] initWithString:@""];
  }

So it seems, on libFoundation  I can initialize a NSString with a nil string, 
but not on GNUstep. I also have no idea which one is the right one.

for everybody interested, the gnustep ports of sope and ogo are here:
http://svn.opengroupware.org/cgi-bin/viewvc.cgi/branches/gsmake2/?root=SOPE
http://svn.opengroupware.org/cgi-bin/viewvc.cgi/branches/ogo-gsmake2/?root=OGo
Note: I also apply the patches to SOPE that come with SOGo. Those patches can 
be found in the sope port here: https://www.l00-bugdead-prods.de/sope.tar.gz 
in the patches subdirectory.
In case someone wants to try all that on openbsd, I've ports here:
https://www.l00-bugdead-prods.de/ports.html
you'll need the libffi port, replace the gnustep ports tree, with the one 
there, and the sope and ogo ports.

cheers
Sebastian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]