From 6fad6646a4e2c45c258ab11623ff20eea42dfa70 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Sun, 19 Sep 2021 22:36:49 +0300 Subject: [PATCH] Improve building Starfish on Sailfish Application SDK --- asteroidsyncservice.pro | 2 ++ asteroidsyncservice/asteroidsyncservice.pro | 2 +- asteroidsyncserviced/asteroidsyncserviced.pro | 2 +- asteroidsyncserviced/bluez/bluezclient.cpp | 1 + asteroidsyncserviced/bluez/bluezclient.h | 2 -- asteroidsyncserviced/main.cpp | 14 +++++++------- rpm/asteroidsyncservice.spec | 14 +++++++------- 7 files changed, 19 insertions(+), 18 deletions(-) diff --git a/asteroidsyncservice.pro b/asteroidsyncservice.pro index 6363a4b..8f6d9da 100644 --- a/asteroidsyncservice.pro +++ b/asteroidsyncservice.pro @@ -1,3 +1,5 @@ +include(../version.pri) + TEMPLATE = subdirs SUBDIRS = asteroidsyncservice asteroidsyncserviced OTHER_FILES += \ diff --git a/asteroidsyncservice/asteroidsyncservice.pro b/asteroidsyncservice/asteroidsyncservice.pro index b449ba9..866b5af 100644 --- a/asteroidsyncservice/asteroidsyncservice.pro +++ b/asteroidsyncservice/asteroidsyncservice.pro @@ -2,7 +2,7 @@ TEMPLATE = lib TARGET = asteroidsyncserviceplugin QT += qml quick dbus CONFIG += qt plugin -include(../version.pri) +include(../../version.pri) TARGET = $$qtLibraryTarget($$TARGET) uri = org.asteroid.syncservice diff --git a/asteroidsyncserviced/asteroidsyncserviced.pro b/asteroidsyncserviced/asteroidsyncserviced.pro index 980899c..0b997c5 100644 --- a/asteroidsyncserviced/asteroidsyncserviced.pro +++ b/asteroidsyncserviced/asteroidsyncserviced.pro @@ -1,7 +1,7 @@ QT += core bluetooth dbus QT -= gui -include(../version.pri) +include(../../version.pri) include(libasteroid/libasteroid.pri) contains(CONFIG, telescope) { diff --git a/asteroidsyncserviced/bluez/bluezclient.cpp b/asteroidsyncserviced/bluez/bluezclient.cpp index 0da6f6e..cbfd42b 100644 --- a/asteroidsyncserviced/bluez/bluezclient.cpp +++ b/asteroidsyncserviced/bluez/bluezclient.cpp @@ -19,6 +19,7 @@ #include "bluezclient.h" #include "dbus-shared.h" +#include "../libasteroid/services/common.h" #include #include diff --git a/asteroidsyncserviced/bluez/bluezclient.h b/asteroidsyncserviced/bluez/bluezclient.h index 783e920..a5e138b 100644 --- a/asteroidsyncserviced/bluez/bluezclient.h +++ b/asteroidsyncserviced/bluez/bluezclient.h @@ -30,8 +30,6 @@ #include "bluez_adapter1.h" #include "bluez_agentmanager1.h" -#define NOTIF_UUID "00009071-0000-0000-0000-00a57e401d05" - class Device { public: QBluetoothAddress address; diff --git a/asteroidsyncserviced/main.cpp b/asteroidsyncserviced/main.cpp index 8fb3466..25c8f48 100644 --- a/asteroidsyncserviced/main.cpp +++ b/asteroidsyncserviced/main.cpp @@ -33,13 +33,13 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); - WatchesManager *watchesManager = new WatchesManager(); - #ifdef UBUNTU_TOUCH_PLATFORM - UbuntuPlatform *platform = new UbuntuPlatform(watchesManager); - #elif SAILFISHOS_PLATFORM - SailfishPlatform *platform = new SailfishPlatform(watchesManager); - #endif - DBusInterface *dbusInterface = new DBusInterface(watchesManager); + WatchesManager watchesManager; +#ifdef UBUNTU_TOUCH_PLATFORM + UbuntuPlatform platform(&watchesManager); +#elif SAILFISHOS_PLATFORM + SailfishPlatform platform(&watchesManager); +#endif + DBusInterface dbusInterface(&watchesManager); return a.exec(); } diff --git a/rpm/asteroidsyncservice.spec b/rpm/asteroidsyncservice.spec index 2f0b887..51a3969 100644 --- a/rpm/asteroidsyncservice.spec +++ b/rpm/asteroidsyncservice.spec @@ -40,17 +40,17 @@ Support for AsteroidOS watches in SailfishOS. rm -rf %{buildroot} %qmake5_install -mkdir -p %{buildroot}%{_libdir}/systemd/user/user-session.target.wants -ln -s ../asteroidsyncserviced.service %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/ +mkdir -p %{buildroot}%{_userunitdir}/user-session.target.wants +ln -s ../asteroidsyncserviced.service %{buildroot}%{_userunitdir}/user-session.target.wants/ %post -grep -q "^/usr/bin/asteroidsyncserviced" /usr/share/mapplauncherd/privileges || echo "/usr/bin/asteroidsyncserviced,cehlmnpu" >> /usr/share/mapplauncherd/privileges -su nemo -c 'systemctl --user daemon-reload' -su nemo -c 'systemctl --user try-restart asteroidsyncserviced.service' +echo "/usr/bin/asteroidsyncserviced,cehlmnpu" > /usr/share/mapplauncherd/privileges.d/harbour-asteroidsyncserviced.privileges +systemctl-user daemon-reload +systemctl-user try-restart asteroidsyncserviced.service %files %defattr(-,root,root,-) %{_bindir} -%{_libdir}/systemd/user/%{name}d.service -%{_libdir}/systemd/user/user-session.target.wants/%{name}d.service +%{_userunitdir}/%{name}d.service +%{_userunitdir}/user-session.target.wants/%{name}d.service %{_libdir}/qt5/qml/org/asteroid/syncservice