Show version number in Cppcheck GUI's title bar (#2615)

Also don't mark the string "Cppcheck" as translatable, as it is
questionable whether the product's name is supposed to be translated ever.
This commit is contained in:
Lauri Nurmi 2020-04-22 10:26:21 +03:00 committed by GitHub
parent d88557bc18
commit e8c5c2b154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -1363,11 +1363,18 @@ void MainWindow::toggleFilterToolBar()
void MainWindow::formatAndSetTitle(const QString &text) void MainWindow::formatAndSetTitle(const QString &text)
{ {
QString nameWithVersion = QString("Cppcheck %1").arg(CppCheck::version());
QString extraVersion = CppCheck::extraVersion();
if (!extraVersion.isEmpty()) {
nameWithVersion += " (" + extraVersion + ")";
}
QString title; QString title;
if (text.isEmpty()) if (text.isEmpty())
title = tr("Cppcheck"); title = nameWithVersion;
else else
title = QString(tr("Cppcheck - %1")).arg(text); title = QString("%1 - %2").arg(nameWithVersion, text);
setWindowTitle(title); setWindowTitle(title);
} }