[SailfishDevel] Versions

Kimmo Lindholm Kimmo.Lindholm at eke.fi
Mon Jul 21 05:57:38 UTC 2014


You can make your own modified template easily. 
i did... https://github.com/kimmoli/Sailfish-qtcreator-wizard

(for some reason i did remove yaml, and use only spec)

-kimmo

________________________________________
Lähettäjä: devel-bounces at lists.sailfishos.org [devel-bounces at lists.sailfishos.org] käyttäjän Mikael Hermansson [mike at 7b4.se] puolesta
Lähetetty: 20. heinäkuuta 2014 17:19
Vastaanottaja: Sailfish OS Developers
Aihe: Re: [SailfishDevel] Versions

With all those options given I prefer below one given by Bob. I actually have
made a AppInfo class for generic stuff like read licensefile/changelog/version
in the aboupage  long ago. But I used a header file with stupid duplicate of
VERSION (I hade to manually change both yaml+app). I will for sure change this
to use below solution in all my apps from now on.

Actually I think below should be added in the sailfishsdk creation app template
:)


On Sunday, July 20, 2014 14:22:01 Chris Walker wrote:
> On Sun, 20 Jul 2014 14:58:16 +0200
>
> Bob Jelica <sailfish at jelica.se> wrote:
> > Hey,
> >
> > If you have this in your .yaml:
> >
> > Version: 1.0.0
> >
> > QMakeOptions:
> > - VERSION='%{version}-%{release}'
> >
> > Then you can do this in your .pro file:
> > DEFINES += APP_VERSION=\\\"$$VERSION\\\"
> >
> > That gives you the option to do this in your main.cpp:
> > QScopedPointer<QQuickView> view(SailfishApp::createView());
> > view->rootContext()->setContextProperty("APP_VERSION", APP_VERSION);
> >
> >
> > And BOOM! now you can use APP_VERSION wherever in your QML
> > (AboutPage.qml for example)
> >
> > :)
>
> Ah. I used to do something similar in my N900 version of the app except
> that I used to specify the version in the .pro file. I've never tried
> to incorporate it into the Sailfish version. I'll give your version
> another go now.
>
> Thanks for that and thanks too to Andrey Kozhevnikov for his ideas.
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org

--
"Put mankind back on earth"

_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org


More information about the Devel mailing list