Commit 937bd1d1 authored by Volker Krause's avatar Volker Krause

Signal live data change on any content change

parent 90493c6e
......@@ -68,8 +68,8 @@ void TimelineDelegateController::setReservationManager(QObject *resMgr)
emit departureChanged();
emit arrivalChanged();
connect(m_resMgr, &ReservationManager::batchChanged, this, &TimelineDelegateController::checkForUpdate);
connect(m_resMgr, &ReservationManager::batchContentChanged, this, &TimelineDelegateController::checkForUpdate);
connect(m_resMgr, &ReservationManager::batchChanged, this, &TimelineDelegateController::batchChanged);
connect(m_resMgr, &ReservationManager::batchContentChanged, this, &TimelineDelegateController::batchChanged);
checkForUpdate(m_batchId);
}
......@@ -264,3 +264,14 @@ void TimelineDelegateController::scheduleNextUpdate(std::chrono::milliseconds ms
}
s_currentTimer->start(ms);
}
void TimelineDelegateController::batchChanged(const QString& batchId)
{
if (batchId != m_batchId || m_batchId.isEmpty()) {
return;
}
checkForUpdate(batchId);
emit contentChanged();
emit arrivalChanged();
emit departureChanged();
}
......@@ -80,6 +80,8 @@ private:
QDateTime liveStartDateTime(const QVariant &res) const;
QDateTime liveEndDateTime(const QVariant &res) const;
void batchChanged(const QString &batchId);
ReservationManager *m_resMgr = nullptr; // ### should this be static?
LiveDataManager *m_liveDataMgr = nullptr;
QString m_batchId;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment