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

version 1.22, 2002/04/17 08:31:11 version 1.30, 2002/04/20 00:44:56
Line 58 Line 58
   
 -(id) init  -(id) init
 {  {
    [super init];    if ( (self = [super init]) ) {
    mBookmarks = nsnull;        mBookmarks = nsnull;
    mCachedParent = nsnull;        mCachedHref = nil;
    mCachedHref = nil;    }
     return self;      return self;
 }  }
   
Line 88 Line 88
           
     [mOutlineView setTarget: self];      [mOutlineView setTarget: self];
     [mOutlineView setDoubleAction: @selector(openBookmark:)];      [mOutlineView setDoubleAction: @selector(openBookmark:)];
       [mOutlineView setDeleteAction: @selector(deleteBookmarks:)];
     [mOutlineView reloadData];      [mOutlineView reloadData];
 }  }
   
 -(IBAction)addBookmark:(id)aSender  -(IBAction)addBookmark:(id)aSender
 {  {
  [self addBookmark: aSender useSelection: YES];  [self addBookmark: aSender useSelection: YES isFolder: NO];
 }
 
 -(IBAction)addFolder:(id)aSender
 {
   [self addBookmark: aSender useSelection: YES isFolder: YES];
 }  }
   
-(void)addBookmark:(id)aSender useSelection:(BOOL)aUseSel-(void)addBookmark:(id)aSender useSelection:(BOOL)aUseSel isFolder:(BOOL)aIsFolder
 {  {
   if (!mBookmarks)    if (!mBookmarks)
     return;      return;
   
  nsCOMPtr<nsIContent> content;  // We use the selected item to determine the parent only if aUseSel is YES.
  if (aUseSel) {  BookmarkItem* item = nil;
   if (aUseSel && ([mOutlineView numberOfSelectedRows] == 1)) {
     // There is only one selected row.  If it is a folder, use it as our parent.
     // Otherwise, use our parent,
     int index = [mOutlineView selectedRow];      int index = [mOutlineView selectedRow];
    item = [mOutlineView itemAtRow: index];
    if (index >= 0) {    if (![mOutlineView isExpandable: item]) {
      BookmarkItem* item = [mOutlineView itemAtRow: index];      // We can't be used as the parent.  Try our parent.
      if ([mOutlineView isExpandable: item])      nsIContent* content = [item contentNode];
        content = [item contentNode];      nsCOMPtr<nsIContent> parentContent;
       content->GetParent(*getter_AddRefs(parentContent));
       nsCOMPtr<nsIContent> root;
       mBookmarks->GetRootContent(getter_AddRefs(root));
       
       // The root has no item, so we don't need to do a lookup unless we
       // aren't the root.
       if (parentContent != root) {
         PRUint32 contentID;
         parentContent->GetContentID(&contentID);
         item = [(BookmarksService::gDictionary) objectForKey: [NSNumber numberWithInt: contentID]];
       }
     }      }
   }    }
   
   if (!content)  
     mBookmarks->GetRootContent(getter_AddRefs(content));  
   
   nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(mBookmarks->gBookmarks));    nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(mBookmarks->gBookmarks));
       
   // Fetch the title of the current page and the URL.    // Fetch the title of the current page and the URL.
  nsCOMPtr<nsIWebBrowser> webBrowser = getter_AddRefs([[[mBrowserWindowController getMyBrowserView] getBrowserView] getWebBrowser]);  nsAutoString title, href;
  nsCOMPtr<nsIDOMWindow> window;  if (!aIsFolder) {
  webBrowser->GetContentDOMWindow(getter_AddRefs(window));    BookmarksService::GetTitleAndHrefForBrowserView([[mBrowserWindowController getMyBrowserView] getBrowserView],
  nsCOMPtr<nsIDOMDocument> htmlDoc;                                                    title, href);
  window->GetDocument(getter_AddRefs(htmlDoc)); 
  nsCOMPtr<nsIDocument> pageDoc(do_QueryInterface(htmlDoc)); 
   
  nsAutoString href;    mCachedHref = [NSString stringWithCharacters: href.get() length: nsCRT::strlen(href.get())];
  if (pageDoc) {    [mCachedHref retain];
    nsCOMPtr<nsIURI> url;  }
    pageDoc->GetDocumentURL(getter_AddRefs(url));  else {
    nsCAutoString spec;    mCachedHref = nil;
    url->GetSpec(spec);    title = NS_LITERAL_STRING("New Folder");
    href.AssignWithConversion(spec.get()); 
   }    }
   
   mCachedHref = [NSString stringWithCharacters: href.get() length: nsCRT::strlen(href.get())];  
   [mCachedHref retain];  
     
   mCachedParent = content;  
     
   nsAutoString title;  
   nsCOMPtr<nsIDOMHTMLDocument> htmlDocument(do_QueryInterface(htmlDoc));  
   if (htmlDocument)  
     htmlDocument->GetTitle(title);  
   if (title.IsEmpty())  
     title = href;  
       
   NSTextField* textField = [mBrowserWindowController getAddBookmarkTitle];    NSTextField* textField = [mBrowserWindowController getAddBookmarkTitle];
   [textField setStringValue: [NSString stringWithCharacters: title.get() length: nsCRT::strlen(title.get())]];    [textField setStringValue: [NSString stringWithCharacters: title.get() length: nsCRT::strlen(title.get())]];
   
   [mBrowserWindowController cacheBookmarkDS: self];    [mBrowserWindowController cacheBookmarkDS: self];
   
     // Show/hide the bookmark all tabs checkbox as appropriate.
     NSTabView* tabView = [mBrowserWindowController getTabBrowser];
     id checkbox = [mBrowserWindowController getAddBookmarkCheckbox];
     BOOL hasSuperview = [checkbox superview] != nil;
     if (aIsFolder && hasSuperview) {
       // Just don't show it at all.
       [checkbox removeFromSuperview];
       [checkbox retain];
     }
     else if (!aIsFolder && !hasSuperview) {
       // Put it back in.
       [[[mBrowserWindowController getAddBookmarkSheetWindow] contentView] addSubview: checkbox];
       [checkbox autorelease];
     }
   
     // Enable the bookmark all tabs checkbox if appropriate.
     if (!aIsFolder)
       [[mBrowserWindowController getAddBookmarkCheckbox] setEnabled: ([tabView numberOfTabViewItems] > 1)];
     
     // Build up the folder list.
     NSPopUpButton* popup = [mBrowserWindowController getAddBookmarkFolder];
     BookmarksService::ConstructAddBookmarkFolderList(popup, item);
       
   [NSApp beginSheet:    [mBrowserWindowController getAddBookmarkSheetWindow]    [NSApp beginSheet:    [mBrowserWindowController getAddBookmarkSheetWindow]
      modalForWindow:    [mBrowserWindowController window]       modalForWindow:    [mBrowserWindowController window]
Line 162 Line 187
 {  {
   if (aCode == 0)    if (aCode == 0)
     return;      return;
   
     BOOL isGroup = NO;
     id checkbox = [mBrowserWindowController getAddBookmarkCheckbox];
     if (([checkbox superview] != nil) && [checkbox isEnabled] && ([checkbox state] == NSOnState)) {
       mCachedHref = nil;
       isGroup = YES;
     }
       
   const char* titleC = [[[mBrowserWindowController getAddBookmarkTitle] stringValue] cString];    const char* titleC = [[[mBrowserWindowController getAddBookmarkTitle] stringValue] cString];
   nsAutoString title; title.AssignWithConversion(titleC);    nsAutoString title; title.AssignWithConversion(titleC);
   
     nsAutoString tagName;
     if (mCachedHref)
       tagName = NS_LITERAL_STRING("bookmark");
     else
       tagName = NS_LITERAL_STRING("folder");
     
   nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(mBookmarks->gBookmarks));    nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(mBookmarks->gBookmarks));
   nsCOMPtr<nsIDOMElement> elt;    nsCOMPtr<nsIDOMElement> elt;
  domDoc->CreateElementNS(NS_LITERAL_STRING("http://chimera.mozdev.org/bookmarks"),  domDoc->CreateElementNS(NS_LITERAL_STRING("http://chimera.mozdev.org/bookmarks/"),
                          NS_LITERAL_STRING("bookmark"),                          tagName,
                           getter_AddRefs(elt));                            getter_AddRefs(elt));
   
   elt->SetAttribute(NS_LITERAL_STRING("name"), title);    elt->SetAttribute(NS_LITERAL_STRING("name"), title);
   nsAutoString href; href.AssignWithConversion([mCachedHref cString]);  
   [mCachedHref release];  
     
   elt->SetAttribute(NS_LITERAL_STRING("href"), href);  
   
  nsCOMPtr<nsIDOMElement> parent(do_QueryInterface(mCachedParent));  if (mCachedHref) {
     nsAutoString href; href.AssignWithConversion([mCachedHref cString]);
     [mCachedHref release];
     elt->SetAttribute(NS_LITERAL_STRING("href"), href);
   }
 
   if (isGroup) {
     // We have to iterate over each tab and create content nodes using the
     // title/href of all the pages.  They are inserted underneath the parent.
     elt->SetAttribute(NS_LITERAL_STRING("group"), NS_LITERAL_STRING("true"));
     id tabBrowser = [mBrowserWindowController getTabBrowser];
     int count = [tabBrowser numberOfTabViewItems];
     for (int i = 0; i < count; i++) {
       id browserView = [[[tabBrowser tabViewItemAtIndex: i] view] getBrowserView];
       nsAutoString title, href;
       BookmarksService::GetTitleAndHrefForBrowserView(browserView, title, href);
       nsCOMPtr<nsIDOMElement> childElt;
       domDoc->CreateElementNS(NS_LITERAL_STRING("http://chimera.mozdev.org/bookmarks/"),
                               NS_LITERAL_STRING("bookmark"),
                               getter_AddRefs(childElt));
       childElt->SetAttribute(NS_LITERAL_STRING("name"), title);
       childElt->SetAttribute(NS_LITERAL_STRING("href"), href);
       nsCOMPtr<nsIDOMNode> dummy;
       elt->AppendChild(childElt, getter_AddRefs(dummy));
     }
   }
   
   // Figure out the parent element.
   nsCOMPtr<nsIDOMElement> parentElt;
   nsCOMPtr<nsIContent> parentContent;
   NSPopUpButton* popup = [mBrowserWindowController getAddBookmarkFolder];
   NSMenuItem* selectedItem = [popup selectedItem];
   int tag = [selectedItem tag];
   if (tag == -1) {
     mBookmarks->GetRootContent(getter_AddRefs(parentContent));
     parentElt = do_QueryInterface(parentContent);
   }
   else {
     BookmarkItem* item = [(BookmarksService::gDictionary) objectForKey: [NSNumber numberWithInt: tag]];
     // Get the content node.
     parentContent = [item contentNode];
     parentElt = do_QueryInterface(parentContent);
   }
   
   nsCOMPtr<nsIDOMNode> dummy;    nsCOMPtr<nsIDOMNode> dummy;
  parent->AppendChild(elt, getter_AddRefs(dummy));  parentElt->AppendChild(elt, getter_AddRefs(dummy));
   
   nsCOMPtr<nsIContent> childContent(do_QueryInterface(elt));    nsCOMPtr<nsIContent> childContent(do_QueryInterface(elt));
  mBookmarks->BookmarkAdded(mCachedParent, childContent);  mBookmarks->BookmarkAdded(parentContent, childContent);
 }  }
   
