| 3593 | } |
| 3594 | |
| 3595 | void GuiManager::launchDevResourceScan() { |
| 3596 | if (dev_resource_watch_.scan_future.valid()) |
| 3597 | return; |
| 3598 | |
| 3599 | auto rml_dir = dev_resource_watch_.rml_dir; |
| 3600 | auto locale_dir = dev_resource_watch_.locale_dir; |
| 3601 | auto previous_times = dev_resource_watch_.file_times; |
| 3602 | try { |
| 3603 | dev_resource_watch_.scan_future = |
| 3604 | std::async(std::launch::async, |
| 3605 | [rml_dir = std::move(rml_dir), |
| 3606 | locale_dir = std::move(locale_dir), |
| 3607 | previous_times = std::move(previous_times)]() mutable { |
| 3608 | return GuiManager::scanDevResourceFilesSnapshot( |
| 3609 | std::move(rml_dir), |
| 3610 | std::move(locale_dir), |
| 3611 | std::move(previous_times), |
| 3612 | true); |
| 3613 | }); |
| 3614 | } catch (const std::exception& e) { |
| 3615 | LOG_WARN("Resource hot reload async scan could not start: {}", e.what()); |
| 3616 | } |
| 3617 | } |
| 3618 | |
| 3619 | bool GuiManager::consumeDevResourceScanResult() { |
| 3620 | if (!dev_resource_watch_.scan_future.valid()) |