Diff for /chimera/BookmarksService.mm between versions 1.20 and 1.22

version 1.20, 2002/04/14 21:41:21 version 1.22, 2002/04/17 08:31:11
Line 67 Line 67
   
 -(void) dealloc  -(void) dealloc
 {  {
    [super dealloc];  [super dealloc];
 }  }
   
 -(void) windowClosing  -(void) windowClosing
 {  {
    if (mBookmarks) {  if (mBookmarks) {
        mBookmarks->RemoveObserver();    mBookmarks->RemoveObserver();
        delete mBookmarks;    delete mBookmarks;
    }  }
 }  }
   
 -(void) ensureBookmarks  -(void) ensureBookmarks
Line 405  nsIDocument* BookmarksService::gBookmark Line 405  nsIDocument* BookmarksService::gBookmark
 NSMutableDictionary* BookmarksService::gDictionary = nil;  NSMutableDictionary* BookmarksService::gDictionary = nil;
 MainController* BookmarksService::gMainController = nil;  MainController* BookmarksService::gMainController = nil;
 NSMenu* BookmarksService::gBookmarksMenu = nil;  NSMenu* BookmarksService::gBookmarksMenu = nil;
   nsIDOMElement* BookmarksService::gToolbarRoot = nsnull;
 nsIAtom* BookmarksService::gFolderAtom = nsnull;  nsIAtom* BookmarksService::gFolderAtom = nsnull;
 nsIAtom* BookmarksService::gBookmarkAtom = nsnull;  nsIAtom* BookmarksService::gBookmarkAtom = nsnull;
 nsIAtom* BookmarksService::gHrefAtom = nsnull;  nsIAtom* BookmarksService::gHrefAtom = nsnull;
Line 413  nsVoidArray* BookmarksService::gInstance Line 414  nsVoidArray* BookmarksService::gInstance
   
 BookmarksService::BookmarksService(BookmarksDataSource* aDataSource)  BookmarksService::BookmarksService(BookmarksDataSource* aDataSource)
 {  {
    mDataSource = aDataSource;  mDataSource = aDataSource;
   mToolbar = nil;
 }
 
 BookmarksService::BookmarksService(BookmarksToolbar* aToolbar)
 {
   mDataSource = nil;
   mToolbar = aToolbar;
 }  }
   
 BookmarksService::~BookmarksService()  BookmarksService::~BookmarksService()
Line 625  BookmarksService::FlushBookmarks() Line 633  BookmarksService::FlushBookmarks()
     domSerializer->SerializeToStream(domDoc, outputStream, nsnull);      domSerializer->SerializeToStream(domDoc, outputStream, nsnull);
 }  }
   
   void BookmarksService::EnsureToolbarRoot()
   {
     if (gToolbarRoot)
       return;
   
     nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(gBookmarks));
     nsCOMPtr<nsIDOMElement> rootElt;
     domDoc->GetDocumentElement(getter_AddRefs(rootElt));
     
     nsCOMPtr<nsIDOMNode> child;
     rootElt->GetFirstChild(getter_AddRefs(child));
     nsAutoString typeValue;
     while (child) {
       nsCOMPtr<nsIDOMElement> childElt(do_QueryInterface(child));
       if (childElt) {
         childElt->GetAttribute(NS_LITERAL_STRING("type"), typeValue);
         if (typeValue.Equals(NS_LITERAL_STRING("toolbar")))
           gToolbarRoot = childElt;
       }
       
       nsCOMPtr<nsIDOMNode> temp;
       child->GetNextSibling(getter_AddRefs(temp));
       child = temp;
     }
   
     if (!gToolbarRoot) {
       printf("Repairing personal toolbar.\n");
       nsCOMPtr<nsIDOMElement> elt;
       domDoc->CreateElementNS(NS_LITERAL_STRING("http://chimera.mozdev.org/bookmarks/"),
                               NS_LITERAL_STRING("folder"),
                               getter_AddRefs(elt));
   
       elt->SetAttribute(NS_LITERAL_STRING("name"), NS_LITERAL_STRING("Toolbar Bookmarks"));
       elt->SetAttribute(NS_LITERAL_STRING("type"), NS_LITERAL_STRING("toolbar"));
   
       nsCOMPtr<nsIDOMNode> dummy;
       rootElt->AppendChild(elt, getter_AddRefs(dummy));
       gToolbarRoot = elt;
     }
   }
   
 void  void
 BookmarksService::ConstructBookmarksMenu(NSMenu* aMenu, nsIContent* aContent)  BookmarksService::ConstructBookmarksMenu(NSMenu* aMenu, nsIContent* aContent)
 {  {

Removed from v.1.20  
changed lines
  Added in v.1.22


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>