refactor: AboutDialog, show the version tweak only if its not 0, when showing the tweak also show the sha
This commit is contained in:
parent
7656b49f1b
commit
c5cfdc2b69
1 changed files with 5 additions and 1 deletions
|
|
@ -41,9 +41,13 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent)
|
||||||
btnCopyVersion->setFlat(true);
|
btnCopyVersion->setFlat(true);
|
||||||
connect(btnCopyVersion, &QPushButton::clicked, this, [] { QGuiApplication::clipboard()->setText(kVersion); });
|
connect(btnCopyVersion, &QPushButton::clicked, this, [] { QGuiApplication::clipboard()->setText(kVersion); });
|
||||||
|
|
||||||
|
// Set up the displayed version number
|
||||||
auto versionString = QString(kVersion);
|
auto versionString = QString(kVersion);
|
||||||
if (!QString(kVersionGitSha).isEmpty())
|
if (versionString.endsWith(QStringLiteral(".0"))) {
|
||||||
|
versionString.chop(2);
|
||||||
|
} else {
|
||||||
versionString.append(QStringLiteral(" (%1)").arg(kVersionGitSha));
|
versionString.append(QStringLiteral(" (%1)").arg(kVersionGitSha));
|
||||||
|
}
|
||||||
|
|
||||||
auto versionLayout = new QHBoxLayout();
|
auto versionLayout = new QHBoxLayout();
|
||||||
versionLayout->addWidget(new QLabel(tr("Version:")));
|
versionLayout->addWidget(new QLabel(tr("Version:")));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue