Skip to content

Commit e8c5c2b

Browse files
authored
Show version number in Cppcheck GUI's title bar (cppcheck-opensource#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.
1 parent d88557b commit e8c5c2b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

gui/mainwindow.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,11 +1363,18 @@ void MainWindow::toggleFilterToolBar()
13631363

13641364
void MainWindow::formatAndSetTitle(const QString &text)
13651365
{
1366+
QString nameWithVersion = QString("Cppcheck %1").arg(CppCheck::version());
1367+
1368+
QString extraVersion = CppCheck::extraVersion();
1369+
if (!extraVersion.isEmpty()) {
1370+
nameWithVersion += " (" + extraVersion + ")";
1371+
}
1372+
13661373
QString title;
13671374
if (text.isEmpty())
1368-
title = tr("Cppcheck");
1375+
title = nameWithVersion;
13691376
else
1370-
title = QString(tr("Cppcheck - %1")).arg(text);
1377+
title = QString("%1 - %2").arg(nameWithVersion, text);
13711378
setWindowTitle(title);
13721379
}
13731380

0 commit comments

Comments
 (0)