mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 462197 - Part 2: The "Remove All Reports" button in about:crashes should remove old InstallTime files. r=ted
This commit is contained in:
parent
4cbf1615c8
commit
673b92d3ee
@ -9,6 +9,9 @@ var reportsDir, submittedDir, pendingDir;
|
||||
var reportURL;
|
||||
|
||||
Components.utils.import("resource://gre/modules/CrashSubmit.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const buildID = Services.appinfo.appBuildID;
|
||||
|
||||
function submitSuccess(dumpid, ret) {
|
||||
let link = document.getElementById(dumpid);
|
||||
@ -212,6 +215,17 @@ function clearReports() {
|
||||
file.remove(false);
|
||||
}
|
||||
}
|
||||
entries = reportsDir.directoryEntries;
|
||||
var oneYearAgo = Date.now() - 31586000000;
|
||||
while (entries.hasMoreElements()) {
|
||||
var file = entries.getNext().QueryInterface(Ci.nsIFile);
|
||||
var leaf = file.leafName;
|
||||
if (leaf.substr(0, 11) == "InstallTime" &&
|
||||
file.lastModifiedTime < oneYearAgo &&
|
||||
leaf != "InstallTime" + buildID) {
|
||||
file.remove(false);
|
||||
}
|
||||
}
|
||||
document.getElementById("clear-reports").style.display = "none";
|
||||
document.getElementById("reportList").style.display = "none";
|
||||
document.getElementById("noReports").style.display = "block";
|
||||
|
Loading…
Reference in New Issue
Block a user