chore: make use of CMake project version

This commit is contained in:
2024-09-17 19:28:05 +08:00
parent 3a4ea573f6
commit 4dd3f22d88
3 changed files with 8 additions and 2 deletions

View File

@ -50,9 +50,13 @@ AboutDialog::AboutDialog(QWidget *parent)
const QStringList aboutStr {
QStringLiteral("<center><img width='128' height='128' src=':/icons/app-icon.svg'/><br/>"),
qApp->applicationDisplayName(),
(QStringLiteral("<br/>") + tr("Version: %1").arg(
#ifdef GIT_DESCRIBE_VERSION_STRING
(QStringLiteral("<br/>") + tr("Version: %1").arg(GIT_DESCRIBE_VERSION_STRING)),
GIT_DESCRIBE_VERSION_STRING
#else
qApp->applicationVersion()
#endif // GIT_DESCRIBE_VERSION_STRING
)),
QStringLiteral("<hr/>"),
tr("Copyright (c) %1 %2", "%1 is year, %2 is the name of copyright holder(s)")
.arg(QStringLiteral("2024"), QStringLiteral("<a href='https://github.com/BLumia'>@BLumia</a>")),

View File

@ -39,6 +39,7 @@ int main(int argc, char *argv[])
}
a.setApplicationName("Pineapple Pictures");
a.setApplicationDisplayName(QCoreApplication::translate("main", "Pineapple Pictures"));
a.setApplicationVersion(PPIC_VERSION_STRING);
// commandline options
QCommandLineOption supportedImageFormats(QStringLiteral("supported-image-formats"), QCoreApplication::translate("main", "List supported image format suffixes, and quit program."));