[traff_assessment_tool] Refactor TrafficModel constructor

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-10-20 23:55:29 +03:00
parent 1b74062447
commit 800cc0641b
3 changed files with 6 additions and 14 deletions

View File

@@ -298,16 +298,14 @@ QVariant GetDescription(TraffMessage const & message)
}
// TrafficModel -------------------------------------------------------------------------------------
TrafficModel::TrafficModel(Framework & framework, DataSource const & dataSource,
std::unique_ptr<TrafficDrawerDelegateBase> drawerDelegate, // TODO do we need that?
std::unique_ptr<PointsControllerDelegateBase> pointsDelegate, // TODO do we need that?
TrafficModel::TrafficModel(Framework & framework,
MainWindow & mainWindow,
QObject * parent)
: QAbstractTableModel(parent)
, m_framework(framework)
, m_dataSource(dataSource)
, m_drawerDelegate(std::move(drawerDelegate))
, m_pointsDelegate(std::move(pointsDelegate))
, m_dataSource(framework.GetDataSource())
, m_drawerDelegate(std::make_unique<TrafficDrawerDelegate>(framework))
, m_pointsDelegate(std::make_unique<PointsControllerDelegate>(framework))
, m_mainWindow(mainWindow)
{
framework.GetTrafficManager().SetTrafficUpdateCallbackFn([this, &framework](bool final) {