mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #457 Use cases for CWorker non-void tasks and thenWithResult().
This commit is contained in:
@@ -48,11 +48,11 @@ namespace BlackMisc
|
||||
{
|
||||
bool ok;
|
||||
auto aircraftCfgEntriesList = parseImpl(rootDirectory, excludedDirectories, &ok);
|
||||
if (!ok) { return; }
|
||||
bool c = QMetaObject::invokeMethod(this, "updateCfgEntriesList",
|
||||
Q_ARG(BlackMisc::Simulation::FsCommon::CAircraftCfgEntriesList, aircraftCfgEntriesList));
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Cannot invoke updateCfgEntriesList");
|
||||
Q_UNUSED(c);
|
||||
return std::make_pair(aircraftCfgEntriesList, ok);
|
||||
});
|
||||
m_parserWorker->thenWithResult<std::pair<CAircraftCfgEntriesList, bool>>(this, [this](const std::pair<CAircraftCfgEntriesList, bool> &pair)
|
||||
{
|
||||
if (pair.second) { this->updateCfgEntriesList(pair.first); }
|
||||
});
|
||||
}
|
||||
else if (mode == ModeBlocking)
|
||||
|
||||
Reference in New Issue
Block a user