diff options
Diffstat (limited to 'saltoqd')
-rw-r--r-- | saltoqd/saltoq-bt-sniff-subrate.service | 10 | ||||
-rw-r--r-- | saltoqd/saltoqd.pro | 10 | ||||
-rw-r--r-- | saltoqd/toqmanager.cpp | 9 | ||||
-rw-r--r-- | saltoqd/toqmanager.h | 24 | ||||
-rw-r--r-- | saltoqd/toqmanageradaptor.cpp | 24 | ||||
-rw-r--r-- | saltoqd/toqmanageradaptor.h | 39 |
6 files changed, 85 insertions, 31 deletions
diff --git a/saltoqd/saltoq-bt-sniff-subrate.service b/saltoqd/saltoq-bt-sniff-subrate.service new file mode 100644 index 0000000..08bad83 --- /dev/null +++ b/saltoqd/saltoq-bt-sniff-subrate.service @@ -0,0 +1,10 @@ +[Unit] +Description=Set Bluetooth's sniff_max_interval +After=local-fs.target + +[Service] +Type=oneshot +ExecStart=/bin/sh -c "/bin/echo 1600 > /sys/class/bluetooth/hci0/sniff_max_interval" + +[Install] +WantedBy=multi-user.target diff --git a/saltoqd/saltoqd.pro b/saltoqd/saltoqd.pro index 4a51905..4337097 100644 --- a/saltoqd/saltoqd.pro +++ b/saltoqd/saltoqd.pro @@ -25,7 +25,8 @@ SOURCES += main.cpp \ cardmanager.cpp \ agendamanager.cpp \ settings.cpp \ - settingsmanager.cpp + settingsmanager.cpp \ + toqmanageradaptor.cpp HEADERS += \ toqconnection.h \ @@ -44,7 +45,8 @@ HEADERS += \ cardmanager.h \ agendamanager.h \ settings.h \ - settingsmanager.h + settingsmanager.h \ + toqmanageradaptor.h DBUS_INTERFACES += com.nokia.profiled.xml org.nemomobile.voicecall.VoiceCallManager.xml org.nemomobile.voicecall.VoiceCall.xml QDBUSXML2CPP_INTERFACE_HEADER_FLAGS = -i voicecallmanager.h @@ -55,3 +57,7 @@ INSTALLS += target unit.path = /usr/lib/systemd/user/ unit.files = saltoqd.service INSTALLS += unit + +workaround.path = /usr/lib/systemd/system/ +workaround.files = saltoq-bt-sniff-subrate.service +INSTALLS += workaround diff --git a/saltoqd/toqmanager.cpp b/saltoqd/toqmanager.cpp index 6e738fe..c319939 100644 --- a/saltoqd/toqmanager.cpp +++ b/saltoqd/toqmanager.cpp @@ -1,6 +1,7 @@ #include <QtDBus/QDBusConnection> #include "toqmanager.h" +#include "toqmanageradaptor.h" #include "obexconnection.h" @@ -51,7 +52,7 @@ ToqManager::ToqManager(Settings *settings, QObject *parent) : _conn->setAddress(QBluetoothAddress(_settings->address())); - new ToqManagerAdaptor(this); + new ToqManagerAdaptor(_fmsManager, this); QDBusConnection::sessionBus().registerObject("/com/javispedro/saltoq/ToqManager", this); } @@ -126,9 +127,3 @@ void ToqManager::handleSettingsAddressChanged() { _conn->setAddress(QBluetoothAddress(_settings->address())); } - -ToqManagerAdaptor::ToqManagerAdaptor(ToqManager *parent) - : QDBusAbstractAdaptor(parent) -{ - setAutoRelaySignals(true); -} diff --git a/saltoqd/toqmanager.h b/saltoqd/toqmanager.h index 6cc8b8d..a7e99b2 100644 --- a/saltoqd/toqmanager.h +++ b/saltoqd/toqmanager.h @@ -2,7 +2,6 @@ #define TOQMANAGER_H #include <QtCore/QObject> -#include <QtDBus/QDBusAbstractAdaptor> #include "toqconnection.h" #include "settings.h" @@ -27,6 +26,8 @@ class ToqManager : public QObject Q_OBJECT Q_PROPERTY(bool connected READ isConnected NOTIFY connectedChanged) + friend class ToqManagerAdaptor; + public: explicit ToqManager(Settings *settings, QObject *parent = 0); @@ -81,22 +82,6 @@ private: NotificationManager *_notificationManager; }; -class ToqManagerAdaptor : public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.javispedro.saltoq.ToqManager") - - Q_PROPERTY(bool connected READ isConnected NOTIFY connectedChanged) - -public: - ToqManagerAdaptor(ToqManager *parent); - - bool isConnected() const; - -signals: - void connectedChanged(); -}; - inline bool ToqManager::isConnected() const { return _conn->isConnected(); @@ -107,9 +92,4 @@ inline quint16 ToqManager::newTransactionId() return _conn->newTransactionId(); } -inline bool ToqManagerAdaptor::isConnected() const -{ - return static_cast<ToqManager*>(parent())->isConnected(); -} - #endif // TOQMANAGER_H diff --git a/saltoqd/toqmanageradaptor.cpp b/saltoqd/toqmanageradaptor.cpp new file mode 100644 index 0000000..d5ee41d --- /dev/null +++ b/saltoqd/toqmanageradaptor.cpp @@ -0,0 +1,24 @@ +#include <QtCore/QFile> + +#include "toqmanageradaptor.h" +#include "fmsmanager.h" + +ToqManagerAdaptor::ToqManagerAdaptor(FmsManager *fms, ToqManager *parent) + : QDBusAbstractAdaptor(parent), + _conn(QDBusConnection::sessionBus()), + _toq(parent), _fms(fms) +{ + setAutoRelaySignals(true); +} + +void ToqManagerAdaptor::PutFile(const QString &localFile, const QString &remoteFile, const QDBusMessage &msg) +{ + QFile f(localFile); + if (!f.open(QIODevice::ReadOnly)) { + QDBusMessage reply = msg.createErrorReply("com.javispedro.saltoq.InvalidFile", "File does not exist"); + _conn.send(reply); + return; + } + + _fms->updateFile(remoteFile, f.readAll()); +} diff --git a/saltoqd/toqmanageradaptor.h b/saltoqd/toqmanageradaptor.h new file mode 100644 index 0000000..c2e62e9 --- /dev/null +++ b/saltoqd/toqmanageradaptor.h @@ -0,0 +1,39 @@ +#ifndef TOQMANAGERADAPTOR_H +#define TOQMANAGERADAPTOR_H + +#include <QtDBus/QDBusConnection> +#include <QtDBus/QDBusAbstractAdaptor> +#include <QtDBus/QDBusMessage> + +#include "toqmanager.h" + +class ToqManagerAdaptor : public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "com.javispedro.saltoq.ToqManager") + + Q_PROPERTY(bool connected READ isConnected NOTIFY connectedChanged) + +public: + ToqManagerAdaptor(FmsManager *fms, ToqManager *parent); + + bool isConnected() const; + +public slots: + void PutFile(const QString &localFile, const QString &remoteFile, const QDBusMessage &msg); + +signals: + void connectedChanged(); + +private: + QDBusConnection _conn; + ToqManager *_toq; + FmsManager *_fms; +}; + +inline bool ToqManagerAdaptor::isConnected() const +{ + return _toq->isConnected(); +} + +#endif // TOQMANAGERADAPTOR_H |