mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Ref T292, Ref T285 function to set file timestamp
This commit is contained in:
@@ -74,14 +74,7 @@ namespace BlackMisc
|
||||
|
||||
void ITimestampBased::setUtcTimestamp(const QDateTime ×tamp)
|
||||
{
|
||||
if (timestamp.isValid())
|
||||
{
|
||||
m_timestampMSecsSinceEpoch = timestamp.toMSecsSinceEpoch();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_timestampMSecsSinceEpoch = -1; // invalid
|
||||
}
|
||||
m_timestampMSecsSinceEpoch = timestamp.isValid() ? timestamp.toMSecsSinceEpoch() : -1;
|
||||
}
|
||||
|
||||
bool ITimestampBased::isNewerThan(const ITimestampBased &otherTimestampObj) const
|
||||
@@ -266,6 +259,14 @@ namespace BlackMisc
|
||||
return Compare::compare(m_timestampMSecsSinceEpoch, compareValue.m_timestampMSecsSinceEpoch);
|
||||
}
|
||||
|
||||
void ITimestampBased::updateMissingParts(const ITimestampBased &other)
|
||||
{
|
||||
if (m_timestampMSecsSinceEpoch < 0)
|
||||
{
|
||||
m_timestampMSecsSinceEpoch = other.m_timestampMSecsSinceEpoch;
|
||||
}
|
||||
}
|
||||
|
||||
QString ITimestampWithOffsetBased::getTimestampAndOffset(bool formatted) const
|
||||
{
|
||||
static const QString ts("%1 (%2)");
|
||||
|
||||
Reference in New Issue
Block a user