Damien Caliste wrote:

> Can you point out where did you push your modifications to buteo stack ?
> I would like to give a look and test.
> 
> I guess that
> https://git.sailfishos.org/deloptes/poc-bluez5-buteo-syncml-plugins is a
> fork of buteo-sync-plugins with your changes. What about buteo-syncfw ?
> 
> What client are you using on desktop side to test the plugin in phone ?
> 

Hi,
yes indeed - this is the link - I was just doing PoC and Tone asked to
share.

The buteo-syncfw is not uploaded anywhere. I guess I will push MR to the
original repo. I can only offer the attached patch for now.

regards


diff --git a/libbuteosyncfw/common/TransportTracker.cpp b/libbuteosyncfw/common/TransportTracker.cpp
index 35097ec..3cff6d8 100644
--- a/libbuteosyncfw/common/TransportTracker.cpp
+++ b/libbuteosyncfw/common/TransportTracker.cpp
@@ -32,6 +32,8 @@
 #include <QDBusMessage>
 #include <QDBusArgument>
 
+#include <adapter.h>
+
 using namespace Buteo;
 
 TransportTracker::TransportTracker(QObject *aParent) :
@@ -65,16 +67,24 @@ TransportTracker::TransportTracker(QObject *aParent) :
 #endif
 
     // BT
-    // Set the bluetooth state
-    iTransportStates[Sync::CONNECTIVITY_BT] = btConnectivityStatus();
-    if (!iSystemBus.connect("org.bluez",
-                    "",
-                    "org.bluez.Adapter",
-                    "PropertyChanged",
-                    this,
-                    SLOT(onBtStateChanged(QString, QDBusVariant))))
+    // Initialize BluezQt
+    btManager = new BluezQt::Manager(this);
+    if (btManager != 0) {
+        BluezQt::InitManagerJob *initJob = btManager->init();
+        initJob->start();
+        connect(initJob, &BluezQt::InitManagerJob::result,
+                this, &TransportTracker::initBluez5ManagerJobResult/*,
+                Qt::QueuedConnection*/);
+        LOG_DEBUG("BT manager init started");
+        // wait to complete
+        while (!btManager->isOperational())
+        {
+            QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
+        }
+    }
+    else
     {
-        LOG_WARNING("Unable to connect to system bus for org.bluez.Adapter");
+        LOG_CRITICAL("BT manager init failed");
     }
 
     // Internet
@@ -97,6 +107,7 @@ TransportTracker::TransportTracker(QObject *aParent) :
 TransportTracker::~TransportTracker()
 {
     FUNCTION_CALL_TRACE;
+
 }
 
 bool TransportTracker::isConnectivityAvailable(Sync::ConnectivityType aType) const
@@ -116,16 +127,24 @@ void TransportTracker::onUsbStateChanged(bool aConnected)
     updateState(Sync::CONNECTIVITY_USB, aConnected);
 }
 
-void TransportTracker::onBtStateChanged(QString aKey, QDBusVariant aValue)
+void TransportTracker::onBtStateChanged(bool aValue)
 {
     FUNCTION_CALL_TRACE;
 
-    if (aKey == "Powered")
+    if (aValue)
     {
-        bool btPowered = aValue.variant().toBool();
-        LOG_DEBUG("BT power state " << btPowered);
-        updateState(Sync::CONNECTIVITY_BT, btPowered);
+        // If BT was enabled, give the framework 2sec to complete
+        LOG_DEBUG("BT state changed" << aValue << "(sending update in 2sec)");
+        QTime dieTime= QTime::currentTime().addSecs(2);
+        while (QTime::currentTime() < dieTime)
+            QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
     }
+    else
+    {
+        // else update state immediately
+        LOG_DEBUG("BT state update - new state:" << aValue );
+    }
+    updateState(Sync::CONNECTIVITY_BT, aValue);
 }
 
 void TransportTracker::onInternetStateChanged(bool aConnected, Sync::InternetConnectionType aType)
