added APP_VERSION
This commit is contained in:
parent
cbdfd88a29
commit
8de0ed5f58
3 changed files with 10 additions and 1 deletions
6
main.cpp
6
main.cpp
|
|
@ -1,12 +1,15 @@
|
|||
#include <QTranslator>
|
||||
#include <QLocale>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtDeclarative/QDeclarativeContext>
|
||||
#include "qmlapplicationviewer.h"
|
||||
|
||||
Q_DECL_EXPORT int main(int argc, char *argv[])
|
||||
{
|
||||
QScopedPointer<QApplication> app(createApplication(argc, argv));
|
||||
|
||||
app->setApplicationVersion(APP_VERSION);
|
||||
|
||||
QString locale = QLocale::system().name();
|
||||
QTranslator translator;
|
||||
/* the ":/" is a special directory Qt uses to
|
||||
|
|
@ -21,6 +24,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
|
|||
app->installTranslator(&translator);
|
||||
|
||||
QmlApplicationViewer viewer;
|
||||
|
||||
viewer.rootContext()->setContextProperty("APP_VERSION", APP_VERSION);
|
||||
|
||||
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
|
||||
viewer.setMainQmlFile(QLatin1String("qml/ttrss/main.qml"));
|
||||
viewer.showExpanded();
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ Page {
|
|||
|
||||
Label {
|
||||
width: parent.width
|
||||
text: qsTr("Version: %1").arg("0.1.3") + "<br/>"
|
||||
text: qsTr("Version: %1").arg(APP_VERSION) + "<br/>"
|
||||
+qsTr("Author: %1").arg("Hauke Schade 2012") + "<br/>"
|
||||
+qsTr("Thanks to:") + " "
|
||||
+ "Francois Cattin"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
VERSION = 0.1.4
|
||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
||||
|
||||
# Add more folders to ship with the application, here
|
||||
folder_01.source = qml/ttrss
|
||||
folder_01.target = qml
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue