From e8ad1c9c993a98cdeea92dfcec29052654ec807d Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Sun, 20 Jul 2014 21:48:03 +0200 Subject: Added VERSION to app and daemon --- app/app.pro | 2 ++ app/pebble.cpp | 9 ++++++++- daemon/daemon.cpp | 4 ++-- daemon/daemon.pro | 2 ++ rpm/pebble.spec | 3 ++- rpm/pebble.yaml | 2 ++ 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/app.pro b/app/app.pro index 48aff06..c0fe5d3 100644 --- a/app/app.pro +++ b/app/app.pro @@ -5,6 +5,8 @@ CONFIG += sailfishapp QT += dbus QMAKE_CXXFLAGS += -std=c++0x +DEFINES += APP_VERSION=\\\"$$VERSION\\\" + SOURCES += \ pebble.cpp \ pebbledinterface.cpp diff --git a/app/pebble.cpp b/app/pebble.cpp index b2f4d09..44f1aeb 100644 --- a/app/pebble.cpp +++ b/app/pebble.cpp @@ -39,6 +39,13 @@ int main(int argc, char *argv[]) // Register Pebble daemon interface object on QML side qmlRegisterType("org.pebbled", 0, 1, "PebbledInterface"); - return SailfishApp::main(argc, argv); + QScopedPointer app(SailfishApp::application(argc, argv)); + + QScopedPointer view(SailfishApp::createView()); + view->rootContext()->setContextProperty("APP_VERSION", APP_VERSION); + view->setSource(SailfishApp::pathTo("qml/pebble.qml")); + view->show(); + + return app->exec(); } diff --git a/daemon/daemon.cpp b/daemon/daemon.cpp index b891680..6fa634c 100644 --- a/daemon/daemon.cpp +++ b/daemon/daemon.cpp @@ -70,8 +70,6 @@ void initLogging() Log4Qt::LogManager::setHandleQtMessages(true); qDebug() << "Using following log config file: " << usedConfigFile; - - Log4Qt::Logger::logger(QLatin1String("Main Logger"))->info("Logging started"); } int main(int argc, char *argv[]) @@ -82,6 +80,8 @@ int main(int argc, char *argv[]) // QCoreApplication for determining the .conf files locations initLogging(); + Log4Qt::Logger::logger(QLatin1String("Main Logger"))->info() << argv[0] << APP_VERSION; + watch::WatchConnector watch; DBusConnector dbus; VoiceCallManager voice; diff --git a/daemon/daemon.pro b/daemon/daemon.pro index cf6d5b9..d77be1a 100644 --- a/daemon/daemon.pro +++ b/daemon/daemon.pro @@ -12,6 +12,8 @@ LIBS += -L$$OUT_PWD/../ext/Log4Qt/ -llog4qt QMAKE_RPATHDIR += /usr/share/pebble/lib INCLUDEPATH += ../ext/Log4Qt/src ../ext/Log4Qt/deploy/include +DEFINES += APP_VERSION=\\\"$$VERSION\\\" + SOURCES += \ daemon.cpp \ manager.cpp \ diff --git a/rpm/pebble.spec b/rpm/pebble.spec index 8129886..01a66e1 100644 --- a/rpm/pebble.spec +++ b/rpm/pebble.spec @@ -47,7 +47,8 @@ Include support for Pebble watch to receive event from SailfishOS device. Commun # >> build pre # << build pre -%qtc_qmake5 +%qtc_qmake5 \ + VERSION='%{version}-%{release}' %qtc_make %{?_smp_mflags} diff --git a/rpm/pebble.yaml b/rpm/pebble.yaml index f0fc73d..1bb3352 100644 --- a/rpm/pebble.yaml +++ b/rpm/pebble.yaml @@ -11,6 +11,8 @@ Description: | Include support for Pebble watch to receive event from SailfishOS device. Communicates via Bluetooth, supporting the Pebble protocol. Configure: none Builder: qtc5 +QMakeOptions: +- VERSION='%{version}-%{release}' PkgConfigBR: - Qt5DBus - Qt5Bluetooth -- cgit v1.2.3