| | 294 | _cleanTmpDir: function D__cleanTmpDir() { |
|---|
| | 295 | if (!Prefs.tempLocation) { |
|---|
| | 296 | // cannot perform this action if we don't use a temp file |
|---|
| | 297 | // there might be far too many directories containing far too many tmpFiles. |
|---|
| | 298 | return; |
|---|
| | 299 | } |
|---|
| | 300 | let known = []; |
|---|
| | 301 | for (d in Tree.all) { |
|---|
| | 302 | known.push(d.tmpFile.leafName); |
|---|
| | 303 | } |
|---|
| | 304 | let tmpEnum = Prefs.tempLocation.directoryEntries; |
|---|
| | 305 | let unknown = [] |
|---|
| | 306 | while (tmpEnum.hasMoreElements()) { |
|---|
| | 307 | let f = tmpEnum.getNext().QueryInterface(Ci.nsILocalFile); |
|---|
| | 308 | if (f.leafName.match(/\.dtapart$/) && known.indexOf(f.leafName) == -1) { |
|---|
| | 309 | unknown.push(f); |
|---|
| | 310 | } |
|---|
| | 311 | } |
|---|
| | 312 | unknown.forEach( |
|---|
| | 313 | function(f) { |
|---|
| | 314 | try { |
|---|
| | 315 | f.remove(false); |
|---|
| | 316 | } |
|---|
| | 317 | catch(ex) { |
|---|
| | 318 | } |
|---|
| | 319 | } |
|---|
| | 320 | ); |
|---|
| | 321 | }, |
|---|