Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to show debian package version to user?
i need to show current .deb version number on "about" screen.
for example, I have "myproject_0.0.5_armel.deb" installation file, how can i get "0.0.5" into my variable and then show it to user?
I know, this information stored in "changelog" file, but how to get that value?
[[moved to mobile and embedded, Tobias]]
This is usually not how you do it... There is a program revision (which should be hard coded at build time), and a package version. The package version should only be incremented if the packaging has changed (i.e. details), the program should not need to know about it.
If done properly in the process, the customer should not need to know the packaging revision of the package, and/or the package you ship only contains the version number of the software. In your case, the package doesn't even have a packaging, but only a program version.
If you really need to know the full version string for diagnostic purposes, I would extract this extra information from the output of "dpkg -l myproject" (make sure dpkg is there in the first place).
well, customers usually "require" that "your app should show package number", they don't think how it is usually should be done.
they need to see "Program Name, version 1.2.3" in about screen. hardcoding is not an option, unfortunatelly
But "Program Name, version 1.2.3" is the program version, not the package version. It's merely part of the package name.
it IS :)
go to "Projects" tab, opent Harmattan -> Run, expand "Create package". what we see?
Package name: XXX
Package version: 1.2.3
You could have mentioned that you were trying to build a Harmattan package. So this is in the wrong forum to begin with (thanks to Tobias for moving it) :-)
Harmattan packaging is a bit different in that regard, but my argument holds there: Package Version == Program Version. Qt just has no default semantics for indicating version numbers in applications, so Qt Creator has an extra control to set it. I don't know if there is a way to synchronize the application and the package number without confusing Creator.