summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2014-07-20 21:48:03 +0200
committerTomasz Sterna <tomek@xiaoka.com>2014-07-20 21:48:03 +0200
commite8ad1c9c993a98cdeea92dfcec29052654ec807d (patch)
tree2fa459215dac4aa9e58f97865d17ffbe05f48630
parentcfd11bb46b0e93903135c127b955e657d7f2b33d (diff)
Added VERSION to app and daemon
-rw-r--r--app/app.pro2
-rw-r--r--app/pebble.cpp9
-rw-r--r--daemon/daemon.cpp4
-rw-r--r--daemon/daemon.pro2
-rw-r--r--rpm/pebble.spec3
-rw-r--r--rpm/pebble.yaml2
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<PebbledInterface>("org.pebbled", 0, 1, "PebbledInterface");
- return SailfishApp::main(argc, argv);
+ QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
+
+ QScopedPointer<QQuickView> 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