-(IBAction)deleteBookmark: (id)aSender-(IBAction)deleteBookmarks: (id)aSender
 {  {
    if (!mBookmarks)  if (!mBookmarks)
        return;    return;
    
    int index = [mOutlineView selectedRow];  int index = [mOutlineView selectedRow];
    if (index == -1)  if (index == -1)
        return;    return;
          if ([mOutlineView numberOfSelectedRows] == 1) {
     BookmarkItem* item = [mOutlineView itemAtRow: index];      BookmarkItem* item = [mOutlineView itemAtRow: index];
    nsCOMPtr<nsIContent> content = [item contentNode];    [self deleteBookmark: item];
    nsCOMPtr<nsIDOMElement> child(do_QueryInterface(content)); 
    nsCOMPtr<nsIDOMNode> parent; 
    child->GetParentNode(getter_AddRefs(parent)); 
    nsCOMPtr<nsIContent> parentContent(do_QueryInterface(parent)); 
    nsCOMPtr<nsIDOMNode> dummy; 
    parent->RemoveChild(child, getter_AddRefs(dummy)); 
    mBookmarks->BookmarkRemoved(parentContent, content); 
     
     int total = [mOutlineView numberOfRows];      int total = [mOutlineView numberOfRows];
     if (index == total)      if (index == total)
        index--;      index--;
         
     [mOutlineView selectRow: index byExtendingSelection: NO];      [mOutlineView selectRow: index byExtendingSelection: NO];
     }
     else {
       NSMutableArray* itemsToDelete = [[[NSMutableArray alloc] init] autorelease];
       NSEnumerator* selRows = [mOutlineView selectedRowEnumerator];
       for (NSNumber* currIndex = [selRows nextObject];
            currIndex != nil;
            currIndex = [selRows nextObject]) {
         index = [currIndex intValue];
         BookmarkItem* item = [mOutlineView itemAtRow: index];
         [itemsToDelete addObject: item];
       }
   
       int count = [itemsToDelete count];
       for (int i = 0; i < count; i++) {
         BookmarkItem* item = [itemsToDelete objectAtIndex: i];
         [self deleteBookmark: item];      
       }
     }
   }       
   
   -(void)deleteBookmark:(id)aItem
   {
     nsCOMPtr<nsIContent> content = [aItem contentNode];
     nsCOMPtr<nsIDOMElement> child(do_QueryInterface(content));
     if (child == BookmarksService::gToolbarRoot)
       return; // Don't allow the personal toolbar to be deleted.
     
     nsCOMPtr<nsIDOMNode> parent;
     child->GetParentNode(getter_AddRefs(parent));
     nsCOMPtr<nsIContent> parentContent(do_QueryInterface(parent));
     nsCOMPtr<nsIDOMNode> dummy;
     parent->RemoveChild(child, getter_AddRefs(dummy));
     mBookmarks->BookmarkRemoved(parentContent, content);
 }  }
   
 -(IBAction)openBookmark: (id)aSender  -(IBAction)openBookmark: (id)aSender
 {  {
    int index = [mOutlineView selectedRow];  int index = [mOutlineView selectedRow];
    if (index == -1)  if (index == -1)
        return;    return;
    
    id item = [mOutlineView itemAtRow: index];  id item = [mOutlineView itemAtRow: index];
    if (!item)  if (!item)
        return;    return;
        
    if ([mOutlineView isExpandable: item]) {  nsIContent* content = [item contentNode];
        if ([mOutlineView isItemExpanded: item])  nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(content));
            [mOutlineView collapseItem: item];  nsAutoString group;
        else  elt->GetAttribute(NS_LITERAL_STRING("group"), group);
            [mOutlineView expandItem: item];  if (!group.IsEmpty())
     mBookmarks->OpenBookmarkGroup([mBrowserWindowController getTabBrowser], elt);
   else if ([mOutlineView isExpandable: item]) {
     if ([mOutlineView isItemExpanded: item])
       [mOutlineView collapseItem: item];
     else
       [mOutlineView expandItem: item];
   }
   else {
     nsAutoString href;
     content->GetAttr(kNameSpaceID_None, BookmarksService::gHrefAtom, href);
     if (!href.IsEmpty()) {
       nsCAutoString cstr; cstr.AssignWithConversion(href);
       NSString* url = [NSString stringWithCString: cstr.get()];
       [[[mBrowserWindowController getMyBrowserView] getBrowserView] loadURI:[NSURL URLWithString: url] flags:                   NSLoadFlagsNone];
       // Focus and activate our content area.
       [[[mBrowserWindowController getMyBrowserView] getBrowserView] setActive: YES];
     }      }
    else {  }
        nsIContent* content = [item contentNode]; 
        nsAutoString href; 
        content->GetAttr(kNameSpaceID_None, BookmarksService::gHrefAtom, href); 
        if (!href.IsEmpty()) { 
            nsCAutoString cstr; cstr.AssignWithConversion(href); 
            NSString* url = [NSString stringWithCString: cstr.get()]; 
            [[[mBrowserWindowController getMyBrowserView] getBrowserView] loadURI:[NSURL URLWithString: url] flags:NSLoadFlagsNone]; 
            // Focus and activate our content area. 
            [[[mBrowserWindowController getMyBrowserView] getBrowserView] setActive: YES]; 
        } 
    }  
 }  }
   
 - (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item  - (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item
Line 466  BookmarksService::LocateMenu(nsIContent* Line 572  BookmarksService::LocateMenu(nsIContent*
 {  {
   nsCOMPtr<nsIContent> parent;    nsCOMPtr<nsIContent> parent;
   aContent->GetParent(*getter_AddRefs(parent));    aContent->GetParent(*getter_AddRefs(parent));
  if (!parent)  if (!parent) {
     return BookmarksService::gBookmarksMenu;      return BookmarksService::gBookmarksMenu;
  }
   
   NSMenu* parentMenu = LocateMenu(parent);    NSMenu* parentMenu = LocateMenu(parent);
       
   PRUint32 contentID;    PRUint32 contentID;
   aContent->GetContentID(&contentID);    aContent->GetContentID(&contentID);
   
   NSMenuItem* childMenu = [parentMenu itemWithTag: contentID];    NSMenuItem* childMenu = [parentMenu itemWithTag: contentID];
  return [childMenu menu];  return [childMenu submenu];
 }  }
   
 void  void
Line 500  BookmarksService::BookmarkAdded(nsIConte Line 607  BookmarksService::BookmarkAdded(nsIConte
   
       [(instance->mDataSource) reloadDataForItem: item reloadChildren: YES];        [(instance->mDataSource) reloadDataForItem: item reloadChildren: YES];
     }      }
       else if (instance->mToolbar) {
         // We're a personal toolbar.
         nsCOMPtr<nsIDOMElement> parentElt(do_QueryInterface(aContainer));
         if (parentElt == gToolbarRoot) {
           // We only care about changes that occur to the personal toolbar's immediate
           // children.
           PRInt32 index = -1;
           aContainer->IndexOf(aChild, index);
           nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aChild));
           [(instance->mToolbar) addButton: elt atIndex: index];
         }
       }
     else {      else {
       // We're the menu.        // We're the menu.
       PRInt32 index = -1;        PRInt32 index = -1;
      aChild->IndexOf(aContainer, index);      aContainer->IndexOf(aChild, index);
       NSMenu* menu = LocateMenu(aContainer);        NSMenu* menu = LocateMenu(aContainer);
       AddMenuBookmark(menu, aContainer, aChild, index);        AddMenuBookmark(menu, aContainer, aChild, index);
     }      }
Line 553  BookmarksService::BookmarkRemoved(nsICon Line 672  BookmarksService::BookmarkRemoved(nsICon
   
       [(instance->mDataSource) reloadDataForItem: item reloadChildren: YES];        [(instance->mDataSource) reloadDataForItem: item reloadChildren: YES];
     }      }
       else if (instance->mToolbar) {
         // We're a personal toolbar.
         nsCOMPtr<nsIDOMElement> parentElt(do_QueryInterface(aContainer));
         if (parentElt == gToolbarRoot) {
           // We only care about changes that occur to the personal toolbar's immediate
           // children.
           nsCOMPtr<nsIDOMElement> childElt(do_QueryInterface(aChild));
           [(instance->mToolbar) removeButton: childElt];
         }
       }    
     else {      else {
       // We're the menu.        // We're the menu.
       NSMenu* menu = LocateMenu(aContainer);        NSMenu* menu = LocateMenu(aContainer);
Line 674  void BookmarksService::EnsureToolbarRoot Line 803  void BookmarksService::EnsureToolbarRoot
   }    }
 }  }
   
   static
   void RecursiveAddBookmarkConstruct(NSPopUpButton* aPopup, NSMenu* aMenu, int aTagToMatch)
   {
     // Get the menu item children.
     NSArray* children = [aMenu itemArray];
     int startPosition = 0;
     if (aMenu == BookmarksService::gBookmarksMenu)
       startPosition = 3;
   
     int count = [children count];
     for (int i = startPosition; i < count; i++) {
       NSMenuItem* menuItem = [children objectAtIndex: i];
       NSMenu* submenu = [menuItem submenu];
       if (submenu) {
         // This is a folder.  Add it to our list and then recur.
         [aPopup addItemWithTitle: [menuItem title]];
         NSMenuItem* lastItem = [aPopup lastItem];
         if ([menuItem tag] == aTagToMatch)
           [aPopup selectItem: lastItem];
         
         [lastItem setTag: [menuItem tag]];
         RecursiveAddBookmarkConstruct(aPopup, submenu, aTagToMatch);
       }
     }
   }
   
   void
   BookmarksService::ConstructAddBookmarkFolderList(NSPopUpButton* aPopup, BookmarkItem* aItem)
   {
     [aPopup removeAllItems];
     [aPopup addItemWithTitle: [gBookmarksMenu title]];
     NSMenuItem* lastItem = [aPopup lastItem];
     [lastItem setTag: -1];
     int tag = -1;
     if (aItem) {
       nsIContent* content = [aItem contentNode];
       PRUint32 utag;
       content->GetContentID(&utag);
       tag = (int)utag;
     }
     RecursiveAddBookmarkConstruct(aPopup, gBookmarksMenu, tag);
   }
   
   void
   BookmarksService::GetTitleAndHrefForBrowserView(id aBrowserView, nsString& aTitle, nsString& aHref)
   {
     nsCOMPtr<nsIWebBrowser> webBrowser = getter_AddRefs([aBrowserView getWebBrowser]);
     nsCOMPtr<nsIDOMWindow> window;
     webBrowser->GetContentDOMWindow(getter_AddRefs(window));
     nsCOMPtr<nsIDOMDocument> htmlDoc;
     window->GetDocument(getter_AddRefs(htmlDoc));
     nsCOMPtr<nsIDocument> pageDoc(do_QueryInterface(htmlDoc));
   
     if (pageDoc) {
       nsCOMPtr<nsIURI> url;
       pageDoc->GetDocumentURL(getter_AddRefs(url));
       nsCAutoString spec;
       url->GetSpec(spec);
       aHref.AssignWithConversion(spec.get());
     }
   
     nsCOMPtr<nsIDOMHTMLDocument> htmlDocument(do_QueryInterface(htmlDoc));
     if (htmlDocument)
       htmlDocument->GetTitle(aTitle);
     if (aTitle.IsEmpty())
       aTitle = aHref;  
   }
   
 void  void
 BookmarksService::ConstructBookmarksMenu(NSMenu* aMenu, nsIContent* aContent)  BookmarksService::ConstructBookmarksMenu(NSMenu* aMenu, nsIContent* aContent)
 {  {
Line 754  BookmarksService::OpenMenuBookmark(Brows Line 951  BookmarksService::OpenMenuBookmark(Brows
           
     // Focus and activate our content area.      // Focus and activate our content area.
     [[[aController getMyBrowserView] getBrowserView] setActive: YES];      [[[aController getMyBrowserView] getBrowserView] setActive: YES];
 }  
   
   }
   
   void
   BookmarksService::OpenBookmarkGroup(id aTabView, nsIDOMElement* aFolder)
   {
     // We might conceivably have to make new tabs in order to load all
     // the items in the group.
     int currentIndex = 0;
     int total = [aTabView numberOfTabViewItems];
     nsCOMPtr<nsIDOMNode> child;
     aFolder->GetFirstChild(getter_AddRefs(child));
     while (child) {
       nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(child));
       if (elt) {
         nsAutoString href;
         elt->GetAttribute(NS_LITERAL_STRING("href"), href);
         if (!href.IsEmpty()) {
           nsCAutoString cref; cref.AssignWithConversion(href);
           NSString* url = [NSString stringWithCString: cref.get()];
           NSTabViewItem* tabViewItem = nil;
           if (currentIndex >= total) {
             // We need to make a new tab.
             tabViewItem = [[[NSTabViewItem alloc] initWithIdentifier: nil] autorelease];
             MyBrowserView* newView = [[[MyBrowserView alloc] initWithTab: tabViewItem andWindow: [aTabView window]] autorelease];
             [tabViewItem setLabel: @"Untitled"];
             [tabViewItem setView: newView];
             [aTabView addTabViewItem: tabViewItem];
           }
           else
             tabViewItem = [aTabView tabViewItemAtIndex: currentIndex];
   
           [[[tabViewItem view] getBrowserView] loadURI:[NSURL URLWithString: url]
                                                  flags: NSLoadFlagsNone];
         }
       }
       
       nsCOMPtr<nsIDOMNode> temp = child;
       temp->GetNextSibling(getter_AddRefs(child));
       currentIndex++;
     }
   
     // XXXdwh Select and activate the first tab.
   }

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


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