summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2014-06-21 22:23:07 +0200
committerTomasz Sterna <tomek@xiaoka.com>2014-06-21 22:23:07 +0200
commit1f0cde7cfd31c180eaceeab4ee0ad24613eaf34c (patch)
tree7b78f4bb6ecbe04ae165cb00a47989e7ad81e387
parent1c908650c9086f9b1714da14acdcb18f85e3d4fb (diff)
Restructured for lib and daemon
-rw-r--r--.gitignore3
-rw-r--r--app/app.pro16
-rw-r--r--app/qml/cover/CoverPage.qml (renamed from qml/cover/CoverPage.qml)0
-rw-r--r--app/qml/pages/WatchPage.qml (renamed from qml/pages/WatchPage.qml)0
-rw-r--r--app/qml/waterwatch.qml (renamed from qml/waterwatch.qml)0
-rw-r--r--app/waterwatch.cpp (renamed from src/waterwatch.cpp)4
-rw-r--r--app/waterwatch.desktop (renamed from waterwatch.desktop)0
-rw-r--r--app/waterwatch.png (renamed from waterwatch.png)bin1725 -> 1725 bytes
-rw-r--r--daemon/daemon.cpp33
-rw-r--r--daemon/daemon.pro13
-rw-r--r--lib/lib.pro11
-rw-r--r--lib/watchconnector.cpp (renamed from src/watchconnector.cpp)6
-rw-r--r--lib/watchconnector.h (renamed from src/watchconnector.h)4
-rw-r--r--rpm/waterwatch.yaml6
-rw-r--r--waterwatch.pro24
15 files changed, 86 insertions, 34 deletions
diff --git a/.gitignore b/.gitignore
index 620d3dc..fdabbee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,6 @@
*.lai
*.la
*.a
+
+/rpm/*.spec
+/*.pro.user
diff --git a/app/app.pro b/app/app.pro
new file mode 100644
index 0000000..c7e6928
--- /dev/null
+++ b/app/app.pro
@@ -0,0 +1,16 @@
+TARGET = waterwatch
+
+CONFIG += sailfishapp
+
+SOURCES += waterwatch.cpp
+
+INCLUDEPATH += ../lib
+LIBS += -L$$OUT_PWD/../lib -lpebble
+
+QT += bluetooth
+QMAKE_CXXFLAGS += -std=c++0x
+
+OTHER_FILES += qml/waterwatch.qml \
+ qml/cover/CoverPage.qml \
+ waterwatch.desktop \
+ qml/pages/WatchPage.qml
diff --git a/qml/cover/CoverPage.qml b/app/qml/cover/CoverPage.qml
index aaa33c6..aaa33c6 100644
--- a/qml/cover/CoverPage.qml
+++ b/app/qml/cover/CoverPage.qml
diff --git a/qml/pages/WatchPage.qml b/app/qml/pages/WatchPage.qml
index 623c47e..623c47e 100644
--- a/qml/pages/WatchPage.qml
+++ b/app/qml/pages/WatchPage.qml
diff --git a/qml/waterwatch.qml b/app/qml/waterwatch.qml
index cf65076..cf65076 100644
--- a/qml/waterwatch.qml
+++ b/app/qml/waterwatch.qml
diff --git a/src/waterwatch.cpp b/app/waterwatch.cpp
index 795a310..46e6298 100644
--- a/src/waterwatch.cpp
+++ b/app/waterwatch.cpp
@@ -34,10 +34,12 @@
#include <sailfishapp.h>
#include "watchconnector.h"
+using namespace watch;
+
int main(int argc, char *argv[])
{
// Registert WatchController object on QML side
- watch::registerWatchConnector();
+ qmlRegisterType<WatchConnector>("watch", 0, 1, "WatchConnector");
return SailfishApp::main(argc, argv);
}
diff --git a/waterwatch.desktop b/app/waterwatch.desktop
index 4ddba76..4ddba76 100644
--- a/waterwatch.desktop
+++ b/app/waterwatch.desktop
diff --git a/waterwatch.png b/app/waterwatch.png
index f4aaeeb..f4aaeeb 100644
--- a/waterwatch.png
+++ b/app/waterwatch.png
Binary files differ
diff --git a/daemon/daemon.cpp b/daemon/daemon.cpp
new file mode 100644
index 0000000..c50af39
--- /dev/null
+++ b/daemon/daemon.cpp
@@ -0,0 +1,33 @@
+/*
+ Copyright (C) 2014 Tomasz Sterna
+
+ You may use this file under the terms of BSD license as follows:
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the authors nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "watchconnector.h"
+
+int main(int argc, char *argv[])
+{
+}
diff --git a/daemon/daemon.pro b/daemon/daemon.pro
new file mode 100644
index 0000000..d1fb5ca
--- /dev/null
+++ b/daemon/daemon.pro
@@ -0,0 +1,13 @@
+TARGET = pebbled
+
+CONFIG += console
+CONFIG -= app_bundle
+
+INCLUDEPATH += ../lib
+LIBS += -L$$OUT_PWD/../lib -lpebble
+
+QT += bluetooth
+QMAKE_CXXFLAGS += -std=c++0x
+
+SOURCES += \
+ daemon.cpp
diff --git a/lib/lib.pro b/lib/lib.pro
new file mode 100644
index 0000000..3ef513d
--- /dev/null
+++ b/lib/lib.pro
@@ -0,0 +1,11 @@
+TEMPLATE = lib
+TARGET = pebble
+
+HEADERS += \
+ watchconnector.h
+
+SOURCES += \
+ watchconnector.cpp
+
+QT += bluetooth
+QMAKE_CXXFLAGS += -std=c++0x
diff --git a/src/watchconnector.cpp b/lib/watchconnector.cpp
index c58e867..e987cce 100644
--- a/src/watchconnector.cpp
+++ b/lib/watchconnector.cpp
@@ -1,4 +1,5 @@
#include "watchconnector.h"
+#include <QTimer>
#include <QDateTime>
using namespace watch;
@@ -293,8 +294,3 @@ void WatchConnector::endPhoneCall(unsigned int cookie)
{
phoneControl(callEND, cookie, QStringList());
}
-
-void watch::registerWatchConnector()
-{
- qmlRegisterType<WatchConnector>("watch", 0, 1, "WatchConnector");
-}
diff --git a/src/watchconnector.h b/lib/watchconnector.h
index 56a0f5c..616b9f5 100644
--- a/src/watchconnector.h
+++ b/lib/watchconnector.h
@@ -31,7 +31,6 @@
#define WATCHCONNECTOR_H
#include <QObject>
-#include <QtQml>
#include <QStringList>
#include <QBluetoothDeviceInfo>
#include <QBluetoothSocket>
@@ -125,9 +124,6 @@ private:
QString _last_name;
QString _last_address;
};
-
-void registerWatchConnector();
-
}
#endif // WATCHCONNECTOR_H
diff --git a/rpm/waterwatch.yaml b/rpm/waterwatch.yaml
index e2f0359..8d3cb49 100644
--- a/rpm/waterwatch.yaml
+++ b/rpm/waterwatch.yaml
@@ -6,7 +6,7 @@ Group: Qt/Qt
URL: http://example.org/
License: BSD
Sources:
-- '%{name}-%{version}.tar.bz2'
+- '%{name}-%{version}.tar.xz'
Description: |
Include support for Pebble watch to receive event from SailfishOS device. Communicates via Bluetooth, supporting the Pebble protocol.
Configure: none
@@ -24,8 +24,4 @@ Files:
- '%{_datadir}/%{name}/qml'
- '%{_datadir}/applications/%{name}.desktop'
- '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png'
-- /usr/bin
-- /usr/share/waterwatch
-- /usr/share/applications
-- /usr/share/icons/hicolor/86x86/apps
PkgBR: []
diff --git a/waterwatch.pro b/waterwatch.pro
index 65a9018..74f613f 100644
--- a/waterwatch.pro
+++ b/waterwatch.pro
@@ -1,20 +1,6 @@
-TARGET = waterwatch
-
-CONFIG += sailfishapp
-
-SOURCES += src/waterwatch.cpp \
- src/watchconnector.cpp
-
-QT += bluetooth
-QMAKE_CXXFLAGS += -std=c++0x
-
-OTHER_FILES += qml/waterwatch.qml \
- qml/cover/CoverPage.qml \
+TEMPLATE = subdirs
+CONFIG += ordered
+SUBDIRS = lib daemon app
+OTHER_FILES += \
rpm/waterwatch.spec \
- rpm/waterwatch.yaml \
- waterwatch.desktop \
- qml/pages/WatchPage.qml
-
-HEADERS += \
- src/watchconnector.h
-
+ rpm/waterwatch.yaml