(position, removed, added)
| 570 | } |
| 571 | |
| 572 | _updateCollisions(position, removed, added) { |
| 573 | let map = new Map(); |
| 574 | for (const binding of this._model) { |
| 575 | for (const combo of binding.combos) { |
| 576 | if (combo.disabled) |
| 577 | continue; |
| 578 | map.set(combo.keystr, (map.get(combo.keystr) || new Set()).add(binding.action)); |
| 579 | } |
| 580 | } |
| 581 | let changed = new Set(); |
| 582 | for (const [keystr, actions] of map.entries()) { |
| 583 | if (actions.size > 1) { |
| 584 | if (!this.collisions.has(keystr)) { |
| 585 | for (const action of actions) { |
| 586 | changed.add(action); |
| 587 | } |
| 588 | } else { |
| 589 | let old = this.collisions.get(keystr); |
| 590 | for (const action of symmetricDifference(old, actions)) { |
| 591 | changed.add(action); |
| 592 | } |
| 593 | } |
| 594 | this.collisions.set(keystr, actions); |
| 595 | } else { |
| 596 | for (const action of actions) { |
| 597 | changed.add(action); |
| 598 | } |
| 599 | this.collisions.delete(keystr); |
| 600 | } |
| 601 | } |
| 602 | if (changed.size > 0) { |
| 603 | for (const action of changed) { |
| 604 | this.emit(`collisions-changed::${action}`); |
| 605 | } |
| 606 | } |
| 607 | } |
| 608 | }); |
| 609 | |
| 610 | const ComboRow = GObject.registerClass({ |
no test coverage detected