mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refs #935, adjusted 4th segment of version to timestamp since 2010
slack discussion/meeting 20170413
This commit is contained in:
committed by
Mathew Sutcliffe
parent
6802246276
commit
f69c1e7c3f
@@ -409,12 +409,18 @@ namespace BlackConfig
|
||||
{
|
||||
if (buildTimestamp.isValid())
|
||||
{
|
||||
static const qint64 dt2017 = QDateTime::fromString("20170101000000", "yyyyMMddHHmmss").toMSecsSinceEpoch();
|
||||
const qint64 msSinceEpoch = buildTimestamp.toMSecsSinceEpoch();
|
||||
const qint64 msSinceSwiftEpoch = msSinceEpoch - dt2017;
|
||||
return msSinceSwiftEpoch / 1000; // accuraccy second should be enough, and is shorter
|
||||
const QString bts = buildTimestamp.toString("yyyyMMddHHmm");
|
||||
bool ok;
|
||||
const long long btsll = bts.toLongLong(&ok); // at least 64bit
|
||||
if (!ok) { return 0; }
|
||||
// now we have to converto int
|
||||
// max 2147483647 (2^31 - 1)
|
||||
// 1MMddHHmm (years since 2010)
|
||||
const long long yearOffset = 201000000000;
|
||||
const int btsInt = btsll - yearOffset;
|
||||
return btsInt;
|
||||
}
|
||||
return 0; // intentionally 0 and not zero => 0.7.3.0 <-
|
||||
return 0; // intentionally 0 => 0.7.3.0 <-
|
||||
}
|
||||
} // ns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user