diff --git a/camino/src/bookmarks/Bookmark.mm b/camino/src/bookmarks/Bookmark.mm index f39077b4b8b2..98b50045994b 100644 --- a/camino/src/bookmarks/Bookmark.mm +++ b/camino/src/bookmarks/Bookmark.mm @@ -606,15 +606,15 @@ static void doHTTPUpdateCallBack(CFReadStreamRef stream, CFStreamEventType type, for (unsigned i = 0;i 0) - formatString = @"%@
%s\n%@
%s\n"; + formatString = @"%@
%@\n%@
%@\n"; else - formatString = @"%@
%s\n"; + formatString = @"%@
%@\n"; return [NSString stringWithFormat:formatString, padString, - [[self url] UTF8String], - [[mTitle stringByAddingAmpEscapes] UTF8String], + [self url], + [mTitle stringByAddingAmpEscapes], padString, - [[mDescription stringByAddingAmpEscapes] UTF8String]]; + [mDescription stringByAddingAmpEscapes]]; } // diff --git a/camino/src/bookmarks/BookmarkFolder.mm b/camino/src/bookmarks/BookmarkFolder.mm index 8fd6e2d875de..83c8d64f7ac2 100644 --- a/camino/src/bookmarks/BookmarkFolder.mm +++ b/camino/src/bookmarks/BookmarkFolder.mm @@ -796,7 +796,19 @@ NSString* BookmarkFolderDockMenuChangeNotificaton = @"bf_dmc"; [self setTitle:[aDict objectForKey:BMTitleKey]]; [self setDescription:[aDict objectForKey:BMFolderDescKey]]; [self setKeyword:[aDict objectForKey:BMFolderKeywordKey]]; - [self setSpecialFlag:[[aDict objectForKey:BMFolderTypeKey] unsignedIntValue]]; + unsigned int flag = [[aDict objectForKey:BMFolderTypeKey] unsignedIntValue]; + // on the off chance we've imported somebody else's bookmarks after startup, + // we need to clear any super special flags on it. if we have a shared bookmark manager, + // we're not in startup, so clear things out. + if ([BookmarkManager sharedBookmarkManager]) { + if ((flag & kBookmarkRootFolder) != 0) + flag &= ~kBookmarkRootFolder; + if ((flag & kBookmarkToolbarFolder) != 0) + flag &= ~kBookmarkToolbarFolder; + if ((flag & kBookmarkSmartFolder) != 0) + flag &= ~kBookmarkSmartFolder; + } + [self setSpecialFlag:flag]; enumerator = [[aDict objectForKey:BMChildrenKey] objectEnumerator]; while ((aKid = [enumerator nextObject]) && noErr) { if ([aKid objectForKey:BMChildrenKey]) @@ -972,13 +984,13 @@ NSString* BookmarkFolderDockMenuChangeNotificaton = @"bf_dmc"; formatString = @"%@

%@

\n%@

\n"; else formatString = @"%@

%@

\n%@

\n"; - htmlString = [NSString stringWithFormat:formatString, padString, [NSString stringWithUTF8String:[[mTitle stringByAddingAmpEscapes] UTF8String]], padString]; + htmlString = [NSString stringWithFormat:formatString, padString,[mTitle stringByAddingAmpEscapes],padString]; } // Toolbar Folder else if ([self isToolbar]) htmlString = [NSString stringWithFormat:@"%@

%@

\n%@

\n", padString, - [NSString stringWithUTF8String:[[mTitle stringByAddingAmpEscapes] UTF8String]], + [mTitle stringByAddingAmpEscapes], padString]; // Root Folder else if ([self isRoot]) diff --git a/camino/src/bookmarks/BookmarkManager.mm b/camino/src/bookmarks/BookmarkManager.mm index 31b7429df8d8..66fefe27ac27 100644 --- a/camino/src/bookmarks/BookmarkManager.mm +++ b/camino/src/bookmarks/BookmarkManager.mm @@ -809,10 +809,9 @@ static unsigned gFirstUserCollection = 0; - (void) writeHTMLFile:(NSString *)pathToFile { - NSString *htmlString = [[self rootBookmarks] writeHTML:0]; - if (![htmlString writeToFile:[pathToFile stringByStandardizingPath] atomically:YES]) + NSData *htmlData = [[[self rootBookmarks] writeHTML:0] dataUsingEncoding:NSUTF8StringEncoding]; + if (![htmlData writeToFile:[pathToFile stringByStandardizingPath] atomically:YES]) NSLog(@"writeHTML: Failed to write file %@",pathToFile); - return; } -(void) writeSafariFile:(NSString *)pathToFile @@ -820,15 +819,13 @@ static unsigned gFirstUserCollection = 0; NSDictionary* dict = [[self rootBookmarks] writeSafariDictionary]; if (![dict writeToFile:[pathToFile stringByStandardizingPath] atomically:YES]) NSLog(@"writeSafariFile: Failed to write file %@",pathToFile); - return; - } + -(void)writePropertyListFile:(NSString *)pathToFile { NSDictionary* dict = [[self rootBookmarks] writeNativeDictionary]; if (![dict writeToFile:[pathToFile stringByStandardizingPath] atomically:YES]) NSLog(@"writePropertyList: Failed to write file %@",pathToFile); - return; }