Hello community, here is the log from the commit of package bluez-qt for openSUSE:Factory checked in at 2017-07-05 23:47:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bluez-qt (Old) and /work/SRC/openSUSE:Factory/.bluez-qt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "bluez-qt" Wed Jul 5 23:47:42 2017 rev:27 rq:502916 version:5.35.0 Changes: -------- --- /work/SRC/openSUSE:Factory/bluez-qt/bluez-qt.changes 2017-06-01 16:17:06.515325769 +0200 +++ /work/SRC/openSUSE:Factory/.bluez-qt.new/bluez-qt.changes 2017-07-05 23:47:44.890580876 +0200 @@ -1,0 +2,11 @@ +Sun Jun 11 09:27:42 CEST 2017 - lbeltrame@kde.org + +- Update to 5.35.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.35.0.php +- Changes since 5.34.0: + * Pass an explicit list of arguments. This prevents QProcess from trying to handle our space containing path through a shell + * Fix property changes being missed immediately after an obejct is added (kde#377405) + +------------------------------------------------------------------- Old: ---- bluez-qt-5.34.0.tar.xz New: ---- bluez-qt-5.35.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bluez-qt.spec ++++++ --- /var/tmp/diff_new_pack.MgK81a/_old 2017-07-05 23:47:45.526491311 +0200 +++ /var/tmp/diff_new_pack.MgK81a/_new 2017-07-05 23:47:45.526491311 +0200 @@ -18,9 +18,9 @@ %define sonum 6 %define _libname KF5BluezQt -%define _tar_path 5.34 +%define _tar_path 5.35 Name: bluez-qt -Version: 5.34.0 +Version: 5.35.0 Release: 0 Summary: Async Bluez wrapper library License: LGPL-2.1+ ++++++ bluez-qt-5.34.0.tar.xz -> bluez-qt-5.35.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/CMakeLists.txt new/bluez-qt-5.35.0/CMakeLists.txt --- old/bluez-qt-5.34.0/CMakeLists.txt 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/CMakeLists.txt 2017-06-03 10:44:33.000000000 +0200 @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.0) -set(KF5_VERSION "5.34.0") # handled by release scripts +set(KF5_VERSION "5.35.0") # handled by release scripts project(BluezQt VERSION ${KF5_VERSION}) include(FeatureSummary) -find_package(ECM 5.34.0 NO_MODULE) +find_package(ECM 5.35.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/autotests/autotests.cpp new/bluez-qt-5.35.0/autotests/autotests.cpp --- old/bluez-qt-5.34.0/autotests/autotests.cpp 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/autotests/autotests.cpp 2017-06-03 10:44:33.000000000 +0200 @@ -74,7 +74,7 @@ connect(FakeBluez::s_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); connect(FakeBluez::s_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus))); - FakeBluez::s_process->start(m_fakebluezPath); + FakeBluez::s_process->start(m_fakebluezPath, QStringList()); m_eventLoop.exec(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/autotests/fakebluez/devicemanager.cpp new/bluez-qt-5.35.0/autotests/fakebluez/devicemanager.cpp --- old/bluez-qt-5.34.0/autotests/fakebluez/devicemanager.cpp 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/autotests/fakebluez/devicemanager.cpp 2017-06-03 10:44:33.000000000 +0200 @@ -43,6 +43,8 @@ runChangeAdapterProperty(properties); } else if (actionName == QLatin1String("change-device-property")) { runChangeDeviceProperty(properties); + } else if (actionName == QLatin1String("bug377405")) { + runBug377405(); } } @@ -103,3 +105,20 @@ device->changeProperty(properties.value(QStringLiteral("Name")).toString(), properties.value(QStringLiteral("Value"))); } + +void DeviceManager::runBug377405() +{ + QDBusObjectPath adapter1path = QDBusObjectPath(QStringLiteral("/org/bluez/hci0")); + QVariantMap adapterProps; + adapterProps[QStringLiteral("Path")] = QVariant::fromValue(adapter1path); + adapterProps[QStringLiteral("Powered")] = false; + + runCreateAdapterAction(adapterProps); + + QVariantMap properties; + properties[QStringLiteral("Path")] = QVariant::fromValue(adapter1path); + properties[QStringLiteral("Name")] = QStringLiteral("Powered"); + properties[QStringLiteral("Value")] = true; + + runChangeAdapterProperty(properties); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/autotests/fakebluez/devicemanager.h new/bluez-qt-5.35.0/autotests/fakebluez/devicemanager.h --- old/bluez-qt-5.34.0/autotests/fakebluez/devicemanager.h 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/autotests/fakebluez/devicemanager.h 2017-06-03 10:44:33.000000000 +0200 @@ -41,6 +41,7 @@ void runRemoveDeviceAction(const QVariantMap &properties); void runChangeAdapterProperty(const QVariantMap &properties); void runChangeDeviceProperty(const QVariantMap &properties); + void runBug377405(); ObjectManager *m_objectManager; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/autotests/managertest.cpp new/bluez-qt-5.35.0/autotests/managertest.cpp --- old/bluez-qt-5.34.0/autotests/managertest.cpp 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/autotests/managertest.cpp 2017-06-03 10:44:33.000000000 +0200 @@ -437,4 +437,24 @@ delete manager; } +void ManagerTest::bug377405() +{ + // Bug 377405: Property changes immediately after adapter is added are lost + + FakeBluez::start(); + FakeBluez::runTest(QStringLiteral("bluez-standard")); + + Manager *manager = new Manager; + + InitManagerJob *job = manager->init(); + job->exec(); + + QVERIFY(!job->error()); + + FakeBluez::runAction(QStringLiteral("devicemanager"), QStringLiteral("bug377405")); + + // Adapter property Powered is changed to true immediately after being added + QTRY_COMPARE(manager->isBluetoothOperational(), true); +} + QTEST_MAIN(ManagerTest) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/autotests/managertest.h new/bluez-qt-5.35.0/autotests/managertest.h --- old/bluez-qt-5.34.0/autotests/managertest.h 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/autotests/managertest.h 2017-06-03 10:44:33.000000000 +0200 @@ -41,6 +41,7 @@ void deviceForAddressTest(); void adapterWithDevicesRemovedTest(); void bug364416(); + void bug377405(); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/src/adapter_p.cpp new/bluez-qt-5.35.0/src/adapter_p.cpp --- old/bluez-qt-5.34.0/src/adapter_p.cpp 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/src/adapter_p.cpp 2017-06-03 10:44:33.000000000 +0200 @@ -48,14 +48,6 @@ m_dbusProperties = new DBusProperties(Strings::orgBluez(), m_bluezAdapter->path(), DBusConnection::orgBluez(), this); - // QueuedConnection is important here to be able to perform actions, that depend on - // a previously set property, directly from slot connected to propertyChanged signal. - // Eg. Powering on adapter and then starting discovery. - // * with DirectConnection the StartDiscovery would fail because the adapter is still - // powered off when the PropertiesChanged signal is emitted ... - connect(m_dbusProperties, &DBusProperties::PropertiesChanged, - this, &AdapterPrivate::propertiesChanged, Qt::QueuedConnection); - // Init properties m_address = properties.value(QStringLiteral("Address")).toString(); m_name = properties.value(QStringLiteral("Name")).toString(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/src/device_p.cpp new/bluez-qt-5.35.0/src/device_p.cpp --- old/bluez-qt-5.34.0/src/device_p.cpp 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/src/device_p.cpp 2017-06-03 10:44:33.000000000 +0200 @@ -58,10 +58,6 @@ m_dbusProperties = new DBusProperties(Strings::orgBluez(), m_bluezDevice->path(), DBusConnection::orgBluez(), this); - // QueuedConnection is important here - see AdapterPrivate::initProperties - connect(m_dbusProperties, &DBusProperties::PropertiesChanged, - this, &DevicePrivate::propertiesChanged, Qt::QueuedConnection); - // Init properties m_address = properties.value(QStringLiteral("Address")).toString(); m_name = properties.value(QStringLiteral("Name")).toString(); @@ -136,7 +132,11 @@ void DevicePrivate::propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated) { - if (interface != Strings::orgBluezDevice1()) { + if (interface == Strings::orgBluezInput1() && m_input) { + m_input->d->propertiesChanged(interface, changed, invalidated); + } else if (interface == Strings::orgBluezMediaPlayer1() && m_mediaPlayer) { + m_mediaPlayer->d->propertiesChanged(interface, changed, invalidated); + } else if (interface != Strings::orgBluezDevice1()) { return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/src/input.cpp new/bluez-qt-5.35.0/src/input.cpp --- old/bluez-qt-5.34.0/src/input.cpp 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/src/input.cpp 2017-06-03 10:44:33.000000000 +0200 @@ -25,11 +25,11 @@ #include "utils.h" #include "macros.h" +#include <QVariantMap> + namespace BluezQt { -typedef org::freedesktop::DBus::Properties DBusProperties; - static Input::ReconnectMode stringToReconnectMode(const QString &mode) { if (mode == QLatin1String("none")) { @@ -45,11 +45,7 @@ InputPrivate::InputPrivate(const QString &path, const QVariantMap &properties) : QObject() { - m_dbusProperties = new DBusProperties(Strings::orgBluez(), path, - DBusConnection::orgBluez(), this); - - connect(m_dbusProperties, &DBusProperties::PropertiesChanged, - this, &InputPrivate::propertiesChanged, Qt::QueuedConnection); + Q_UNUSED(path); // Init properties m_reconnectMode = stringToReconnectMode(properties.value(QStringLiteral("ReconnectMode")).toString()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/src/input_p.h new/bluez-qt-5.35.0/src/input_p.h --- old/bluez-qt-5.34.0/src/input_p.h 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/src/input_p.h 2017-06-03 10:44:33.000000000 +0200 @@ -26,13 +26,10 @@ #include <QObject> #include "input.h" -#include "dbusproperties.h" namespace BluezQt { -typedef org::freedesktop::DBus::Properties DBusProperties; - class InputPrivate : public QObject { Q_OBJECT @@ -43,7 +40,6 @@ void propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated); QWeakPointer<Input> q; - DBusProperties *m_dbusProperties; Input::ReconnectMode m_reconnectMode; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/src/manager_p.cpp new/bluez-qt-5.35.0/src/manager_p.cpp --- old/bluez-qt-5.34.0/src/manager_p.cpp 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/src/manager_p.cpp 2017-06-03 10:44:33.000000000 +0200 @@ -82,6 +82,13 @@ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(DBusConnection::orgBluez().asyncCall(call)); connect(watcher, &QDBusPendingCallWatcher::finished, this, &ManagerPrivate::nameHasOwnerFinished); + + DBusConnection::orgBluez().connect(Strings::orgBluez(), + QString(), + Strings::orgFreedesktopDBusProperties(), + QStringLiteral("PropertiesChanged"), + this, + SLOT(propertiesChanged(QString,QVariantMap,QStringList))); } void ManagerPrivate::nameHasOwnerFinished(QDBusPendingCallWatcher *watcher) @@ -424,6 +431,26 @@ } } +void ManagerPrivate::propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated) +{ + // Cut anything after device path to forward it to Device to handle + const QString path = message().path().section(QLatin1Char('/'), 0, 4); + + QTimer::singleShot(0, this, [=]() { + AdapterPtr adapter = m_adapters.value(path); + if (adapter) { + adapter->d->propertiesChanged(interface, changed, invalidated); + return; + } + DevicePtr device = m_devices.value(path); + if (device) { + device->d->propertiesChanged(interface, changed, invalidated); + return; + } + qCDebug(BLUEZQT) << "Unhandled property change" << interface << changed << invalidated; + }); +} + void ManagerPrivate::dummy() { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/src/manager_p.h new/bluez-qt-5.35.0/src/manager_p.h --- old/bluez-qt-5.34.0/src/manager_p.h 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/src/manager_p.h 2017-06-03 10:44:33.000000000 +0200 @@ -25,6 +25,7 @@ #include <QObject> #include <QHash> +#include <QDBusContext> #include "types.h" #include "rfkill.h" @@ -44,7 +45,7 @@ class Device; class AdapterPrivate; -class ManagerPrivate : public QObject +class ManagerPrivate : public QObject, protected QDBusContext { Q_OBJECT @@ -96,6 +97,7 @@ void initFinished(); private Q_SLOTS: + void propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated); void dummy(); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/src/mediaplayer_p.cpp new/bluez-qt-5.35.0/src/mediaplayer_p.cpp --- old/bluez-qt-5.34.0/src/mediaplayer_p.cpp 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/src/mediaplayer_p.cpp 2017-06-03 10:44:33.000000000 +0200 @@ -92,9 +92,6 @@ m_dbusProperties = new DBusProperties(Strings::orgBluez(), m_bluezMediaPlayer->path(), DBusConnection::orgBluez(), this); - connect(m_dbusProperties, &DBusProperties::PropertiesChanged, - this, &MediaPlayerPrivate::propertiesChanged, Qt::QueuedConnection); - // Init properties m_name = properties.value(QStringLiteral("Name")).toString(); m_equalizer = stringToEqualizer(properties.value(QStringLiteral("Equalizer")).toString()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/src/utils.cpp new/bluez-qt-5.35.0/src/utils.cpp --- old/bluez-qt-5.34.0/src/utils.cpp 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/src/utils.cpp 2017-06-03 10:44:33.000000000 +0200 @@ -39,6 +39,7 @@ bool testRun; QString orgFreedesktopDBus; + QString orgFreedesktopDBusProperties; QString orgBluez; QString orgBluezAdapter1; QString orgBluezDevice1; @@ -59,6 +60,7 @@ { testRun = false; orgFreedesktopDBus = QStringLiteral("org.freedesktop.DBus"); + orgFreedesktopDBusProperties = QStringLiteral("org.freedesktop.DBus.Properties"); orgBluez = QStringLiteral("org.bluez"); orgBluezAdapter1 = QStringLiteral("org.bluez.Adapter1"); orgBluezDevice1 = QStringLiteral("org.bluez.Device1"); @@ -88,6 +90,11 @@ return globalData->orgFreedesktopDBus; } +QString Strings::orgFreedesktopDBusProperties() +{ + return globalData->orgFreedesktopDBusProperties; +} + QString Strings::orgBluez() { return globalData->orgBluez; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-5.34.0/src/utils.h new/bluez-qt-5.35.0/src/utils.h --- old/bluez-qt-5.34.0/src/utils.h 2017-05-06 10:19:23.000000000 +0200 +++ new/bluez-qt-5.35.0/src/utils.h 2017-06-03 10:44:33.000000000 +0200 @@ -36,6 +36,7 @@ { QString orgFreedesktopDBus(); +QString orgFreedesktopDBusProperties(); QString orgBluez(); QString orgBluezAdapter1(); QString orgBluezDevice1();