Commit 70f493b9 authored by Volker Krause's avatar Volker Krause

Load cached live data before checking for reservation relevancy

This matters if you restart the application while you are on a delayed
train for example, after the scheduled arrival time. As we loaded the
cached delay data afterwards, the corresponding trip was wrongly assumed
to already have arrived (as we could only compare to the base schedule),
and therefore got discarded for further live querying.
parent 56c7e76e
......@@ -57,6 +57,8 @@ LiveDataManager::LiveDataManager(QObject *parent)
connect(&m_pollTimer, &QTimer::timeout, this, &LiveDataManager::poll);
LiveDataManager::~LiveDataManager() = default;
......@@ -78,7 +80,6 @@ void LiveDataManager::setReservationManager(ReservationManager *resMgr)
......@@ -344,9 +345,7 @@ void LiveDataManager::loadPublicTransportData(const QString &prefix, QHash<QStri
while (it.hasNext()) {;
const auto resId = it.fileInfo().baseName();
if (std::find(m_reservations.begin(), m_reservations.end(), resId) == m_reservations.end()) {
} else {
QFile f(it.filePath());
if (! {
qCWarning(Log) << "Failed to load public transport file" << f.fileName() << f.errorString();
......@@ -354,7 +353,6 @@ void LiveDataManager::loadPublicTransportData(const QString &prefix, QHash<QStri
data.insert(resId, {KPublicTransport::Departure::fromJson(QJsonDocument::fromJson(f.readAll()).object()), f.fileTime(QFile::FileModificationTime)});
void LiveDataManager::loadPublicTransportData()
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