refs #935, adjusted 4th segment of version to timestamp since 2010

slack discussion/meeting 20170413
This commit is contained in:
Klaus Basan
2017-04-14 02:18:26 +02:00
committed by Mathew Sutcliffe
parent 6802246276
commit f69c1e7c3f
2 changed files with 13 additions and 7 deletions

View File

@@ -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

View File

@@ -165,8 +165,8 @@ namespace BlackGui
if (!downloadUrl.isEmpty())
{
const QString urlStr(downloadUrl.toQString());
const QString hl("<a href=\"%1\"><img src=\":/own/icons/own/drophere16.png\"></a> %2 %3");
ui->lbl_NewVersionUrl->setText(hl.arg(urlStr, latestVersionStr, currentPlatform));
const QString hl("<a href=\"%1\"><img src=\":/own/icons/own/drophere16.png\"></a> %2");
ui->lbl_NewVersionUrl->setText(hl.arg(urlStr, currentPlatform));
ui->lbl_NewVersionUrl->setToolTip("Download '" + latestVersionStr + "' " + m_currentDistribution.getFilename(currentPlatform));
}
}