context: function doRemove() {    var tree = document.getElementById('subscriptions');    var item = tree.view.getItemAtIndex(tree.view.selection.currentIndex);    var resource = rdf.GetResource(item.id);    var ds = getSubscriptionsDS();    var feeds = getSubscriptionsList();    var index = feeds.IndexOf(resource);    if (index != -1) {        var title = ds.GetTarget(resource, DC_TITLE, true);        if (title) {            title = title.QueryInterface(Components.interfaces.nsIRDFLiteral);            // We could delete the folder, but what if other feeds are using it?            // XXX Should we check for other feeds using the folder and delete it            // if there aren't any?  What if the user is using the folder            // for other purposes?            var server = getIncomingServer();            var openerResource = server.rootMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource);            var titleValue = title ? title.QueryInterface(Components.interfaces.nsIRDFLiteral).Value : "";            var feed = new Feed(resource);            try {              var folderResource = server.rootMsgFolder.getChildNamed(feed.name).QueryInterface(Components.interfaces.nsIRDFResource);              var foo = window.opener.messenger.DeleteFolders(window.opener.GetFolderDatasource(), openerResource, folderResource);            } catch (e) {}            try {                // If the folder still exists, then it wasn't deleted,                // which means the user answered "no" to the question of whether                // they wanted to move the folder into the trash.  That probably                // means they changed their minds about removing the feed,                // so don't remove it.                folder = server.rootMsgFolder.getChildNamed(feed.name);                if (folder)                   return;            }            catch (e) {}            ds.Unassert(resource, DC_TITLE, title, true);        }        var url = ds.GetTarget(resource, DC_IDENTIFIER, true);        if (url) {            url = url.QueryInterface(Components.interfaces.nsIRDFLiteral);            ds.Unassert(resource, DC_IDENTIFIER, url, true);        }        feeds.RemoveElementAt(index, true);    }    // Remove all assertions about the feed from the subscriptions database.    var ds = getSubscriptionsDS();    removeAssertions(ds, feed);    // Remove all assertions about items in the feed from the items database.    ds = getItemsDS();    var items = ds.GetSources(FZ_FEED, feed, true);    while (items.hasMoreElements()) {        var item = items.getNext();        item = item.QueryInterface(Components.interfaces.nsIRDFResource);        ds.Unassert(item, FZ_FEED, feed, true);        if (ds.hasArcOut(item, FZ_FEED))            debug(item.Value + " is from more than one feed; only the reference to this feed removed");        else            removeAssertions(ds, item);    }    //tree.builder.rebuild();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/37afeabdc8f898a93aa10878e7675cfb8beca754/subscriptions.js/buggy/mail/extensions/newsblog/content/subscriptions.js