--- GNUMail/ApplicationIconController.m	2004-12-30 05:44:20.000000000 +1300
+++ GNUMail-new/ApplicationIconController.m	2005-06-17 21:17:09.000000000 +1200
@@ -101,6 +101,8 @@
   NSArray *allFolders, *allKeys;
   id<NSObject> aStore;
 
+  NSString *aFolderName;
+
   unsigned int c, i, j, v, result;
   
   cache = [[MailboxManagerController singleInstance] cache];
@@ -115,8 +117,11 @@
 
       for (j = 0; j < c; j++)
 	{
+	  aFolderName = [[allFolders objectAtIndex: j] stringByReplacingOccurrencesOfCharacter: '.'
+						       withCharacter: '/'];
+	  
 	  [cache allValuesForStoreName: ([aStore isKindOfClass: [CWIMAPStore class]] ? [(CWIMAPStore *)aStore name] : @"GNUMAIL_LOCAL_STORE")
-		 folderName: [allFolders objectAtIndex: j]
+		 folderName: aFolderName
 		 username: ([aStore isKindOfClass: [CWIMAPStore class]] ? [(CWIMAPStore *)aStore username] : NSUserName())
 		 nbOfMessages: NULL
 		 nbOfUnreadMessages: &v];
@@ -281,7 +286,7 @@
   NSImage *image;
   int v;
   
-  image = [NSImage imageNamed: @"GNUMail_128"];
+  image = [[NSImage imageNamed: @"GNUMail_128"] copy];
   [image lockFocus];
   
   v = number_of_unread_messages();
@@ -293,6 +298,7 @@
   
   [image unlockFocus];
   [NSApp setApplicationIconImage: image];
+  [image release];
 #endif
 }
 

