Skip to content

Commit

Permalink
Show commit hash on dev branch instead of version
Browse files Browse the repository at this point in the history
  • Loading branch information
gsurkov committed Sep 22, 2021
1 parent dc46b8e commit 8c388bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions backend/flipperzero/deviceinfofetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ void VCPDeviceInfoFetcher::parseLine(const QByteArray &line)
m_deviceInfo.target = QStringLiteral("f") + value;
} else if(line.startsWith(QByteArrayLiteral("firmware_version"))) {
m_deviceInfo.firmware.version = value;
} else if(line.startsWith(QByteArrayLiteral("firmware_commit"))) {
m_deviceInfo.firmware.commit = value;
} else if(line.startsWith(QByteArrayLiteral("firmware_branch"))) {
m_deviceInfo.firmware.branch = value;
} else if(line.startsWith(QByteArrayLiteral("firmware_build_date"))) {
m_deviceInfo.firmware.date = QDateTime::fromString(value, QStringLiteral("dd-MM-yyyy"));
} else {}
}

Expand Down
6 changes: 5 additions & 1 deletion backend/flipperzero/flipperzero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ const QString &FlipperZero::target() const

const QString &FlipperZero::version() const
{
return m_deviceInfo.firmware.version;
if(m_deviceInfo.firmware.branch == QStringLiteral("dev")) {
return m_deviceInfo.firmware.commit;
} else {
return m_deviceInfo.firmware.version;
}
}

const QString &FlipperZero::messageString() const
Expand Down

0 comments on commit 8c388bc

Please sign in to comment.