refactor: AboutDialog, show the version tweak only if its not 0, when showing the tweak also show the sha

This commit is contained in:
sithlord48
2024-11-26 23:54:14 -05:00
committed by Chris Rizzitello
parent 7656b49f1b
commit c5cfdc2b69

View File

@ -41,9 +41,13 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent)
btnCopyVersion->setFlat(true);
connect(btnCopyVersion, &QPushButton::clicked, this, [] { QGuiApplication::clipboard()->setText(kVersion); });
// Set up the displayed version number
auto versionString = QString(kVersion);
if (!QString(kVersionGitSha).isEmpty())
if (versionString.endsWith(QStringLiteral(".0"))) {
versionString.chop(2);
} else {
versionString.append(QStringLiteral(" (%1)").arg(kVersionGitSha));
}
auto versionLayout = new QHBoxLayout();
versionLayout->addWidget(new QLabel(tr("Version:")));