mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refs #844, further improvements of ATC stations display
Signal when bookings are read, but not changed
This commit is contained in:
committed by
Mathew Sutcliffe
parent
3f2fc33b27
commit
85ca3b7a1a
@@ -45,7 +45,7 @@ namespace BlackCore
|
||||
CVatsimBookingReader::CVatsimBookingReader(QObject *owner) :
|
||||
CThreadedReader(owner, "CVatsimBookingReader")
|
||||
{
|
||||
reloadSettings();
|
||||
settingsChanged();
|
||||
}
|
||||
|
||||
void CVatsimBookingReader::readInBackgroundThread()
|
||||
@@ -90,7 +90,7 @@ namespace BlackCore
|
||||
this->threadAssertCheck();
|
||||
|
||||
// Worker thread, make sure to write no members here od do it threadsafe
|
||||
if (this->isAbandoned())
|
||||
if (this->isShuttingDown())
|
||||
{
|
||||
CLogMessage(this).debug() << Q_FUNC_INFO;
|
||||
CLogMessage(this).info("Terminated booking parsing process");
|
||||
@@ -107,8 +107,8 @@ namespace BlackCore
|
||||
QDateTime updateTimestamp = QDateTime::currentDateTimeUtc(); // default
|
||||
if (doc.setContent(xmlData))
|
||||
{
|
||||
QDomNode timestamp = doc.elementsByTagName("timestamp").at(0);
|
||||
QString ts = timestamp.toElement().text().trimmed();
|
||||
const QDomNode timestamp = doc.elementsByTagName("timestamp").at(0);
|
||||
const QString ts = timestamp.toElement().text().trimmed();
|
||||
Q_ASSERT(!ts.isEmpty());
|
||||
|
||||
if (!ts.isEmpty())
|
||||
@@ -124,6 +124,7 @@ namespace BlackCore
|
||||
if (!changed)
|
||||
{
|
||||
CLogMessage(this).info("Read bookings unchanged, skipped");
|
||||
emit this->atcBookingsReadUnchanged();
|
||||
return; // stop, terminate straight away, ending thread
|
||||
}
|
||||
}
|
||||
@@ -201,11 +202,10 @@ namespace BlackCore
|
||||
}
|
||||
} // method
|
||||
|
||||
void CVatsimBookingReader::reloadSettings()
|
||||
void CVatsimBookingReader::settingsChanged()
|
||||
{
|
||||
CReaderSettings s = m_settings.get();
|
||||
setInitialAndPeriodicTime(s.getInitialTime().toMs(), s.getPeriodicTime().toMs());
|
||||
}
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -41,6 +41,9 @@ namespace BlackCore
|
||||
//! Bookings have been read and converted to BlackMisc::Aviation::CAtcStationList
|
||||
void atcBookingsRead(const BlackMisc::Aviation::CAtcStationList &bookedStations);
|
||||
|
||||
//! Bookings have been re-read but did not change
|
||||
void atcBookingsReadUnchanged();
|
||||
|
||||
//! Data have been read
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
|
||||
@@ -60,9 +63,10 @@ namespace BlackCore
|
||||
void ps_read();
|
||||
|
||||
private:
|
||||
void reloadSettings();
|
||||
//! Settings changed
|
||||
void settingsChanged();
|
||||
|
||||
BlackMisc::CSettingReadOnly<BlackCore::Vatsim::TVatsimBookings> m_settings { this, &CVatsimBookingReader::reloadSettings };
|
||||
BlackMisc::CSettingReadOnly<BlackCore::Vatsim::TVatsimBookings> m_settings { this, &CVatsimBookingReader::settingsChanged };
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user