From 38117ef066135aeedf630bab357fbc161bada6e0 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 23 Mar 2024 00:18:56 -0500 Subject: [PATCH] DolphinQt: Update AboutDialog to include number of commits ahead of master. --- Source/Core/DolphinQt/AboutDialog.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/AboutDialog.cpp b/Source/Core/DolphinQt/AboutDialog.cpp index 8bb8957f61..c051b803fc 100644 --- a/Source/Core/DolphinQt/AboutDialog.cpp +++ b/Source/Core/DolphinQt/AboutDialog.cpp @@ -17,6 +17,16 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent) setWindowTitle(tr("About Dolphin")); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + QString branch_str = QString::fromStdString(Common::GetScmBranchStr()); + const int commits_ahead = Common::GetScmCommitsAheadMaster(); + if (commits_ahead > 0) + { + branch_str = tr("%1 (%2)").arg( + branch_str, + // i18n: A positive number of version control commits made compared to some named branch + tr("%1 commit(s) ahead of %2").arg(commits_ahead).arg(QStringLiteral("master"))); + } + const QString text = QStringLiteral(R"(

Dolphin

@@ -50,7 +60,7 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent) QString::fromUtf8(Common::GetScmDescStr().c_str())) .replace(QStringLiteral("%BRANCH%"), // i18n: "Branch" means the version control term, not a literal tree branch. - tr("Branch: %1").arg(QString::fromUtf8(Common::GetScmBranchStr().c_str()))) + tr("Branch: %1").arg(branch_str)) .replace(QStringLiteral("%REVISION%"), tr("Revision: %1").arg(QString::fromUtf8(Common::GetScmRevGitStr().c_str()))) .replace(QStringLiteral("%QT_VERSION%"),