(path, state)
| 519 | } |
| 520 | } |
| 521 | selectFile(path, state) { |
| 522 | path = this.mapPath(path, true); |
| 523 | if (this.path != path) { |
| 524 | let items = this.history.items; |
| 525 | let index = items.findIndex(item => item.path == path); |
| 526 | if (index >= 0) |
| 527 | items.splice(index, 1); |
| 528 | application.distribute("onStateChanging", this.state); |
| 529 | if (this.path && (this.path != "preferences") && (this.path != "device")) { |
| 530 | items.unshift({ path:this.path, state:this.state }); |
| 531 | if (items.length > 32) |
| 532 | items.length = 32; |
| 533 | } |
| 534 | application.distribute("onHistoryChanged"); |
| 535 | this.path = path; |
| 536 | this.state = state; |
| 537 | this.doOpenView(); |
| 538 | application.distribute("onPathChanged", this.path); |
| 539 | } |
| 540 | else { |
| 541 | this.state = state; |
| 542 | application.distribute("onStateChanged", state); |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | readPreferences() { |
| 547 | try { |
no test coverage detected