mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
OP-770: use VersionInfo::uavoHash() instead of dynamic string
This commit is contained in:
parent
cc14dac819
commit
208278a7cb
@ -75,31 +75,10 @@ AuthorsDialog::AuthorsDialog(QWidget *parent)
|
||||
// : This gets conditionally inserted as argument %8 into the description string.
|
||||
ideRev = tr("From revision %1<br/>").arg(VersionInfo::revision().left(10));
|
||||
|
||||
QString uavoHashStr;
|
||||
if (VersionInfo::uavoHashArray().length() > 15) {
|
||||
// : This gets conditionally inserted as argument %11 into the description string.
|
||||
QByteArray uavoHashArray;
|
||||
QString uavoHash = VersionInfo::uavoHashArray();
|
||||
uavoHash.chop(2);
|
||||
uavoHash.remove(0, 2);
|
||||
uavoHash = uavoHash.trimmed();
|
||||
bool ok;
|
||||
foreach(QString str, uavoHash.split(",")) {
|
||||
uavoHashArray.append(str.toInt(&ok, 16));
|
||||
}
|
||||
QString gcsUavoHashStr;
|
||||
foreach(char i, uavoHashArray) {
|
||||
gcsUavoHashStr.append(QString::number(i, 16).right(2));
|
||||
}
|
||||
uavoHashStr = gcsUavoHashStr;
|
||||
} else {
|
||||
uavoHashStr = "N/A";
|
||||
}
|
||||
|
||||
const QString description = tr(
|
||||
"<h3>OpenPilot Ground Control Station</h3>"
|
||||
"GCS Revision: <b>%1</b><br/>"
|
||||
"UAVO Hash: %2<br/>"
|
||||
"UAVO Hash: <b>%2</b><br/>"
|
||||
"<br/>"
|
||||
"Built from %3<br/>"
|
||||
"Built on %4 at %5<br/>"
|
||||
@ -117,7 +96,7 @@ AuthorsDialog::AuthorsDialog(QWidget *parent)
|
||||
"PARTICULAR PURPOSE.</small>"
|
||||
).arg(
|
||||
VersionInfo::revision().left(60), // %1
|
||||
uavoHashStr, // %2
|
||||
VersionInfo::uavoHash().left(8), // %2
|
||||
VersionInfo::origin(), // $3
|
||||
QLatin1String(__DATE__), // %4
|
||||
QLatin1String(__TIME__), // %5
|
||||
|
@ -59,31 +59,10 @@ VersionDialog::VersionDialog(QWidget *parent)
|
||||
QGridLayout *layout = new QGridLayout(this);
|
||||
layout->setSizeConstraint(QLayout::SetFixedSize);
|
||||
|
||||
QString uavoHashStr;
|
||||
if (VersionInfo::uavoHashArray().length() > 15) {
|
||||
// : This gets conditionally inserted as argument %11 into the description string.
|
||||
QByteArray uavoHashArray;
|
||||
QString uavoHash = VersionInfo::uavoHashArray();
|
||||
uavoHash.chop(2);
|
||||
uavoHash.remove(0, 2);
|
||||
uavoHash = uavoHash.trimmed();
|
||||
bool ok;
|
||||
foreach(QString str, uavoHash.split(",")) {
|
||||
uavoHashArray.append(str.toInt(&ok, 16));
|
||||
}
|
||||
QString gcsUavoHashStr;
|
||||
foreach(char i, uavoHashArray) {
|
||||
gcsUavoHashStr.append(QString::number(i, 16).right(2));
|
||||
}
|
||||
uavoHashStr = gcsUavoHashStr;
|
||||
} else {
|
||||
uavoHashStr = "N/A";
|
||||
}
|
||||
|
||||
const QString description = tr(
|
||||
"<h3>OpenPilot Ground Control Station</h3>"
|
||||
"GCS Revision: <b>%1</b><br/>"
|
||||
"UAVO Hash: %2<br/>"
|
||||
"UAVO Hash: <b>%2</b><br/>"
|
||||
"<br/>"
|
||||
"Built from %3<br/>"
|
||||
"Built on %4 at %5<br/>"
|
||||
@ -101,7 +80,7 @@ VersionDialog::VersionDialog(QWidget *parent)
|
||||
"PARTICULAR PURPOSE.</small>"
|
||||
).arg(
|
||||
VersionInfo::revision().left(60), // %1
|
||||
uavoHashStr, // %2
|
||||
VersionInfo::uavoHash().left(8), // %2
|
||||
VersionInfo::origin(), // $3
|
||||
QLatin1String(__DATE__), // %4
|
||||
QLatin1String(__TIME__), // %5
|
||||
|
Loading…
x
Reference in New Issue
Block a user