[SailfishDevel] defining version number only once
Luca Donaggio
donaggio at gmail.com
Wed Jan 7 08:21:36 UTC 2015
This is the way I solved #1:
a) in your .yaml add the lines:
QMakeOptions:
- VERSION=%{version}
b) in your .pro add the lines:
# App version
DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"
c) in your .c's main() function add the lines:
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc,
argv));
app->setApplicationVersion(QString(APP_VERSION));
d) now your app's version is available in QML through
Qt.application.version
On Tue, Dec 23, 2014 at 5:44 PM, Alfonso Martone <alfq at bk.ru> wrote:
> Sorry to ask here, but I wasn't able to get some official guidelines.
>
> 1) Version/Release numbers:
>
> - I have to place them both in the *.yaml *file (for RPM build) and in
> some *.h* or *.qml *source (to show it in some "about" dialog): is there
> a way to define the Version/Release numbers in a *single* file of the
> project, making them available to C++, QML and RPM-build ?
>
> 2) from time to time my software has to write some output file (collected
> data) that the user may use in another app:
>
> - is it correct to save in *$HOME/Documents* ?
>
> Thanks.
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscribe at lists.sailfishos.org
>
--
Luca Donaggio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150107/2592b196/attachment.html>
More information about the Devel
mailing list