@@ -142,7 +161,6 @@ void TransportTracker::updateState(Sync::ConnectivityType aType,
 {
     FUNCTION_CALL_TRACE;
 
-
     bool oldState = false;
     {
         QMutexLocker locker(&iMutex);
@@ -158,57 +176,39 @@ void TransportTracker::updateState(Sync::ConnectivityType aType,
     }
 }
 
-bool TransportTracker::btConnectivityStatus()
-{
-    FUNCTION_CALL_TRACE;
+void TransportTracker::initBluez5ManagerJobResult(BluezQt::InitManagerJob* job) {
 
-    bool btOn = false;
-    QDBusMessage methodCallMsg = QDBusMessage::createMethodCall("org.bluez",
-                                                                "/",
-                                                                "org.bluez.Manager",
-                                                                "DefaultAdapter");
+    FUNCTION_CALL_TRACE;
 
-    QDBusMessage reply = iSystemBus.call(methodCallMsg);
-    if (reply.type() == QDBusMessage::ErrorMessage)
-    {
-        LOG_WARNING("This device does not have a BT adapter");
-        return btOn;
+    if (job->error()) {
+        LOG_CRITICAL("BT manager init error:" << job->errorText());
+        return;
     }
 
-    QList<QVariant> adapterList = reply.arguments();
-    // We will take the first adapter in the list
-    QString adapterPath = qdbus_cast<QDBusObjectPath>(adapterList.at(0)).path();
+    // @todo do we need to act on btManager status change?
+//    connect(btManager, &BluezQt::Manager::operationalChanged,
+//            this, &TransportTracker::onBtStateChanged);
+    // Make sure to update msyncd when bluetoothd starts
+    connect(btManager, &BluezQt::Manager::bluetoothOperationalChanged,
+            this, &TransportTracker::onBtStateChanged);
+
+    bool isBtOperational = btManager->isBluetoothOperational();
+    if (!btManager->isOperational() || !isBtOperational) {
+        if (btManager->isBluetoothBlocked())
+            LOG_WARNING("BT manager started (adapter is blocked)");
+        else
+            LOG_CRITICAL("BT manager started (not operational)");
+        return;
+    }
 
-    if (!adapterPath.isEmpty() || !adapterPath.isNull())
+    BluezQt::AdapterPtr defaultAdapter = btManager->usableAdapter();
+    if (!defaultAdapter)
     {
-        // Retrive the properties of the adapter and check for "Powered" key
-        methodCallMsg = QDBusMessage::createMethodCall("org.bluez",
-                                                       adapterPath,
-                                                       "org.bluez.Adapter",
-                                                       "GetProperties");
-        reply = iSystemBus.call(methodCallMsg);
-        if (reply.type() == QDBusMessage::ErrorMessage)
-        {
-            LOG_WARNING("Error in retrieving bluetooth properties");
-            return btOn;
-        }
-
-        QDBusArgument arg = reply.arguments().at(0).value<QDBusArgument>();
-        if (arg.currentType() == QDBusArgument::MapType)
-        {
-            // Scan through the dict returned and check for "Powered" entry
-            QMap<QString,QVariant> dict = qdbus_cast<QMap<QString,QVariant> >(arg);
-            QMap<QString,QVariant>::iterator iter;
-            for(iter = dict.begin(); iter != dict.end(); ++iter)
-            {
-                if (iter.key() == "Powered")
-                {
-                    btOn = iter.value().toBool();
-                    LOG_DEBUG ("Bluetooth powered on? " << btOn);
-                    break;
-                }
-            }
-        }
+        LOG_WARNING("BT manager initialized but no usable adapter found");
+        return;
     }
-    return btOn;
+    // Update bluetooth state
+    updateState(Sync::CONNECTIVITY_BT, defaultAdapter->isPowered());
+
+    LOG_DEBUG ("BT manager init done");
 }
diff --git a/libbuteosyncfw/common/TransportTracker.h b/libbuteosyncfw/common/TransportTracker.h
index f43155d..cc3f2aa 100644
--- a/libbuteosyncfw/common/TransportTracker.h
+++ b/libbuteosyncfw/common/TransportTracker.h
@@ -31,37 +31,40 @@
 #include <QDBusVariant>
 #include <QDBusConnection>
 
-namespace Buteo {
+#include <manager.h>
+#include <initmanagerjob.h>
+
+namespace Buteo
+{
 
 class USBModedProxy;
 class NetworkManager;
 
-
 /*! \brief Class for tracking transport states
  *
  * USB state is tracked with HAL, BT with Context Framework and Internet states with Buteo::NetworkManager.
  */
-class TransportTracker : public QObject
+class TransportTracker: public QObject
 {
-        Q_OBJECT
+    Q_OBJECT
 
 public:
 
-        /*! \brief Constructor
-         *
-         * @param aParent Parent object
-         */
-        TransportTracker(QObject *aParent = 0);
+    /*! \brief Constructor
+     *
+     * @param aParent Parent object
+     */
+    TransportTracker(QObject *aParent = 0);
 
-        //! \brief Destructor
-        virtual ~TransportTracker();
+    //! \brief Destructor
+    virtual ~TransportTracker();
 
-        /*! \brief Checks the state of the given connectivity type
-         *
-         * @param aType Connectivity type
-         * @return True if available, false if not
-         */
-        bool isConnectivityAvailable(Sync::ConnectivityType aType) const;
+    /*! \brief Checks the state of the given connectivity type
+     *
+     * @param aType Connectivity type
+     * @return True if available, false if not
+     */
+    bool isConnectivityAvailable(Sync::ConnectivityType aType) const;
 
 signals:
 
@@ -70,7 +73,7 @@ signals:
      * @param aType Connectivity type whose state has changed
      * @param aState New state. True if available, false if not.
      */
-        void connectivityStateChanged(Sync::ConnectivityType aType, bool aState);
+    void connectivityStateChanged(Sync::ConnectivityType aType, bool aState);
 
     /*! \brief Signal emitted when a n/w state changes
      *
@@ -89,11 +92,23 @@ signals:
 
 private slots:
 
-        void onUsbStateChanged(bool aConnected);
+    void onUsbStateChanged(bool aConnected);
 
-    void onBtStateChanged(QString aKey, QDBusVariant aValue);
+    /*! \brief Slot onBtStateChanged to update BT state
+     * \param bool aValue
+     */
+    void onBtStateChanged(bool aValue);
 
-    void onInternetStateChanged(bool aConnected, Sync::InternetConnectionType aType);
+    /*! \brief Process the result of the onInternetStateChanged signal
+     * \param bool aConnected
+     * \param Sync::InternetConnectionType aType
+     */
+    void onInternetStateChanged(bool aConnected,
+            Sync::InternetConnectionType aType);
+
+    /*! \brief Process the result of the initBluez5ManagerJob signal
+     */
+    void initBluez5ManagerJobResult(BluezQt::InitManagerJob*/*job*/);
 
 private:
 
@@ -104,22 +119,22 @@ private:
     NetworkManager *iInternet;
     QDBusConnection iSystemBus;
 
+    BluezQt::Manager *btManager;
+
     mutable QMutex iMutex;
 
-        /*! \brief updates the state of the given connectivity type to input value
-         *
-         * @param aType Connectivity type
-         * @param aState Connectivity State
-         */
-        void updateState(Sync::ConnectivityType aType, bool aState);
+    /*! \brief updates the state of the given connectivity type to input value
+     *
+     * @param aType Connectivity type
+     * @param aState Connectivity State
+     */
+    void updateState(Sync::ConnectivityType aType, bool aState);
 
 #ifdef SYNCFW_UNIT_TESTS
     friend class TransportTrackerTest;
     friend class SynchronizerTest;
 #endif
 
-    bool btConnectivityStatus();
-
 };
 
 }
diff --git a/libbuteosyncfw/libbuteosyncfw.pro b/libbuteosyncfw/libbuteosyncfw.pro
index ca1422b..1814ccd 100644
--- a/libbuteosyncfw/libbuteosyncfw.pro
+++ b/libbuteosyncfw/libbuteosyncfw.pro
@@ -10,11 +10,17 @@ VER_PAT = 0
 QT += sql xml dbus network
 QT -= gui
 
+unix {
+    QT_CONFIG -= no-pkg-config
+    CONFIG += link_pkgconfig
+    PKGCONFIG += KF5BluezQt
+}
+
 CONFIG += dll \
     create_pc \
     create_prl
 
-#DEFINES += BUTEO_ENABLE_DEBUG
+DEFINES += BUTEO_ENABLE_DEBUG
 
 # Input
 HEADERS += common/Logger.h \
diff --git a/libbuteosyncfw/profile/BtHelper.cpp b/libbuteosyncfw/profile/BtHelper.cpp
index 47269a4..5b0839e 100644
--- a/libbuteosyncfw/profile/BtHelper.cpp
+++ b/libbuteosyncfw/profile/BtHelper.cpp
@@ -24,142 +24,160 @@
 #include <LogMacros.h>
 
 #include "BtHelper.h"
+#include <initmanagerjob.h>
 
 
 const QString BT::BLUEZ_DEST = "org.bluez";
-const QString BT::BLUEZ_MANAGER_INTERFACE = "org.bluez.Manager";
-const QString BT::BLUEZ_ADAPTER_INTERFACE = "org.bluez.Adapter";
-const QString BT::BLUEZ_DEVICE_INTERFACE = "org.bluez.Device";
-const QString BT::GET_DEFAULT_ADAPTER = "DefaultAdapter";
-const QString BT::FIND_DEVICE = "FindDevice";
-const QString BT::DISCOVERSERVICES = "DiscoverServices";
-const QString BT::GETPROPERTIES = "GetProperties";
+const QString BT::DBUS_PROPERTIES_INTERFACE = "org.freedesktop.DBus.Properties";
+const QString BT::GETPROPERTIES = "GetAll";
 
 
 BtHelper::BtHelper(const QString& deviceAddress,
                        QObject* parent) : QObject(parent)
 {
-    m_deviceAddress         = deviceAddress;
+    m_deviceAddress = deviceAddress;
+
+    btManager = new BluezQt::Manager(this);
+    if (btManager != 0) {
+        BluezQt::InitManagerJob *initJob = btManager->init();
+        initJob->start();
+        connect(initJob, &BluezQt::InitManagerJob::result,
+                this, &BtHelper::initBluez5ManagerJobResult/*,
+                    Qt::QueuedConnection*/);
+        LOG_DEBUG("BtHelper::BtHelper manager init started");
+        while (!btManager->isOperational())
+        {
+            QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
+        }
+    }
+    else
+    {
+        LOG_CRITICAL("BtHelper::BtHelper manager start failed");
+    }
 }
 
 BtHelper::~BtHelper()
 {
-  LOG_DEBUG ("");    
+    FUNCTION_CALL_TRACE;
+    LOG_DEBUG ("BtHelper::~BtHelper()");
 }
 
+void BtHelper::initBluez5ManagerJobResult(BluezQt::InitManagerJob* job) {
+    FUNCTION_CALL_TRACE;
 
+    if (job->error()) {
+        LOG_CRITICAL("BtHelper manager init error: " << job->errorText());
+        return;
+    }
+
+    if (!btManager->isOperational() || btManager->isBluetoothBlocked()) {
+        if (btManager->isBluetoothBlocked())
+            LOG_WARNING("BtHelper manager init failed (adapter is blocked)");
+        else
+            LOG_CRITICAL("BtHelper manager init failed (not operational)");
+        return;
+    }
+
+    if(m_deviceAddress.isEmpty())
+    {
+        LOG_CRITICAL("BtHelper no BT address provided");
+        return;
+    }
+
+    BluezQt::DevicePtr dev = btManager->deviceForAddress(m_deviceAddress);
+    if (!dev)
+    {
+        LOG_WARNING("BtHelper manager device query failed for addr: " << m_deviceAddress);
+        return;
+    }
+    BluezQt::AdapterPtr adapter = dev->adapter();
+    if (!adapter)
+    {
+        LOG_WARNING("BtHelper manager init done but no usable adapter found");
+        return;
+    }
+    LOG_DEBUG("BtHelper adapter path: " << adapter->ubi());
+    LOG_DEBUG("BtHelper adapter name: " << adapter->name());
+}
 
 bool BtHelper::isServiceSupported (const QList<QString>& servicesList, const QString& serviceUUID)
 {
-   LOG_DEBUG ("isServiceSupported");
-   foreach (QString service, servicesList) {
-  	//LOG_DEBUG ("Record : "  << service);
-	if (service.contains(serviceUUID)){   
-   		LOG_DEBUG ("Service found " << serviceUUID);
-		return true;
-	}
-   }
-   return false;
+    FUNCTION_CALL_TRACE;
+
+    foreach (QString service, servicesList) {
+        LOG_DEBUG ("Record : "  << service);
+        if (service.contains(serviceUUID)){
+            LOG_DEBUG ("Service found " << serviceUUID);
+            return true;
+        }
+    }
+    return false;
 }
 
 QString BtHelper::getDefaultAdapterPath()
 {
-    LOG_DEBUG ("getDefaultAdapterPath");
-    
-    QDBusInterface managerInterface( BT::BLUEZ_DEST, "/",
-                                     BT::BLUEZ_MANAGER_INTERFACE,
-                                     QDBusConnection::systemBus() );
-
-    if( !managerInterface.isValid() ) {
-        LOG_DEBUG ("Manager interface is invalid");
-        return QString();
-    }
-
-    QDBusReply<QDBusObjectPath> pathReply = managerInterface.call(BT::GET_DEFAULT_ADAPTER);
+    FUNCTION_CALL_TRACE;
 
-    if( !pathReply.isValid() ) {
-        LOG_DEBUG ("Not able to get the adapter path");
+    BluezQt::DevicePtr dev = btManager->deviceForAddress(m_deviceAddress);
+    BluezQt::AdapterPtr defaultAdapter = dev->adapter();
+    if ( ! defaultAdapter )
         return QString();
-    }
-    return pathReply.value().path();
+    
+    return defaultAdapter->ubi();
 }
 
-QString BtHelper::getDevicePath(QString &defaultAdapterPath)
+QString BtHelper::getDevicePath()
 {
-    if (defaultAdapterPath.isEmpty()) {
-    	LOG_DEBUG ( "Adapter path is empty");
-	return QString();	
-    }	
-
-    QDBusInterface adapterInterface(BT::BLUEZ_DEST, defaultAdapterPath,
-                                    BT::BLUEZ_ADAPTER_INTERFACE, QDBusConnection::systemBus() );
-    if( !adapterInterface.isValid() ) {
-        LOG_DEBUG ( "Adapter interface is invalid");
-        return QString();
-    }
+    FUNCTION_CALL_TRACE;
 
-    QDBusReply<QDBusObjectPath> pathReply = adapterInterface.call(BT::FIND_DEVICE, m_deviceAddress );
+    BluezQt::DevicePtr dev = btManager->deviceForAddress(m_deviceAddress);
 
-    if( !pathReply.isValid() ) {
-        LOG_DEBUG ( "Not able to find the BT device");
+    if (!dev)
         return QString();
-    }
-    return pathReply.value().path();
+    return dev->ubi();
 }
 
 bool BtHelper::getServiceRecords(QList<QString>& servicesList)
 {
-    LOG_DEBUG ( "getServiceRecords()");
-
-    QString defaultAdapterPath = getDefaultAdapterPath();
-    LOG_DEBUG ( "Adapter path = " << defaultAdapterPath) ;
-
-    QString devicePath = getDevicePath(defaultAdapterPath);
-    if (devicePath.isEmpty())
-	    return false;
-    LOG_DEBUG ( "Device path =" << devicePath);
+    FUNCTION_CALL_TRACE;
 
-    QDBusInterface deviceInterface(BT::BLUEZ_DEST, devicePath,
-                                   BT::BLUEZ_DEVICE_INTERFACE,
-                                   QDBusConnection::systemBus() );
-    if( deviceInterface.isValid() == false ) {
-        LOG_DEBUG ("Device interface is not valid");
+    if (!btManager->isOperational())
+    {
+        LOG_WARNING("BtHelper::getServiceRecords: manager is not working properly");
         return false;
     }
 
-   QDBusMessage message = deviceInterface.call(BT::DISCOVERSERVICES, QString());
-   QDBusArgument reply = QDBusReply<QDBusArgument>(message).value();
-   QMap<uint, QString> mapVal;
-   reply >> mapVal;  
-   servicesList = mapVal.values();
-   if (servicesList.size() > 0)
-	   return true;
-   return false;
+    BluezQt::DevicePtr dev = btManager->deviceForAddress(m_deviceAddress);
+    servicesList = dev->uuids();
+
+    if (servicesList.size() > 0)
+        return true;
+    return false;
 }
 
-QMap<QString, QVariant> BtHelper::getDeviceProperties()
+QVariantMap BtHelper::getDeviceProperties()
 {
-    LOG_DEBUG ( "getDeviceProperties");
+    FUNCTION_CALL_TRACE;
 
-    QMap<QString, QVariant> mapVal;
-    QString defaultAdapterPath = getDefaultAdapterPath();
-    LOG_DEBUG ( "Adapter path = " << defaultAdapterPath) ;
+    QVariantMap mapVal;
 
-    QString devicePath = getDevicePath(defaultAdapterPath);
+    QString devicePath = getDevicePath();
     if (devicePath.isEmpty())
 	    return mapVal;
-    LOG_DEBUG ( "Device path =" << devicePath);
+
+    LOG_DEBUG ( "Device path: " << devicePath);
 
     QDBusInterface deviceInterface(BT::BLUEZ_DEST, devicePath,
-                                   BT::BLUEZ_DEVICE_INTERFACE,
+                                   BT::DBUS_PROPERTIES_INTERFACE,
                                    QDBusConnection::systemBus() );
+
     if( deviceInterface.isValid() == false ) {
         LOG_DEBUG ("Device interface is not valid");
         return mapVal;
     }
 
-   QDBusMessage message = deviceInterface.call(BT::GETPROPERTIES);
+   QDBusMessage message = deviceInterface.call(BT::GETPROPERTIES, "org.bluez.Device1");
    QDBusArgument reply = QDBusReply<QDBusArgument>(message).value();
-   reply >> mapVal;  
+   reply >> mapVal;
    return mapVal;
 }
diff --git a/libbuteosyncfw/profile/BtHelper.h b/libbuteosyncfw/profile/BtHelper.h
index 819be11..e40e538 100644
--- a/libbuteosyncfw/profile/BtHelper.h
+++ b/libbuteosyncfw/profile/BtHelper.h
@@ -28,25 +28,17 @@
 #include <QtDBus>
 #include <QMap>
 
+#include <manager.h>
+#include <adapter.h>
+#include <device.h>
+
 /*! \brief Strings used for DBus communication with bluetooth daemon are grouped using this structure.
   */
 struct BT
 {
     /// Destination for Dbus command to bluez
     static const QString BLUEZ_DEST;
-    /// Bluez manager interface name
-    static const QString BLUEZ_MANAGER_INTERFACE;
-    /// Bluez adapter interface name
-    static const QString BLUEZ_ADAPTER_INTERFACE;
-    /// Bluez Device interface name
-    static const QString BLUEZ_DEVICE_INTERFACE;
-    /// Method name for retrieving default adapter
-    static const QString GET_DEFAULT_ADAPTER;
-    /// Method name for finding the device
-    static const QString FIND_DEVICE;
-    /// Method name for discovering services
-    static const QString DISCOVERSERVICES;
-    /// Method name for discovering services
+    static const QString DBUS_PROPERTIES_INTERFACE;
     static const QString GETPROPERTIES;
 };
 
@@ -58,6 +50,7 @@ class BtHelper : public QObject
 
 private:
 	QString m_deviceAddress;
+    BluezQt::Manager *btManager;
 
 // Private methods
 
@@ -66,12 +59,14 @@ private:
      QString getDefaultAdapterPath();
     
      /*! \brief Fetches the device path
-      * \param defaultAdapterPath Default adapter path
       */
-     QString getDevicePath(QString& defaultAdapterPath);
-    /* \brief Open the serial port and get file descriptor for the port.
-       * \return File descriptor if opening port was success, otherwise -1
-       */
+     QString getDevicePath();
+
+private slots:
+     /*! \brief Process the result of the initManagerJob
+      */
+     void initBluez5ManagerJobResult(BluezQt::InitManagerJob*/*job*/);
+
 public:
     /*! \brief Constructor.
       * \param deviceAddess Bluetooth address of remote device
@@ -95,7 +90,7 @@ public:
 
     /*! \brief To find remote device BT properties.
       */
-     QMap<QString, QVariant> getDeviceProperties();
+     QVariantMap getDeviceProperties();
 };
 
 #endif // BTHELPER_H
diff --git a/libbuteosyncfw/profile/ProfileManager.cpp b/libbuteosyncfw/profile/ProfileManager.cpp
index f4a0015..e6c91c5 100644
--- a/libbuteosyncfw/profile/ProfileManager.cpp
+++ b/libbuteosyncfw/profile/ProfileManager.cpp
@@ -776,11 +776,10 @@ SyncProfile *ProfileManager::createTempSyncProfile (const QString &destAddress,
 
     saveNewProfile = true;
     BtHelper btHelp(destAddress);
-    QString profileDisplayName = btHelp.getDeviceProperties().value("Name").toString();
-    if (profileDisplayName.isEmpty()) {
-        //Fixes 171340
-        profileDisplayName = QString ("qtn_sync_dest_name_device_default");
-    }
+    // return default value "qtn_sync_dest_name_device_default"
+    // Fixes 171340
+    QString dName = "qtn_sync_dest_name_device_default";
+    QString profileDisplayName = btHelp.getDeviceProperties().value("Name", dName).toString();
 
     LOG_INFO("Profile Name :" << profileDisplayName);
     SyncProfile *tProfile = syncProfile(BT_PROFILE_TEMPLATE);
diff --git a/msyncd/msyncd-app.pro b/msyncd/msyncd-app.pro
index a8e08ec..50d1914 100644
--- a/msyncd/msyncd-app.pro
+++ b/msyncd/msyncd-app.pro
@@ -18,7 +18,7 @@ INCLUDEPATH += . \
     ../libbuteosyncfw/profile
 
 
-PKGCONFIG += dbus-1 libsignon-qt5 accounts-qt5 Qt5SystemInfo
+PKGCONFIG += dbus-1 libsignon-qt5 accounts-qt5 Qt5SystemInfo KF5BluezQt
 LIBS += -lbuteosyncfw5
 packagesExist(qt5-boostable) {
     DEFINES += HAS_BOOSTER
diff --git a/msyncd/msyncd-lib.pro b/msyncd/msyncd-lib.pro
index 7cf681d..633e575 100644
--- a/msyncd/msyncd-lib.pro
+++ b/msyncd/msyncd-lib.pro
@@ -18,9 +18,10 @@ INCLUDEPATH += . \
     ../libbuteosyncfw/common \
     ../libbuteosyncfw/profile
 
+DEFINES += BUTEO_ENABLE_DEBUG
 
 PKGCONFIG += dbus-1 gio-2.0 libsignon-qt5 accounts-qt5 Qt5SystemInfo
-PKGCONFIG += mce-qt5
+PKGCONFIG += mce-qt5 KF5BluezQt
 LIBS += -lbuteosyncfw5
 packagesExist(qt5-boostable) {
     DEFINES += HAS_BOOSTER
diff --git a/rpm/buteo-syncfw-qt5.spec b/rpm/buteo-syncfw-qt5.spec
index 83b4f9d..1dbdf64 100644
--- a/rpm/buteo-syncfw-qt5.spec
+++ b/rpm/buteo-syncfw-qt5.spec
@@ -20,12 +20,14 @@ BuildRequires: pkgconfig(libiphb)
 BuildRequires: pkgconfig(qt5-boostable)
 BuildRequires: pkgconfig(keepalive)
 BuildRequires: pkgconfig(gio-2.0)
+BuildRequires: pkgconfig(KF5BluezQt)
 BuildRequires: pkgconfig(mce-qt5) >= 1.1.0
 BuildRequires: oneshot
 BuildRequires: doxygen
 Requires: mapplauncherd-qt5
 Requires: oneshot
 Requires: glib2
+Requires: kf5bluezqt-bluez5 >= 5.24
 Requires: libmce-qt5 >= 1.1.0
 %{_oneshot_requires_post}
 
diff --git a/unittests/tests/msyncdtests/TransportTrackerTest/TransportTrackerTest.cpp b/unittests/tests/msyncdtests/TransportTrackerTest/TransportTrackerTest.cpp
index 0c37b4c..7fcb221 100644
--- a/unittests/tests/msyncdtests/TransportTrackerTest/TransportTrackerTest.cpp
+++ b/unittests/tests/msyncdtests/TransportTrackerTest/TransportTrackerTest.cpp
@@ -102,7 +102,7 @@ void TransportTrackerTest :: testStateChanged()
 
     // change BT state and verify
     bool btCurrentState = iTransportTracker->isConnectivityAvailable(Sync::CONNECTIVITY_BT);
-    iTransportTracker->onBtStateChanged("Powered", QDBusVariant(QVariant(!btCurrentState)));
+    iTransportTracker->onBtStateChanged(!btCurrentState);
 
     QCOMPARE(iTransportTracker->isConnectivityAvailable(Sync::CONNECTIVITY_BT), !btCurrentState);
     QCOMPARE(connectivityStateSpy.count(), 1);
diff --git a/unittests/tests/tests_common.pri b/unittests/tests/tests_common.pri
index 35f4d11..127cd81 100644
--- a/unittests/tests/tests_common.pri
+++ b/unittests/tests/tests_common.pri
@@ -16,7 +16,7 @@ QT -= gui
 
 CONFIG += link_pkgconfig link_prl
 
-PKGCONFIG += dbus-1 Qt5SystemInfo
+PKGCONFIG += dbus-1 Qt5SystemInfo KF5BluezQt
 
 LIBS += -lgcov
 

_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to