Small copy-paste with LoadMapsSync, but I don't have a better solution.
| 536 | |
| 537 | // Small copy-paste with LoadMapsSync, but I don't have a better solution. |
| 538 | void Framework::LoadMapsAsync(std::function<void()> && callback) |
| 539 | { |
| 540 | osm::Editor & editor = osm::Editor::Instance(); |
| 541 | threads::SimpleThread([this, &editor, callback = std::move(callback)]() |
| 542 | { |
| 543 | RegisterAllMaps(); |
| 544 | LOG(LDEBUG, ("Maps initialized")); |
| 545 | |
| 546 | GetSearchAPI().InitAfterWorldLoaded(); |
| 547 | LOG(LDEBUG, ("Search API initialized, part 2, after World was loaded")); |
| 548 | |
| 549 | GetPlatform().RunTask(Platform::Thread::Gui, [this, &editor, callback = std::move(callback)]() |
| 550 | { |
| 551 | editor.LoadEdits(); |
| 552 | m_featuresFetcher.GetDataSource().AddObserver(editor); |
| 553 | LOG(LDEBUG, ("Editor initialized")); |
| 554 | |
| 555 | GetStorage().RestoreDownloadQueue(); |
| 556 | |
| 557 | callback(); |
| 558 | }); |
| 559 | }).detach(); |
| 560 | } |
| 561 | |
| 562 | void Framework::RegisterAllMaps() |
| 563 | { |
no test coverage detected