[SailfishDevel] defining version number only once

Artem Marchenko artem.marchenko at gmail.com
Sat Jan 24 13:08:52 UTC 2015


Wikipedia project uses similar idea passing version string from yaml to pro
to cpp to qml. And project is small (mostly educational), so it's easy to
see. You can check it out at https://github.com/amarchen/Wikipedia

Cheers,
Artem.


On Wed, Jan 7, 2015 at 10:21 AM, Luca Donaggio <donaggio at gmail.com> wrote:

> 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
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscribe at lists.sailfishos.org
>



-- 
Artem Marchenko
http://agilesoftwaredevelopment.com
http://twitter.com/AgileArtem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150124/b434cc6c/attachment.html>


More information about the Devel mailing list