(weak: Weak<MainWindow>)
| 29 | } |
| 30 | |
| 31 | pub(crate) fn from_weak(weak: Weak<MainWindow>) -> Self { |
| 32 | if let Some(window) = weak.upgrade() { |
| 33 | let model = window.get_character_volumes(); |
| 34 | let volumes = (0..model.row_count()) |
| 35 | .filter_map(|i| model.row_data(i)) |
| 36 | .map(|item| (item.name.to_string(), item.volume)) |
| 37 | .collect(); |
| 38 | CharacterVolumeConfig { volumes } |
| 39 | } else { |
| 40 | unreachable!() |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | impl Executor { |
nothing calls this directly
no outgoing calls
no test coverage detected