mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
refs #816, set timestamp in text message
This commit is contained in:
@@ -104,6 +104,25 @@ namespace BlackMisc
|
||||
return this->container().contains(&OBJ::hasValidTimestamp, false);
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
void ITimestampObjectList<OBJ, CONTAINER>::setCurrentUtcTime()
|
||||
{
|
||||
for (ITimestampBased &tsObj : this->container())
|
||||
{
|
||||
tsObj.setCurrentUtcTime();
|
||||
}
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
void ITimestampObjectList<OBJ, CONTAINER>::setInvalidTimestampsToCurrentUtcTime()
|
||||
{
|
||||
for (ITimestampBased &tsObj : this->container())
|
||||
{
|
||||
if (tsObj.hasValidTimestamp()) { continue; }
|
||||
tsObj.setCurrentUtcTime();
|
||||
}
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
QDateTime ITimestampObjectList<OBJ, CONTAINER>::latestTimestamp() const
|
||||
{
|
||||
|
||||
@@ -50,6 +50,12 @@ namespace BlackMisc
|
||||
//! Has invalid timestamp
|
||||
bool hasInvalidTimestamps() const;
|
||||
|
||||
//! Set all timestamps to now
|
||||
void setCurrentUtcTime();
|
||||
|
||||
//! Set invalid timestamps to now
|
||||
void setInvalidTimestampsToCurrentUtcTime();
|
||||
|
||||
//! Latest timestamp
|
||||
QDateTime latestTimestamp() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user