From 85c75b18f078363a6b529001854c87ad19dd6351 Mon Sep 17 00:00:00 2001 From: Damien Caliste Date: Tue, 12 Dec 2023 16:29:04 +0100 Subject: [PATCH] Use the version number for the RPM spec file Don't hardcode the version in QML, but use instead the one given in the RPM spec file. --- FlowPlayer.pro | 1 + qml/pages/AboutPage.qml | 2 +- src/FlowPlayer.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/FlowPlayer.pro b/FlowPlayer.pro index c1a7829..8f20ce8 100644 --- a/FlowPlayer.pro +++ b/FlowPlayer.pro @@ -2,6 +2,7 @@ TARGET = flowplayer QT += core network sql xml +DEFINES += VERSION=\\\"$${VERSION}\\\" CONFIG += link_pkgconfig PKGCONFIG += gstreamer-1.0 libresource libresource-glib taglib diff --git a/qml/pages/AboutPage.qml b/qml/pages/AboutPage.qml index b805a54..17f0b24 100644 --- a/qml/pages/AboutPage.qml +++ b/qml/pages/AboutPage.qml @@ -49,7 +49,7 @@ Page { Label { color: Theme.secondaryHighlightColor - text: "version 0.3.1" + text: "version " + appVersion font.pixelSize: Theme.fontSizeSmall } } diff --git a/src/FlowPlayer.cpp b/src/FlowPlayer.cpp index 8519af1..55a5e0f 100644 --- a/src/FlowPlayer.cpp +++ b/src/FlowPlayer.cpp @@ -59,6 +59,7 @@ int main(int argc, char *argv[]) window->setTitle("FlowPlayer"); window->engine()->addImportPath("/usr/share/flowplayer/qml"); + window->rootContext()->setContextProperty("appVersion", VERSION); qmlRegisterType("FlowPlayer", 1, 0, "Utils"); qmlRegisterType("FlowPlayer", 1, 0, "CoverSearch");