rem: var stmt = db.createStatement("SELECT id, target, iconURL, name, source," + "state " + 
add: var stmt = db.createStatement("SELECT id, target, name, source, state " + 
context: function Startup() {  gDownloadsView = document.getElementById("downloadView");  var db = gDownloadManager.DBConnection;  var stmt = db.createStatement("SELECT id, target, iconURL, name, source," +                                "state " +                                "FROM moz_downloads " +                                "ORDER BY startTime DESC");  while (stmt.executeStep()) {    var i = stmt.getString(2) == "" ?      "moz-icon://" + stmt.getString(1) + "?size=32" : stmt.getString(2);    var dl = createDownloadItem(stmt.getInt64(0), stmt.getString(1), i,                                stmt.getString(3), stmt.getString(4),                                stmt.getInt32(5), "", "", "100");    gDownloadsView.appendChild(dl);  }  // The DownloadProgressListener (DownloadProgressListener.js) handles progress  // notifications.   var downloadStrings = document.getElementById("downloadStrings");  gDownloadListener = new DownloadProgressListener(document, downloadStrings);  gDownloadManager.addListener(gDownloadListener);  // The active downloads list is created by the front end only when the download starts,    // so we need to pre-populate it with any downloads that were already going.   var activeDownloads = gDownloadManager.activeDownloads;  while (activeDownloads.hasMoreElements()) {    var download = activeDownloads.getNext().QueryInterface(Ci.nsIDownload);    gActiveDownloads.push(download);  }  // Handlers for events generated by the UI (downloads, list view)  gDownloadsView.addEventListener("download-cancel",      onDownloadCancel,     false);  gDownloadsView.addEventListener("download-pause",       onDownloadPause,      false);  gDownloadsView.addEventListener("download-resume",      onDownloadResume,     false);  gDownloadsView.addEventListener("download-remove",      onDownloadRemove,     false);  gDownloadsView.addEventListener("download-show",        onDownloadShow,       false);  gDownloadsView.addEventListener("download-open",        onDownloadOpen,       false);  gDownloadsView.addEventListener("download-retry",       onDownloadRetry,      false);  gDownloadsView.addEventListener("download-animated",    onDownloadAnimated,   false);  gDownloadsView.addEventListener("download-properties",  onDownloadProperties, false);  gDownloadsView.addEventListener("dblclick",             onDownloadOpen,       false);    // Set up AutoDownload display area  initAutoDownloadDisplay();  var pbi = Components.classes["@mozilla.org/preferences-service;1"]                      .getService(Components.interfaces.nsIPrefBranch2);  pbi.addObserver("browser.download.", gDownloadPrefObserver, false);    // Handlers for events generated by the Download Manager (download events)  var observerService = Components.classes[kObserverServiceProgID]                                  .getService(Components.interfaces.nsIObserverService);  observerService.addObserver(gDownloadObserver, "dl-done",   false);  observerService.addObserver(gDownloadObserver, "dl-cancel", false);  observerService.addObserver(gDownloadObserver, "dl-failed", false);    observerService.addObserver(gDownloadObserver, "dl-start",  false);      // This is for the "Clean Up" button, which requires there to be  // non-active downloads before it can be enabled.   gDownloadsView.controllers.appendController(gDownloadViewController);  // downloads can finish before Startup() does, so check if the window should close  if (!autoRemoveAndClose())    gDownloadsView.focus();}
meta: 10520	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10520/b34505d95e26a8a6c4b79a6839ea91709ca743b4/downloads.js/buggy/toolkit/mozapps/downloads/content/downloads.js