--- chimera/BookmarksService.mm 2002/02/11 15:15:50 1.13 +++ chimera/BookmarksService.mm 2002/03/10 08:14:36 1.17 @@ -1,11 +1,39 @@ -/* - * BookmarksService.cpp - * Chimera +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: NPL 1.1/GPL 2.0/LGPL 2.1 * - * Created by David Hyatt on Thu Feb 07 2002. - * Copyright (c) 2001 __MyCompanyName__. All rights reserved. + * The contents of this file are subject to the Netscape Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/NPL/ * - */ + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2002 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the NPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the NPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ #import "NSBrowserView.h" #include "BookmarksService.h" @@ -85,7 +113,7 @@ getter_AddRefs(elt)); // Fetch the title of the current page and the URL. - nsCOMPtr webBrowser = getter_AddRefs([[mBrowserView getBrowserView] getWebBrowser]); + nsCOMPtr webBrowser = getter_AddRefs([[[mBrowserWindowController getMyBrowserView] getBrowserView] getWebBrowser]); nsCOMPtr window; webBrowser->GetContentDOMWindow(getter_AddRefs(window)); nsCOMPtr htmlDoc; @@ -96,8 +124,8 @@ if (pageDoc) { nsCOMPtr url; pageDoc->GetDocumentURL(getter_AddRefs(url)); - nsXPIDLCString spec; - url->GetSpec(getter_Copies(spec)); + nsCAutoString spec; + url->GetSpec(spec); href.AssignWithConversion(spec.get()); } @@ -167,7 +195,7 @@ if (!href.IsEmpty()) { nsCAutoString cstr; cstr.AssignWithConversion(href); NSString* url = [NSString stringWithCString: cstr.get()]; - [[mBrowserView getBrowserView] loadURI:[NSURL URLWithString: url] flags:NSLoadFlagsNone]; + [[[mBrowserWindowController getMyBrowserView] getBrowserView] loadURI:[NSURL URLWithString: url] flags:NSLoadFlagsNone]; } } } @@ -257,7 +285,7 @@ if ( [self outlineView:outlineView isItemExpandable:item] ) { [attachmentAttrStringCell setImage:[NSImage imageNamed:@"folder"]]; } else { - [attachmentAttrStringCell setImage:[NSImage imageNamed:@"smallDocument"]]; + [attachmentAttrStringCell setImage:[NSImage imageNamed:@"smallbookmark"]]; } //Insert the image [cellValue replaceCharactersInRange:NSMakeRange(0, 0) withAttributedString:attachmentAttrString]; @@ -430,8 +458,8 @@ BookmarksService::AddObserver() NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(profileDir)); profileDir->Append("bookmarks.xml"); - nsXPIDLCString bookmarksFileURL; - NS_GetURLSpecFromFile(profileDir, getter_Copies(bookmarksFileURL)); + nsCAutoString bookmarksFileURL; + NS_GetURLSpecFromFile(profileDir, bookmarksFileURL); nsCOMPtr uri; NS_NewURI(getter_AddRefs(uri), bookmarksFileURL.get());