]> err.no Git - sope/commitdiff
fixed NSURL related issues on MacOSX
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sat, 5 Mar 2005 20:34:10 +0000 (20:34 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sat, 5 Mar 2005 20:34:10 +0000 (20:34 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@618 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-mime/ChangeLog
sope-mime/NGImap4/ChangeLog
sope-mime/NGImap4/NGImap4Context.m
sope-mime/NGImap4/NGImap4Folder.m
sope-mime/Version

index 3e7e5e5a93261f684015f90389765a5a5723d35f..e5f06fa4a2df10cb173e564804db28b741c47136 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-05  Helge Hess  <helge.hess@opengroupware.org>
+
+       * NGImap4: fixed a MacOSX incompatibility (v4.5.216)
+
 2005-03-03  Helge Hess  <helge.hess@opengroupware.org>
 
        * NGImap4: added some debugging facilities (v4.5.215)
index 60bb5a77d92d221ec1a4e93ff8536647b119a764..d3b244994b50079e6e109bee8a485e9bfcdd8a40 100644 (file)
@@ -1,3 +1,11 @@
+2005-03-05  Helge Hess  <helge.hess@opengroupware.org>
+
+       * NGImap4Folder.m: properly create NSURL if the absolute name doesn't
+         start with a slash
+
+       * NGImap4Context.m: initialize NSURL with a path to avoid an issue on
+         MacOSX
+
 2005-03-03  Helge Hess  <helge.hess@opengroupware.org>
 
        * NGImap4FileManager.m: added debug logs which can be enabled using
index 645f8c3b5df59e75d4f23837671dec465bb63f41..81e1deb51843babe41771a0041a0fe6d38ee5f73 100644 (file)
@@ -190,7 +190,7 @@ static int ImapLogEnabled                           = -1;
 - (NSURL *)url {
   NSString *scheme;
   
-  if (self->url)
+  if (self->url != nil)
     return self->url;
   
   scheme = [[self->connectionDictionary objectForKey:@"SSL"] boolValue]
@@ -199,7 +199,7 @@ static int ImapLogEnabled                           = -1;
   self->url = [[NSURL alloc]
                initWithScheme:scheme
                host:[self->connectionDictionary objectForKey:@"host"]
-               path:nil];
+               path:@"/"];
   return self->url;
 }
 
index 2d90dd9c00b2e802625ccc5eae6f599280595287..161c33ee58a80b7def78e49af49f2e420605c0e0 100644 (file)
@@ -236,6 +236,8 @@ static int FetchNewUnseenMessagesInSubFoldersOnDemand = -1;
 }
 
 - (NSString *)absoluteName {
+  // TODO: sometimes this contains a name with no / in front (eg Dovecot on
+  //       MacOSX). Find out why this is.
   return self->name;
 }
 
@@ -1747,17 +1749,23 @@ static int FetchNewUnseenMessagesInSubFoldersOnDemand = -1;
 }
 
 - (NSURL *)url {
+  NSString *p;
   NSURL *base;
   
-  if (self->url)
+  if (self->url != nil)
     return self->url;
-
-  base = [self->context url];
-
+  
+  if ((base = [self->context url]) == nil) {
+    [self logWithFormat:@"ERROR: got no URL for context: %@", self->context];
+    return nil;
+  }
+  
+  if ((p = [self absoluteName]) == nil)
+    return nil;
+  
+  if (![p hasPrefix:@"/"]) p = [@"/" stringByAppendingString:p];
   self->url = [[NSURL alloc]
-               initWithScheme:[base scheme]
-               host:[base host]
-               path:[self absoluteName]];
+               initWithScheme:[base scheme] host:[base host] path:p];
   return self->url;
 }
 
index c61276a2ef80a807e04de8abbe7602d6bd752ab8..126abde2d98c9fb0ee68523ac74db2c52974f47c 100644 (file)
@@ -2,7 +2,7 @@
 
 MAJOR_VERSION:=4
 MINOR_VERSION:=5
-SUBMINOR_VERSION:=215
+SUBMINOR_VERSION:=216
 
 # v4.5.214 requires libNGExtensions v4.5.146
 # v4.2.149 requires libNGStreams    v4.2.34