Debian

Available patches from Ubuntu

To see Ubuntu differences wrt. to Debian, write down a grep-dctrl query identifying the packages you're interested in:
grep-dctrl -n -sPackage Sources.Debian
(e.g. -FPackage linux-ntfs or linux-ntfs)

Modified packages are listed below:

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: bluez-qt

bluez-qt (5.67.0-0ubuntu1) focal; urgency=medium * New upstream release (5.67.0) -- Rik Mills <rikmills@kde.org> Sat, 08 Feb 2020 09:47:42 +0000 bluez-qt (5.66.0-0ubuntu1) focal; urgency=medium * New upstream release (5.66.0) * Update symbols from build logs. -- Rik Mills <rikmills@kde.org> Sat, 11 Jan 2020 13:16:48 +0000 bluez-qt (5.65.0-0ubuntu1) focal; urgency=medium * New upstream release (5.65.0) -- José Manuel Santamaría Lema <panfaust@gmail.com> Sat, 14 Dec 2019 22:56:41 +0000 bluez-qt (5.64.0-0ubuntu1) focal; urgency=medium * New upstream release (5.63.0) * New upstream release (5.64.0) -- Rik Mills <rikmills@kde.org> Sat, 09 Nov 2019 21:22:15 +0000 bluez-qt (5.62.0-0ubuntu1) eoan; urgency=medium * New upstream release (5.62.0) -- Rik Mills <rikmills@kubuntu.org> Sat, 14 Sep 2019 08:04:41 +0100 bluez-qt (5.61.0-0ubuntu1) eoan; urgency=medium * New upstream release (5.61.0) * Delete upstream_dont_use_bluezqt_dbustypes_header.diff, applied upstream -- José Manuel Santamaría Lema <panfaust@gmail.com> Mon, 12 Aug 2019 10:40:15 +0100 bluez-qt (5.60.0-0ubuntu2) eoan; urgency=medium * Disable testsuite autopkgtest for any architecture except amd64. -- José Manuel Santamaría Lema <panfaust@gmail.com> Sun, 21 Jul 2019 06:52:19 +0100 bluez-qt (5.60.0-0ubuntu1) eoan; urgency=medium [ Rik Mills ] * Move qdebug categories file to new location. * New upstream release (5.60.0) * Update symbols from build logs. [ José Manuel Santamaría Lema ] * Add upstream_dont_use_bluezqt_dbustypes_header.diff * Update symbols file -- Rik Mills <rikmills@kubuntu.org> Sat, 20 Jul 2019 08:13:54 +0100 bluez-qt (5.59.0-0ubuntu1) eoan; urgency=medium * New upstream release (5.59.0) -- Rik Mills <rikmills@kubuntu.org> Wed, 12 Jun 2019 11:17:08 +0100 bluez-qt (5.58.0-0ubuntu1) eoan; urgency=medium * New upstream release (5.58.0) -- Rik Mills <rikmills@kubuntu.org> Mon, 13 May 2019 15:37:51 +0100 bluez-qt (5.57.0-0ubuntu1) eoan; urgency=medium * New upstream release (5.57.0) * Update symbols from build logs. -- Rik Mills <rikmills@kubuntu.org> Mon, 22 Apr 2019 08:39:56 +0100 bluez-qt (5.56.0-0ubuntu1) disco; urgency=medium * New upstream release (5.56.0) -- José Manuel Santamaría Lema <panfaust@gmail.com> Sat, 09 Mar 2019 16:33:56 +0000 bluez-qt (5.55.0-0ubuntu1) disco; urgency=medium * New upstream release (5.55.0) -- Rik Mills <rikmills@kubuntu.org> Wed, 13 Feb 2019 08:28:59 +0000 bluez-qt (5.54.0-0ubuntu1) disco; urgency=medium * New upstream release (5.54.0) -- Rik Mills <rikmills@kubuntu.org> Sun, 13 Jan 2019 12:33:17 +0000 bluez-qt (5.53.0-0ubuntu1) disco; urgency=medium * New upstream release (5.53.0) -- José Manuel Santamaría Lema <panfaust@gmail.com> Sun, 09 Dec 2018 20:47:11 +0000 bluez-qt (5.52.0-0ubuntu1) disco; urgency=medium [ Rik Mills ] * New upstream release (5.51.0) * Update symbols from build logs. [ José Manuel Santamaría Lema ] * New upstream release (5.52.0) -- José Manuel Santamaría Lema <panfaust@gmail.com> Thu, 22 Nov 2018 14:40:48 +0000 bluez-qt (5.50.0-0ubuntu1) cosmic; urgency=medium * New upstream release (5.50.0) -- Rik Mills <rikmills@kubuntu.org> Mon, 10 Sep 2018 22:11:11 +0100 bluez-qt (5.49.0-0ubuntu1) cosmic; urgency=medium [ Rik Mills ] * New upstream release (5.48.0) * Update symbols from build logs * New upstream release (5.49.0) [ José Manuel Santamaría Lema ] * Move away from dhmk and set compat level to 11 in order to reduce delta with Debian -- Rik Mills <rikmills@kubuntu.org> Tue, 21 Aug 2018 20:28:38 +0100 bluez-qt (5.47.0-0ubuntu2) cosmic; urgency=medium * Ignore tests on not x86 until next version -- Rik Mills <rikmills@kubuntu.org> Mon, 30 Jul 2018 15:00:36 +0100 bluez-qt (5.47.0-0ubuntu1) cosmic; urgency=medium * New upstream release (5.47.0) [ José Manuel Santamaría Lema ] * Merge with debian, notes: - keep using dhmk and debhelper compat level = 9, see: https://phabricator.kde.org/w/kubuntu/black-operations/pyramid/ -- Rik Mills <rikmills@kubuntu.org> Thu, 14 Jun 2018 15:47:18 +0100

Modifications :
  1. Download patch autotests/fakebluez/batteryinterface.cpp

    --- 5.62.0-1/autotests/fakebluez/batteryinterface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/autotests/fakebluez/batteryinterface.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2019 Kai Uwe Broulik <kde@broulik.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "batteryinterface.h" + +#include <QDBusConnection> + +// BatteryObject +BatteryObject::BatteryObject(const QDBusObjectPath &path, QObject *parent) + : QObject(parent) +{ + QDBusConnection::sessionBus().registerObject(path.path(), this); +} + +// BatteryInterface +BatteryInterface::BatteryInterface(const QDBusObjectPath &path, const QVariantMap &properties, QObject *parent) + : QDBusAbstractAdaptor(parent) +{ + setPath(path); + setObjectParent(parent); + setProperties(properties); + setName(QStringLiteral("org.bluez.Battery1")); +} + +uchar BatteryInterface::percentage() const +{ + return Object::property(QStringLiteral("Percentage")).value<uchar>(); +}
  2. Download patch src/obexobjectpush.h

    --- 5.62.0-1/src/obexobjectpush.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/obexobjectpush.h 2020-02-01 08:58:47.000000000 +0000 @@ -91,7 +91,7 @@ public: * * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed * - * @param targetFileName full path where the bussiness card will be saved + * @param targetFileName full path where the business card will be saved * @return ObexTransfer * pending call */ PendingCall *pullBusinessCard(const QString &targetFileName); @@ -111,7 +111,7 @@ public: * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed * * @param clientFileName full path to local business card - * @param targetFileName full path where the bussiness card will be saved + * @param targetFileName full path where the business card will be saved * @return ObexTransfer * pending call */ PendingCall *exchangeBusinessCards(const QString &clientFileName, const QString &targetFileName);
  3. Download patch src/mediatransport_p.cpp

    --- 5.62.0-1/src/mediatransport_p.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/mediatransport_p.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -139,17 +139,17 @@ void MediaTransportPrivate::onProperties if (key == QLatin1String("Volume")) { m_volume = value.toUInt(); - Q_EMIT q.data()->volumeChanged(m_volume); + Q_EMIT q.lock()->volumeChanged(m_volume); } else if (key == QLatin1String("State")) { m_state = stringToState(value.toString()); - Q_EMIT q.data()->stateChanged(m_state); + Q_EMIT q.lock()->stateChanged(m_state); } } for (const QString &property : invalidated) { if (property == QLatin1String("Volume")) { m_volume = 0; - Q_EMIT q.data()->volumeChanged(m_volume); + Q_EMIT q.lock()->volumeChanged(m_volume); } else if (property == QLatin1String("State")) { PROPERTY_INVALIDATED(m_state, MediaTransport::State::Idle, stateChanged); }
  4. Download patch debian/libkf5bluezqt6.symbols
  5. Download patch debian/tests/control

    --- 5.62.0-1/debian/tests/control 2019-09-20 17:12:49.000000000 +0000 +++ 5.67.0-0ubuntu1/debian/tests/control 2020-02-08 09:47:42.000000000 +0000 @@ -1,14 +1,9 @@ Tests: testsuite -Depends: build-essential, - dbus (>= 1.8), - openbox, - qml-module-qttest, - xauth, - xvfb, - @, - @builddeps@, +Depends: @, @builddeps@, build-essential, + xvfb, xauth, dbus (>= 1.8), openbox, + qml-module-qttest Restrictions: build-needed, allow-stderr Tests: acc -Depends: dh-acc, exuberant-ctags, @ +Depends: @, dh-acc, exuberant-ctags Restrictions: allow-stderr
  6. Download patch autotests/fakebluez/batteryinterface.h

    --- 5.62.0-1/autotests/fakebluez/batteryinterface.h 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/autotests/fakebluez/batteryinterface.h 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2019 Kai Uwe Broulik <kde@broulik.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef BATTERYINTERFACE_H +#define BATTERYINTERFACE_H + +#include "object.h" + +#include <QDBusAbstractAdaptor> + +class QDBusMessage; +class QDBusObjectPath; + +class BatteryObject : public QObject +{ +public: + explicit BatteryObject(const QDBusObjectPath &path, QObject *parent = nullptr); +}; + +class BatteryInterface : public QDBusAbstractAdaptor, public Object +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.bluez.Battery1") + Q_PROPERTY(uchar Percentage READ percentage) + +public: + explicit BatteryInterface(const QDBusObjectPath &path, const QVariantMap &properties, QObject *parent = nullptr); + + uchar percentage() const; +}; + +#endif // BATTERYINTERFACE_H
  7. Download patch src/imports/declarativebattery.cpp

    --- 5.62.0-1/src/imports/declarativebattery.cpp 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/src/imports/declarativebattery.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * BluezQt - Asynchronous BlueZ wrapper library + * + * Copyright (C) 2019 Kai Uwe Broulik <kde@broulik.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "declarativebattery.h" + +DeclarativeBattery::DeclarativeBattery(const BluezQt::BatteryPtr &battery, QObject *parent) + : QObject(parent) + , m_battery(battery) +{ + connect(m_battery.data(), &BluezQt::Battery::percentageChanged, this, &DeclarativeBattery::percentageChanged); +} + +int DeclarativeBattery::percentage() const +{ + return m_battery->percentage(); +}
  8. Download patch src/battery_p.h

    --- 5.62.0-1/src/battery_p.h 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/src/battery_p.h 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * BluezQt - Asynchronous Bluez wrapper library + * + * Copyright (C) 2019 Kai Uwe Broulik <kde@broulik.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef BLUEZQT_BATTERY_P_H +#define BLUEZQT_BATTERY_P_H + +#include <QObject> + +#include "battery.h" + +namespace BluezQt +{ + +class BatteryPrivate : public QObject +{ + Q_OBJECT + +public: + explicit BatteryPrivate(const QString &path, const QVariantMap &properties); + + void propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated); + + QWeakPointer<Battery> q; + + QString m_path; + int m_percentage = 0; +}; + +} // namespace BluezQt + +#endif // BLUEZQT_BATTERY_P_H
  9. Download patch src/battery.cpp

    --- 5.62.0-1/src/battery.cpp 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/src/battery.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * BluezQt - Asynchronous Bluez wrapper library + * + * Copyright (C) 2019 Kai Uwe Broulik <kde@broulik.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "battery.h" +#include "battery_p.h" +#include "utils.h" +#include "macros.h" + +#include <QVariantMap> + +namespace BluezQt +{ + +BatteryPrivate::BatteryPrivate(const QString &path, const QVariantMap &properties) + : QObject() + , m_path(path) +{ + // Init properties + m_percentage = properties.value(QStringLiteral("Percentage")).toInt(); +} + +void BatteryPrivate::propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated) +{ + Q_UNUSED(invalidated) + + if (interface != Strings::orgBluezBattery1()) { + return; + } + + QVariantMap::const_iterator i; + for (i = changed.constBegin(); i != changed.constEnd(); ++i) { + const QVariant &value = i.value(); + const QString &property = i.key(); + + if (property == QLatin1String("Percentage")) { + PROPERTY_CHANGED2(m_percentage, value.toInt(), percentageChanged) + } + } +} + +Battery::Battery(const QString &path, const QVariantMap &properties) + : d(new BatteryPrivate(path, properties)) +{ +} + +Battery::~Battery() +{ + delete d; +} + +BatteryPtr Battery::toSharedPtr() const +{ + return d->q.toStrongRef(); +} + +int Battery::percentage() const +{ + return d->m_percentage; +} + +} // namespace BluezQt
  10. Download patch autotests/fakebluez/CMakeLists.txt

    --- 5.62.0-1/autotests/fakebluez/CMakeLists.txt 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/autotests/fakebluez/CMakeLists.txt 2020-02-01 08:58:47.000000000 +0000 @@ -9,6 +9,7 @@ set(fakebluez_SRCS devicemanager.cpp adapterinterface.cpp deviceinterface.cpp + batteryinterface.cpp inputinterface.cpp mediaplayerinterface.cpp mediatransportinterface.cpp
  11. Download patch debian/libkf5bluezqt-dev.acc.in

    --- 5.62.0-1/debian/libkf5bluezqt-dev.acc.in 2019-09-20 17:12:49.000000000 +0000 +++ 5.67.0-0ubuntu1/debian/libkf5bluezqt-dev.acc.in 2020-02-08 09:47:42.000000000 +0000 @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version='1.0' encoding='utf-8'?> <descriptor> <version> @@ -17,6 +17,7 @@ <gcc_options> -fPIC -std=gnu++11 + -fno-keep-inline-functions </gcc_options> -</descriptor> +</descriptor> \ No newline at end of file
  12. Download patch src/device_p.h

    --- 5.62.0-1/src/device_p.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/device_p.h 2020-02-01 08:58:47.000000000 +0000 @@ -74,6 +74,7 @@ public: bool m_connected; QStringList m_uuids; QString m_modalias; + BatteryPtr m_battery; InputPtr m_input; MediaPlayerPtr m_mediaPlayer; MediaTransportPtr m_mediaTransport;
  13. Download patch src/device.cpp

    --- 5.62.0-1/src/device.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/device.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -164,6 +164,11 @@ QString Device::modalias() const return d->m_modalias; } +BatteryPtr Device::battery() const +{ + return d->m_battery; +} + InputPtr Device::input() const { return d->m_input;
  14. Download patch debian/control

    --- 5.62.0-1/debian/control 2019-09-20 17:12:49.000000000 +0000 +++ 5.67.0-0ubuntu1/debian/control 2020-02-08 09:47:42.000000000 +0000 @@ -3,22 +3,21 @@ Section: libs Priority: optional Maintainer: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org> Uploaders: Maximiliano Curia <maxy@debian.org> -Build-Depends: cmake (>= 3.5~), +Build-Depends: cmake (>= 3.0~), debhelper (>= 11~), doxygen, - extra-cmake-modules (>= 5.62.0~), + extra-cmake-modules (>= 5.67.0~), graphviz, libqt5sql5-sqlite, pkg-kde-tools (>> 0.15.15), qml-module-qttest, - qtbase5-dev (>= 5.11.0~), - qtdeclarative5-dev (>= 5.11.0~), - qttools5-dev, + qtbase5-dev (>= 5.8.0~), + qtdeclarative5-dev (>= 5.8.0~), qttools5-dev-tools, Standards-Version: 4.1.4 Homepage: https://projects.kde.org/projects/kde/workspace/bluez-qt -Vcs-Git: https://salsa.debian.org/qt-kde-team/kde/bluez-qt.git -Vcs-Browser: https://salsa.debian.org/qt-kde-team/kde/bluez-qt +Vcs-Browser: https://code.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/bluez-qt +Vcs-Git: https://git.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/bluez-qt Package: libkf5bluezqt-data Architecture: all @@ -32,10 +31,10 @@ Description: data files for bluez-qt This package contains the data files. Package: libkf5bluezqt-dev -Section: libdevel Architecture: linux-any +Section: libdevel Depends: libkf5bluezqt6 (= ${binary:Version}), - qtbase5-dev (>= 5.11.0~), + qtbase5-dev (>= 5.8.0~), ${misc:Depends}, Recommends: libkf5bluezqt-doc (= ${source:Version}) Description: development files for bluez-qt @@ -45,6 +44,7 @@ Description: development files for bluez Package: libkf5bluezqt-doc Architecture: all Multi-Arch: foreign +Section: doc Depends: ${misc:Depends}, ${shlibs:Depends} Description: documentation files for bluez-qt bluez-qt is a Qt-style library for accessing the bluez Bluetooth stack. @@ -52,15 +52,14 @@ Description: documentation files for blu It is used by the KDE Bluetooth stack, BlueDevil. . This package contains the qch documentation files. -Section: doc Package: libkf5bluezqt6 Architecture: linux-any Multi-Arch: same -Pre-Depends: ${misc:Pre-Depends} Depends: libkf5bluezqt-data (= ${source:Version}), ${misc:Depends}, ${shlibs:Depends}, +Pre-Depends: ${misc:Pre-Depends} Description: Qt wrapper for bluez bluez-qt is a Qt-style library for accessing the bluez Bluetooth stack. .
  15. Download patch src/adapter_p.cpp

    --- 5.62.0-1/src/adapter_p.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/adapter_p.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -75,21 +75,21 @@ void AdapterPrivate::interfacesAdded(con for (auto it = interfaces.cbegin(); it != interfaces.cend(); ++it) { if (it.key() == Strings::orgBluezMedia1()) { m_media = MediaPtr(new Media(path)); - Q_EMIT q.data()->mediaChanged(m_media); + Q_EMIT q.lock()->mediaChanged(m_media); changed = true; } else if (it.key() == Strings::orgBluezLEAdvertisingManager1()) { m_leAdvertisingManager = LEAdvertisingManagerPtr(new LEAdvertisingManager(path)); - Q_EMIT q.data()->leAdvertisingManagerChanged(m_leAdvertisingManager); + Q_EMIT q.lock()->leAdvertisingManagerChanged(m_leAdvertisingManager); changed = true; } else if (it.key() == Strings::orgBluezGattManager1()) { m_gattManager = GattManagerPtr(new GattManager(path)); - Q_EMIT q.data()->gattManagerChanged(m_gattManager); + Q_EMIT q.lock()->gattManagerChanged(m_gattManager); changed = true; } } if (changed) { - Q_EMIT q.data()->adapterChanged(q.toStrongRef()); + Q_EMIT q.lock()->adapterChanged(q.toStrongRef()); } } @@ -100,35 +100,35 @@ void AdapterPrivate::interfacesRemoved(c for (const QString &interface : interfaces) { if (interface == Strings::orgBluezMedia1() && m_media && m_media->d->m_path == path) { m_media.clear(); - Q_EMIT q.data()->mediaChanged(m_media); + Q_EMIT q.lock()->mediaChanged(m_media); changed = true; } else if (interface == Strings::orgBluezLEAdvertisingManager1() && m_leAdvertisingManager && m_leAdvertisingManager->d->m_path == path) { m_leAdvertisingManager.clear(); - Q_EMIT q.data()->leAdvertisingManagerChanged(m_leAdvertisingManager); + Q_EMIT q.lock()->leAdvertisingManagerChanged(m_leAdvertisingManager); changed = true; } } if (changed) { - Q_EMIT q.data()->adapterChanged(q.toStrongRef()); + Q_EMIT q.lock()->adapterChanged(q.toStrongRef()); } } void AdapterPrivate::addDevice(const DevicePtr &device) { m_devices.append(device); - Q_EMIT q.data()->deviceAdded(device); + Q_EMIT q.lock()->deviceAdded(device); - connect(device.data(), &Device::deviceChanged, q.data(), &Adapter::deviceChanged); + connect(device.data(), &Device::deviceChanged, q.lock().data(), &Adapter::deviceChanged); } void AdapterPrivate::removeDevice(const DevicePtr &device) { m_devices.removeOne(device); Q_EMIT device->deviceRemoved(device); - Q_EMIT q.data()->deviceRemoved(device); + Q_EMIT q.lock()->deviceRemoved(device); - disconnect(device.data(), &Device::deviceChanged, q.data(), &Adapter::deviceChanged); + disconnect(device.data(), &Device::deviceChanged, q.lock().data(), &Adapter::deviceChanged); } QDBusPendingReply<> AdapterPrivate::setDBusProperty(const QString &name, const QVariant &value) @@ -178,7 +178,7 @@ void AdapterPrivate::propertiesChanged(c } } - Q_EMIT q.data()->adapterChanged(q.toStrongRef()); + Q_EMIT q.lock()->adapterChanged(q.toStrongRef()); } } // namespace BluezQt
  16. Download patch src/device.h

    --- 5.62.0-1/src/device.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/device.h 2020-02-01 08:58:47.000000000 +0000 @@ -62,6 +62,7 @@ class BLUEZQT_EXPORT Device : public QOb Q_PROPERTY(bool connected READ isConnected NOTIFY connectedChanged) Q_PROPERTY(QStringList uuids READ uuids NOTIFY uuidsChanged) Q_PROPERTY(QString modalias READ modalias NOTIFY modaliasChanged) + Q_PROPERTY(BatteryPtr battery READ battery NOTIFY batteryChanged) Q_PROPERTY(InputPtr input READ input NOTIFY inputChanged) Q_PROPERTY(MediaPlayerPtr mediaPlayer READ mediaPlayer NOTIFY mediaPlayerChanged) Q_PROPERTY(MediaTransportPtr mediaTransport READ mediaTransport NOTIFY mediaTransportChanged) @@ -298,6 +299,14 @@ public: QString modalias() const; /** + * Returns the battery interface for the device. + * + * @return null if device has no battery + * @since 5.66 + */ + BatteryPtr battery() const; + + /** * Returns the input interface for the device. * * Only input devices will have valid input interface. @@ -410,7 +419,7 @@ public Q_SLOTS: /** * Cancels a pairing with the device. * - * This method can be used to cancel pairing operation inititated with pair(). + * This method can be used to cancel pairing operation initiated with pair(). * * Possible errors: PendingCall::DoesNotExist, PendingCall::Failed * @@ -510,6 +519,11 @@ Q_SIGNALS: void modaliasChanged(const QString &modalias); /** + * Indicates that device's battery has changed. + */ + void batteryChanged(BatteryPtr battery); + + /** * Indicates that device's input have changed. */ void inputChanged(InputPtr input);
  17. Download patch debian/libkf5bluezqt-data.maintscript

    --- 5.62.0-1/debian/libkf5bluezqt-data.maintscript 2019-09-20 17:12:49.000000000 +0000 +++ 5.67.0-0ubuntu1/debian/libkf5bluezqt-data.maintscript 2020-02-08 09:47:42.000000000 +0000 @@ -1 +1 @@ -rm_conffile /etc/xdg/bluez.categories 5.61.0-1~~ +rm_conffile /etc/xdg/bluez.categories
  18. Download patch tools/bluezapi2qt/Properties.cpp

    --- 5.62.0-1/tools/bluezapi2qt/Properties.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/tools/bluezapi2qt/Properties.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -22,7 +22,7 @@ #include "Properties.h" -#include <QRegExp> +#include <QRegularExpression> #include <QStringList> Properties::Properties() @@ -31,25 +31,25 @@ Properties::Properties() void Properties::parse(const QString &line) { - QRegExp rx(QStringLiteral( - "(?:Properties|^)" // Properties keyword or start of line - "\\t{1,2}" // preceding tabs (max 2) - "([a-z1-6{}_]+)" // type name - " " // space - "([A-Z]\\w+)" // method name - "(?: \\[(.*)\\])?" // tags - "(?: \\((.*)\\))?" // limitations - ), Qt::CaseSensitive, QRegExp::RegExp2); + const QRegularExpression rx(QStringLiteral( + "(?:Properties|^)" // Properties keyword or start of line + "\\t{1,2}" // preceding tabs (max 2) + "([a-z1-6{}_]+)" // type name + " " // space + "([A-Z]\\w+)" // method name + "(?: \\[(.*)\\])?" // tags + "(?: \\((.*)\\))?" // limitations + ), QRegularExpression::CaseInsensitiveOption); + QRegularExpressionMatch match = rx.match(line); // Check if we match a property - if (rx.indexIn(line) != -1) { - QStringList list = rx.capturedTexts(); + if (match.hasMatch()) { m_properties.emplace_back(Property()); m_currentProperty = &m_properties.back(); - m_currentProperty->m_type = list.at(1).toLower(); - m_currentProperty->m_name = list.at(2); - m_currentProperty->m_stringTags = list.at(3).toLower().split(QStringLiteral(", "), QString::SkipEmptyParts); - m_currentProperty->m_limitation = list.at(4).toLower(); + m_currentProperty->m_type = match.captured(1).toLower(); + m_currentProperty->m_name = match.captured(2); + m_currentProperty->m_stringTags = match.captured(3).toLower().split(QStringLiteral(", "), QString::SkipEmptyParts); + m_currentProperty->m_limitation = match.captured(4).toLower(); } else if (m_currentProperty) { // Skip first empty line if (line.isEmpty() && m_currentProperty->m_comment.isEmpty()) {
  19. Download patch CMakeLists.txt

    --- 5.62.0-1/CMakeLists.txt 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/CMakeLists.txt 2020-02-01 08:58:47.000000000 +0000 @@ -1,26 +1,29 @@ cmake_minimum_required(VERSION 3.5) -set(KF5_VERSION "5.62.0") # handled by release scripts +set(KF5_VERSION "5.67.0") # handled by release scripts project(BluezQt VERSION ${KF5_VERSION}) include(FeatureSummary) -find_package(ECM 5.62.0 NO_MODULE) -set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") +find_package(ECM 5.67.0 NO_MODULE) +set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) +include(KDEInstallDirs) +include(KDECMakeSettings) +include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) + include(FeatureSummary) -include(GenerateExportHeader) +include(ECMGenerateExportHeader) include(ECMSetupVersion) include(ECMGenerateHeaders) include(ECMAddQch) include(CMakePackageConfigHelpers) -include(KDEInstallDirs) -include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) -include(KDECMakeSettings) include(ECMQtDeclareLoggingCategory) +set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") + option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") @@ -32,7 +35,7 @@ ecm_setup_version(PROJECT ) # Dependencies -set(REQUIRED_QT_VERSION 5.11.0) +set(REQUIRED_QT_VERSION 5.12.0) # Required Qt5 components to build this framework find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core DBus Network) @@ -44,7 +47,7 @@ find_package(Qt5Qml ${REQUIRED_QT_VERSIO set_package_properties(Qt5Qml PROPERTIES DESCRIPTION "QML support for BluezQt" TYPE OPTIONAL) find_package(Qt5QuickTest ${REQUIRED_QT_VERSION} CONFIG) set_package_properties(Qt5QuickTest PROPERTIES DESCRIPTION "QML autotests for BluezQt" TYPE OPTIONAL) -#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000) +add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00) add_definitions(-DQT_NO_FOREACH) # Subdirectories add_subdirectory(src)
  20. Download patch autotests/autotests.cpp

    --- 5.62.0-1/autotests/autotests.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/autotests/autotests.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -21,6 +21,7 @@ #include "autotests.h" #include "device.h" #include "adapter.h" +#include "battery.h" #include "mediaplayer.h" #include "mediaplayertrack.h" #include "mediatransport.h" @@ -176,6 +177,7 @@ void Autotests::registerMetatypes() { qRegisterMetaType<BluezQt::DevicePtr>("DevicePtr"); qRegisterMetaType<BluezQt::AdapterPtr>("AdapterPtr"); + qRegisterMetaType<BluezQt::BatteryPtr>("BatteryPtr"); qRegisterMetaType<BluezQt::MediaPlayerPtr>("MediaPlayerPtr"); qRegisterMetaType<BluezQt::MediaTransportPtr>("MediaTransportPtr"); }
  21. Download patch src/macros.h

    --- 5.62.0-1/src/macros.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/macros.h 2020-02-01 08:58:47.000000000 +0000 @@ -27,21 +27,21 @@ #define PROPERTY_CHANGED(var, type_cast, signal) \ if (var != value.type_cast()) { \ var = value.type_cast(); \ - Q_EMIT q.data()->signal(var); \ + Q_EMIT q.lock()->signal(var); \ } #define PROPERTY_CHANGED2(var, value, signal) \ const auto &val = value; \ if (var != val) { \ var = val; \ - Q_EMIT q.data()->signal(var); \ + Q_EMIT q.lock()->signal(var); \ } // Clears property value and emit propertyChanged signal #define PROPERTY_INVALIDATED(var, empty, signal) \ if (var != empty) { \ var = empty; \ - Q_EMIT q.data()->signal(var); \ + Q_EMIT q.lock()->signal(var); \ } #endif // BLUEZQT_MACROS_H
  22. Download patch src/battery.h

    --- 5.62.0-1/src/battery.h 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/src/battery.h 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,83 @@ +/* + * BluezQt - Asynchronous BlueZ wrapper library + * + * Copyright (C) 2019 Kai Uwe Broulik <kde@broulik.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef BLUEZQT_BATTERY_H +#define BLUEZQT_BATTERY_H + +#include <QObject> + +#include "types.h" +#include "bluezqt_export.h" + +namespace BluezQt +{ + +/** + * @class BluezQt::Battery battery.h <BluezQt/Battery> + * + * %Device battery. + * + * This class represents a battery interface. + */ +class BLUEZQT_EXPORT Battery : public QObject +{ + Q_OBJECT + Q_PROPERTY(int percentage READ percentage NOTIFY percentageChanged) + +public: + /** + * Destroys a Battery object. + */ + ~Battery(); + + /** + * Returns a shared pointer from this. + * + * @return BatteryPtr + */ + BatteryPtr toSharedPtr() const; + + /** + * Returns the battery percentage. + * + * @return battery percentage + */ + int percentage() const; + +Q_SIGNALS: + /** + * Indicates that battery's percentage has changed. + */ + void percentageChanged(int percentage); + +private: + explicit Battery(const QString &path, const QVariantMap &properties); + + class BatteryPrivate *const d; + + friend class BatteryPrivate; + friend class DevicePrivate; +}; + +} // namespace BluezQt + +#endif // BLUEZQT_BATTERY_H
  23. Download patch src/job.h

    --- 5.62.0-1/src/job.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/job.h 2020-02-01 08:58:47.000000000 +0000 @@ -102,7 +102,7 @@ public: * called, which usually wreaks havoc. * * Note that the event loop started by this method does not process user input events, which means - * your user interface will effectivly be blocked. Other events like paint or network events are + * your user interface will effectively be blocked. Other events like paint or network events are * still being processed. The advantage of not processing user input events is that the chance of * accidental reentrancy is greatly reduced. Still you should avoid calling this function. *
  24. Download patch src/manager.h

    --- 5.62.0-1/src/manager.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/manager.h 2020-02-01 08:58:47.000000000 +0000 @@ -297,13 +297,16 @@ public: */ PendingCall *unregisterProfile(Profile *profile); +#if BLUEZQT_ENABLE_DEPRECATED_SINCE(5, 57) /** * Returns the media interface. * - * @deprecated since 5.57, use Adapter::media() instead. * @return media + * @deprecated since 5.57, use Adapter::media() instead. */ - BLUEZQT_DEPRECATED MediaPtr media() const; // KF6 TODO: Remove + BLUEZQT_DEPRECATED_VERSION(5, 57, "Use Adapter::media()") + MediaPtr media() const; +#endif Q_SIGNALS: /**
  25. Download patch src/imports/declarativebattery.h

    --- 5.62.0-1/src/imports/declarativebattery.h 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/src/imports/declarativebattery.h 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * BluezQt - Asynchronous BlueZ wrapper library + * + * Copyright (C) 2019 Kai Uwe Broulik <kde@broulik.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef DECLARATIVEBATTERY_H +#define DECLARATIVEBATTERY_H + +#include "battery.h" + +class DeclarativeBattery : public QObject +{ + Q_OBJECT + Q_PROPERTY(int percentage READ percentage NOTIFY percentageChanged) + +public: + explicit DeclarativeBattery(const BluezQt::BatteryPtr &battery, QObject *parent = nullptr); + + int percentage() const; + +Q_SIGNALS: + void percentageChanged(int percentage); + +private: + BluezQt::BatteryPtr m_battery; +}; + +#endif // DECLARATIVEBATTERY_H
  26. Download patch tools/bluezapi2qt/Method.cpp

    --- 5.62.0-1/tools/bluezapi2qt/Method.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/tools/bluezapi2qt/Method.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -20,6 +20,8 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ +#include <QRegularExpression> + #include "Method.h" Method::Method() @@ -101,11 +103,11 @@ QString Method::guessOutParameterName() return QString(); } - QRegExp rx(QStringLiteral("([A-Z][a-z0-9]+)+")); - if (rx.indexIn(m_name, 1) == -1) { + const QRegularExpression rx(QStringLiteral("([A-Z][a-z0-9]+)+")); + QRegularExpressionMatch match = rx.match(m_name, 1); + if (!match.hasMatch()) { return QStringLiteral("value"); } - QStringList list = rx.capturedTexts(); - return list.last().toLower(); + return match.captured().toLower(); }
  27. Download patch tests/mediaendpointconnector.cpp

    --- 5.62.0-1/tests/mediaendpointconnector.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/tests/mediaendpointconnector.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -126,7 +126,7 @@ void MediaEndpointConnector::onServiceAu void MediaEndpointConnector::onConfigurationSelected(const QByteArray &capabilities, const QByteArray &configuration) { if (configuration.isEmpty()) { - qDebug() << "No useable configuration found for capabilities:" << capabilities; + qDebug() << "No usable configuration found for capabilities:" << capabilities; } else { qDebug() << "Selected configuration:" << configuration << "for capabilities:" << capabilities; }
  28. Download patch src/utils.h

    --- 5.62.0-1/src/utils.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/utils.h 2020-02-01 08:58:47.000000000 +0000 @@ -39,6 +39,7 @@ QString orgFreedesktopDBus(); QString orgFreedesktopDBusProperties(); QString orgBluez(); QString orgBluezAdapter1(); +QString orgBluezBattery1(); QString orgBluezDevice1(); QString orgBluezInput1(); QString orgBluezGattManager1();
  29. Download patch src/obextransfer.cpp

    --- 5.62.0-1/src/obextransfer.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/obextransfer.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -115,7 +115,7 @@ void ObexTransferPrivate::sessionRemoved // Change status to Error if org.bluez.obex crashes if (m_status != ObexTransfer::Complete && m_status != ObexTransfer::Error) { m_status = ObexTransfer::Error; - Q_EMIT q.data()->statusChanged(m_status); + Q_EMIT q.lock()->statusChanged(m_status); } }
  30. Download patch autotests/interfaces/org.bluez.Battery1.xml

    --- 5.62.0-1/autotests/interfaces/org.bluez.Battery1.xml 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/autotests/interfaces/org.bluez.Battery1.xml 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,7 @@ +<?xml version="1.0"?> +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="org.bluez.Battery1"> + <property name="Percentage" type="y" access="read"/> + </interface> +</node>
  31. Download patch tools/bluezapi2qt/Interface.cpp

    --- 5.62.0-1/tools/bluezapi2qt/Interface.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/tools/bluezapi2qt/Interface.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -22,6 +22,8 @@ #include "Interface.h" +#include <QRegularExpression> + Interface::Interface() { } @@ -123,25 +125,28 @@ void Interface::parseComment(const QStri void Interface::parseService(const QString &line) { - QRegExp rx(QStringLiteral("Service\\t+(.+)"), Qt::CaseSensitive, QRegExp::RegExp2); - if (rx.indexIn(line) != -1) { - m_service = rx.capturedTexts().last(); + const QRegularExpression rx(QStringLiteral("Service\\t+(.+)")); + QRegularExpressionMatch match = rx.match(line); + if (match.hasMatch()) { + m_service = match.captured(); } } void Interface::parseInterface(const QString &line) { - QRegExp rx(QStringLiteral("Interface\\t+(.+)"), Qt::CaseSensitive, QRegExp::RegExp2); - if (rx.indexIn(line) != -1) { - m_name = rx.capturedTexts().last(); + const QRegularExpression rx(QStringLiteral("Interface\\t+(.+)")); + QRegularExpressionMatch match = rx.match(line); + if (match.hasMatch()) { + m_name = match.captured(); } } void Interface::parseObjectPath(const QString &line) { - QRegExp rx(QStringLiteral("Object path\\t+(.+)"), Qt::CaseSensitive, QRegExp::RegExp2); - if (rx.indexIn(line) != -1) { - m_objectPath = rx.capturedTexts().last(); + const QRegularExpression rx(QStringLiteral("Object path\\t+(.+)")); + QRegularExpressionMatch match = rx.match(line); + if (match.hasMatch()) { + m_objectPath = match.captured(); } }
  32. Download patch src/imports/CMakeLists.txt

    --- 5.62.0-1/src/imports/CMakeLists.txt 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/imports/CMakeLists.txt 2020-02-01 08:58:47.000000000 +0000 @@ -1,6 +1,7 @@ set(bluezqtextensionplugin_SRCS declarativemanager.cpp declarativeadapter.cpp + declarativebattery.cpp declarativedevice.cpp declarativeinput.cpp declarativemediaplayer.cpp
  33. Download patch debian/tests/testsuite

    --- 5.62.0-1/debian/tests/testsuite 2019-09-20 17:12:49.000000000 +0000 +++ 5.67.0-0ubuntu1/debian/tests/testsuite 2020-02-08 09:47:42.000000000 +0000 @@ -1,5 +1,8 @@ #!/bin/sh +DEB_TARGET_ARCH=$(dpkg-architecture -qDEB_TARGET_ARCH) +if [ $DEB_TARGET_ARCH != 'amd64' ]; then exit 0; fi + [ -e debian/tests.home ] || mkdir debian/tests.home export HOME="$(pwd)/debian/tests.home" mkdir -p "$HOME"/.config || true
  34. Download patch debian/salsa-ci.yml

    --- 5.62.0-1/debian/salsa-ci.yml 2019-09-20 17:12:49.000000000 +0000 +++ 5.67.0-0ubuntu1/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -include: - - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml - - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml -variables: - SALSA_CI_DISABLE_MISSING_BREAKS: 'no' - SALSA_CI_DISABLE_RC_BUGS: 'no' - SALSA_CI_REPROTEST_ARGS: '--variations=-build-path'
  35. Download patch tools/bluezapi2qt/Methods.cpp

    --- 5.62.0-1/tools/bluezapi2qt/Methods.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/tools/bluezapi2qt/Methods.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -23,6 +23,16 @@ #include "Methods.h" #include <QStringList> +#include <QRegularExpression> + +static const QRegularExpression rx(QStringLiteral( + "\\t+" // preceding tabs + "(?:(.+) )?" // return types - Argh! LE Advertising Manager does not specify return type + "([A-Z]\\w+)" // method name + "\\(([^\\)]*)\\)" // parameters + "(?: \\[(.*)\\])?" // tags + "(?: \\((.*)\\))?" // limitations + ), QRegularExpression::CaseInsensitiveOption); Methods::Methods() { @@ -30,40 +40,22 @@ Methods::Methods() bool Methods::isMethod(const QString &line) { - QRegExp rx(QStringLiteral( - "\\t+" // preceding tabs - "(?:(.+) )?" // return types - Argh! LE Advertising Manager does not specify return type - "([A-Z]\\w+)" // method name - "\\(([^\\)]*)\\)" // parameters - "(?: \\[(.*)\\])?" // tags - "(?: \\((.*)\\))?" // limitations - ), Qt::CaseInsensitive, QRegExp::RegExp2); - // Check if we match a method - return (rx.indexIn(line) != -1); + return (rx.match(line).hasMatch()); } void Methods::parse(const QString &line) { - QRegExp rx(QStringLiteral( - "\\t+" // preceding tabs - "(?:(.+) )?" // return types - Argh! LE Advertising Manager does not specify return type - "([A-Z]\\w+)" // method name - "\\(([^\\)]*)\\)" // parameters - "(?: \\[(.*)\\])?" // tags - "(?: \\((.*)\\))?" // limitations - ), Qt::CaseInsensitive, QRegExp::RegExp2); - // Check if we match a method - if (rx.indexIn(line) != -1) { - QStringList list = rx.capturedTexts(); + QRegularExpressionMatch match = rx.match(line); + if (match.hasMatch()) { m_methods.emplace_back(Method()); m_currentMethod = &m_methods.back(); - m_currentMethod->m_outParameterStrings = list.at(1).toLower().split(QStringLiteral(", "), QString::SkipEmptyParts); - m_currentMethod->m_name = list.at(2); - m_currentMethod->m_inParameterStrings = list.at(3).split(QStringLiteral(", "), QString::SkipEmptyParts); - m_currentMethod->m_stringTags = list.at(4).toLower().split(QStringLiteral(", "), QString::SkipEmptyParts); - m_currentMethod->m_limitation = list.at(5).toLower(); + m_currentMethod->m_outParameterStrings = match.captured(1).toLower().split(QStringLiteral(", "), QString::SkipEmptyParts); + m_currentMethod->m_name = match.captured(2); + m_currentMethod->m_inParameterStrings = match.captured(3).split(QStringLiteral(", "), QString::SkipEmptyParts); + m_currentMethod->m_stringTags = match.captured(4).toLower().split(QStringLiteral(", "), QString::SkipEmptyParts); + m_currentMethod->m_limitation = match.captured(5).toLower(); } else if (m_currentMethod) { // Skip first empty line if (line.isEmpty() && m_currentMethod->m_comment.isEmpty()) {
  36. Download patch src/obextransfer.h

    --- 5.62.0-1/src/obextransfer.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/obextransfer.h 2020-02-01 08:58:47.000000000 +0000 @@ -66,7 +66,7 @@ public: Active, /** Indicates that the transfer is suspended. */ Suspended, - /** Indicates that the transfer have completed successfuly. */ + /** Indicates that the transfer have completed successfully. */ Complete, /** Indicates that the transfer have failed with error. */ Error,
  37. Download patch src/imports/declarativedevicesmodel.h

    --- 5.62.0-1/src/imports/declarativedevicesmodel.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/imports/declarativedevicesmodel.h 2020-02-01 08:58:47.000000000 +0000 @@ -38,7 +38,8 @@ public: enum DeclarativeDeviceRoles { DeviceRole = BluezQt::DevicesModel::LastRole + 1, AdapterRole = BluezQt::DevicesModel::LastRole + 2, - MediaPlayerRole = BluezQt::DevicesModel::LastRole + 3 + MediaPlayerRole = BluezQt::DevicesModel::LastRole + 3, + BatteryRole = BluezQt::DevicesModel::LastRole + 4 }; explicit DeclarativeDevicesModel(QObject *parent = nullptr);
  38. Download patch tools/bluezapi2qt/XmlGenerator.cpp

    --- 5.62.0-1/tools/bluezapi2qt/XmlGenerator.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/tools/bluezapi2qt/XmlGenerator.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -76,24 +76,24 @@ bool XmlGenerator::generate(const BluezA void XmlGenerator::writeHeader(QTextStream &stream) { - stream << "<?xml version=\"1.0\"?>" << endl; - stream << "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\" \"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">" << endl; - stream << "<node>" << endl; + stream << "<?xml version=\"1.0\"?>\n"; + stream << "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\" \"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n"; + stream << "<node>\n"; } void XmlGenerator::writeFooter(QTextStream &stream) { - stream << "</node>" << endl; + stream << "</node>\n"; } void XmlGenerator::writeInterface(QTextStream &stream, const QString &name) { - stream << " <interface name=\"" << name << "\">" << endl; + stream << " <interface name=\"" << name << "\">\n"; } void XmlGenerator::closeInterface(QTextStream &stream) { - stream << " </interface>" << endl; + stream << " </interface>\n"; } bool XmlGenerator::writeMethod(QTextStream &stream, const Method &method) @@ -102,11 +102,11 @@ bool XmlGenerator::writeMethod(QTextStre // Some beautification if (method.inParameters().empty() && method.outParameters().empty()) { - stream << "/>" << endl; + stream << "/>\n"; return true; } - stream << ">" << endl; + stream << ">\n"; for (const auto &param : method.inParameters()) { if (!writeArg(stream, param, QStringLiteral("in"))) { @@ -125,7 +125,7 @@ bool XmlGenerator::writeMethod(QTextStre writeAnnotation(stream, method.outParameters().at(i), QStringLiteral("Out"), i); } - stream << " </method>" << endl; + stream << " </method>\n"; return true; } @@ -137,7 +137,7 @@ bool XmlGenerator::writeArg(QTextStream return false; } stream << " <arg name=\"" << param.name() << "\" type=\"" << dbusType << - "\" direction=\"" << dir << "\"/>" << endl; + "\" direction=\"" << dir << "\"/>\n"; return true; } @@ -149,7 +149,7 @@ void XmlGenerator::writeAnnotation(QText return; } stream << " <annotation name=\"org.qtproject.QtDBus.QtTypeName." << dir << - QString::number(i) << "\" value=\"" << qtType << "\"/>" << endl; + QString::number(i) << "\" value=\"" << qtType << "\"/>\n"; return; }
  39. Download patch autotests/fakebluez/deviceinterface.cpp

    --- 5.62.0-1/autotests/fakebluez/deviceinterface.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/autotests/fakebluez/deviceinterface.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -20,6 +20,7 @@ #include "deviceinterface.h" #include "objectmanager.h" +#include "batteryinterface.h" #include "mediaplayerinterface.h" #include "mediatransportinterface.h" #include "inputinterface.h" @@ -50,6 +51,19 @@ DeviceInterface::DeviceInterface(const Q // Alias needs special handling setAlias(properties.value(QStringLiteral("Alias")).toString()); + // Create Battery1 + if (properties.contains(QStringLiteral("Battery"))) { + const QVariantMap &inputProps = qdbus_cast<QVariantMap>(properties.value(QStringLiteral("Battery"))); + BatteryInterface *input = new BatteryInterface(path, inputProps, parent); + + ObjectManager *manager = ObjectManager::self(); + manager->addObject(input); + + QVariantMap props = properties; + props.remove(QStringLiteral("Battery")); + setProperties(props); + } + // Create Input1 if (properties.contains(QStringLiteral("Input"))) { const QVariantMap &inputProps = qdbus_cast<QVariantMap>(properties.value(QStringLiteral("Input")));
  40. Download patch src/mediaplayer_p.cpp

    --- 5.62.0-1/src/mediaplayer_p.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/mediaplayer_p.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -133,7 +133,7 @@ void MediaPlayerPrivate::propertiesChang PROPERTY_CHANGED(m_position, toUInt, positionChanged); } else if (property == QLatin1String("Track")) { m_track = variantToTrack(value); - Q_EMIT q.data()->trackChanged(m_track); + Q_EMIT q.lock()->trackChanged(m_track); } } @@ -152,7 +152,7 @@ void MediaPlayerPrivate::propertiesChang PROPERTY_INVALIDATED(m_position, 0, positionChanged); } else if (property == QLatin1String("Track")) { m_track = variantToTrack(QVariant()); - Q_EMIT q.data()->trackChanged(m_track); + Q_EMIT q.lock()->trackChanged(m_track); } } }
  41. Download patch src/imports/declarativedevicesmodel.cpp

    --- 5.62.0-1/src/imports/declarativedevicesmodel.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/imports/declarativedevicesmodel.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -23,6 +23,7 @@ #include "declarativedevicesmodel.h" #include "declarativemanager.h" #include "declarativeadapter.h" +#include "declarativebattery.h" #include "declarativedevice.h" #include "declarativemediaplayer.h" @@ -52,6 +53,7 @@ QHash<int, QByteArray> DeclarativeDevice roles[DeviceRole] = QByteArrayLiteral("Device"); roles[AdapterRole] = QByteArrayLiteral("Adapter"); roles[MediaPlayerRole] = QByteArrayLiteral("MediaPlayer"); + roles[BatteryRole] = QByteArrayLiteral("Battery"); return roles; } @@ -76,9 +78,13 @@ QVariant DeclarativeDevicesModel::data(c if (DeclarativeDevice *device = m_manager->declarativeDeviceFromPtr(dev)) { return QVariant::fromValue(device->mediaPlayer()); } - // fallthrough - Q_FALLTHROUGH(); - default: - return QSortFilterProxyModel::data(index, role); + break; + case BatteryRole: + if (DeclarativeDevice *device = m_manager->declarativeDeviceFromPtr(dev)) { + return QVariant::fromValue(device->battery()); + } + break; } + + return QSortFilterProxyModel::data(index, role); }
  42. Download patch src/device_p.cpp

    --- 5.62.0-1/src/device_p.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/device_p.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -23,6 +23,8 @@ #include "device_p.h" #include "device.h" #include "adapter.h" +#include "battery.h" +#include "battery_p.h" #include "input.h" #include "input_p.h" #include "mediaplayer.h" @@ -87,26 +89,31 @@ void DevicePrivate::interfacesAdded(cons QVariantMapMap::const_iterator it; for (it = interfaces.constBegin(); it != interfaces.constEnd(); ++it) { - if (it.key() == Strings::orgBluezInput1()) { + if (it.key() == Strings::orgBluezBattery1()) { + m_battery = BatteryPtr(new Battery(path, it.value())); + m_battery->d->q = m_battery.toWeakRef(); + Q_EMIT q.lock()->batteryChanged(m_battery); + changed = true; + } else if (it.key() == Strings::orgBluezInput1()) { m_input = InputPtr(new Input(path, it.value())); m_input->d->q = m_input.toWeakRef(); - Q_EMIT q.data()->inputChanged(m_input); + Q_EMIT q.lock()->inputChanged(m_input); changed = true; } else if (it.key() == Strings::orgBluezMediaPlayer1()) { m_mediaPlayer = MediaPlayerPtr(new MediaPlayer(path, it.value())); m_mediaPlayer->d->q = m_mediaPlayer.toWeakRef(); - Q_EMIT q.data()->mediaPlayerChanged(m_mediaPlayer); + Q_EMIT q.lock()->mediaPlayerChanged(m_mediaPlayer); changed = true; } else if (it.key() == Strings::orgBluezMediaTransport1()) { m_mediaTransport = MediaTransportPtr(new MediaTransport(path, it.value())); m_mediaTransport->d->q = m_mediaTransport.toWeakRef(); - Q_EMIT q.data()->mediaTransportChanged(m_mediaTransport); + Q_EMIT q.lock()->mediaTransportChanged(m_mediaTransport); changed = true; } } if (changed) { - Q_EMIT q.data()->deviceChanged(q.toStrongRef()); + Q_EMIT q.lock()->deviceChanged(q.toStrongRef()); } } @@ -115,23 +122,27 @@ void DevicePrivate::interfacesRemoved(co bool changed = false; for (const QString &interface : interfaces) { - if (interface == Strings::orgBluezInput1() && m_input && m_input->d->m_path == path) { + if (interface == Strings::orgBluezBattery1() && m_battery && m_battery->d->m_path == path) { + m_battery.clear(); + Q_EMIT q.lock()->batteryChanged(m_battery); + changed = true; + } else if (interface == Strings::orgBluezInput1() && m_input && m_input->d->m_path == path) { m_input.clear(); - Q_EMIT q.data()->inputChanged(m_input); + Q_EMIT q.lock()->inputChanged(m_input); changed = true; } else if (interface == Strings::orgBluezMediaPlayer1() && m_mediaPlayer && m_mediaPlayer->d->m_path == path) { m_mediaPlayer.clear(); - Q_EMIT q.data()->mediaPlayerChanged(m_mediaPlayer); + Q_EMIT q.lock()->mediaPlayerChanged(m_mediaPlayer); changed = true; } else if (interface == Strings::orgBluezMediaTransport1() && m_mediaTransport && m_mediaTransport->d->m_path == path) { m_mediaTransport.clear(); - Q_EMIT q.data()->mediaTransportChanged(m_mediaTransport); + Q_EMIT q.lock()->mediaTransportChanged(m_mediaTransport); changed = true; } } if (changed) { - Q_EMIT q.data()->deviceChanged(q.toStrongRef()); + Q_EMIT q.lock()->deviceChanged(q.toStrongRef()); } } @@ -142,7 +153,9 @@ QDBusPendingReply<> DevicePrivate::setDB void DevicePrivate::propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated) { - if (interface == Strings::orgBluezInput1() && m_input) { + if (interface == Strings::orgBluezBattery1() && m_battery) { + m_battery->d->propertiesChanged(interface, changed, invalidated); + } else 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); @@ -204,15 +217,15 @@ void DevicePrivate::propertiesChanged(co } } - Q_EMIT q.data()->deviceChanged(q.toStrongRef()); + Q_EMIT q.lock()->deviceChanged(q.toStrongRef()); } void DevicePrivate::namePropertyChanged(const QString &value) { if (m_name != value) { m_name = value; - Q_EMIT q.data()->remoteNameChanged(m_name); - Q_EMIT q.data()->friendlyNameChanged(q.data()->friendlyName()); + Q_EMIT q.lock()->remoteNameChanged(m_name); + Q_EMIT q.lock()->friendlyNameChanged(q.lock()->friendlyName()); } } @@ -220,7 +233,7 @@ void DevicePrivate::addressPropertyChang { if (m_address != value) { m_address = value; - Q_EMIT q.data()->addressChanged(m_address); + Q_EMIT q.lock()->addressChanged(m_address); } } @@ -228,8 +241,8 @@ void DevicePrivate::aliasPropertyChanged { if (m_alias != value) { m_alias = value; - Q_EMIT q.data()->nameChanged(m_alias); - Q_EMIT q.data()->friendlyNameChanged(q.data()->friendlyName()); + Q_EMIT q.lock()->nameChanged(m_alias); + Q_EMIT q.lock()->friendlyNameChanged(q.lock()->friendlyName()); } } @@ -237,8 +250,8 @@ void DevicePrivate::classPropertyChanged { if (m_deviceClass != value) { m_deviceClass = value; - Q_EMIT q.data()->deviceClassChanged(m_deviceClass); - Q_EMIT q.data()->typeChanged(q.data()->type()); + Q_EMIT q.lock()->deviceClassChanged(m_deviceClass); + Q_EMIT q.lock()->typeChanged(q.lock()->type()); } }
  43. Download patch src/mediaplayer.h

    --- 5.62.0-1/src/mediaplayer.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/mediaplayer.h 2020-02-01 08:58:47.000000000 +0000 @@ -182,7 +182,7 @@ public: MediaPlayerTrack track() const; /** - * Returns the playback position in miliseconds. + * Returns the playback position in milliseconds. * * @return playback position */
  44. Download patch src/manager.cpp

    --- 5.62.0-1/src/manager.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/manager.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -246,9 +246,11 @@ PendingCall *Manager::unregisterProfile( PendingCall::ReturnVoid, this); } +#if BLUEZQT_BUILD_DEPRECATED_SINCE(5, 57) MediaPtr Manager::media() const { return usableAdapter() ? usableAdapter()->media() : nullptr; } +#endif } // namespace BluezQt
  45. Download patch src/utils.cpp

    --- 5.62.0-1/src/utils.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/utils.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -42,6 +42,7 @@ public: QString orgFreedesktopDBusProperties; QString orgBluez; QString orgBluezAdapter1; + QString orgBluezBattery1; QString orgBluezDevice1; QString orgBluezInput1; QString orgBluezGattManager1; @@ -67,6 +68,7 @@ GlobalData::GlobalData() orgFreedesktopDBusProperties = QStringLiteral("org.freedesktop.DBus.Properties"); orgBluez = QStringLiteral("org.bluez"); orgBluezAdapter1 = QStringLiteral("org.bluez.Adapter1"); + orgBluezBattery1 = QStringLiteral("org.bluez.Battery1"); orgBluezDevice1 = QStringLiteral("org.bluez.Device1"); orgBluezInput1 = QStringLiteral("org.bluez.Input1"); orgBluezGattManager1 = QStringLiteral("org.bluez.GattManager1"); @@ -113,6 +115,11 @@ QString Strings::orgBluezAdapter1() return globalData->orgBluezAdapter1; } +QString Strings::orgBluezBattery1() +{ + return globalData->orgBluezBattery1; +} + QString Strings::orgBluezDevice1() { return globalData->orgBluezDevice1;
  46. Download patch src/imports/declarativedevice.h

    --- 5.62.0-1/src/imports/declarativedevice.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/imports/declarativedevice.h 2020-02-01 08:58:47.000000000 +0000 @@ -26,6 +26,7 @@ #include "device.h" class DeclarativeAdapter; +class DeclarativeBattery; class DeclarativeInput; class DeclarativeMediaPlayer; @@ -94,6 +95,8 @@ public: QString modalias() const; + DeclarativeBattery *battery() const; + DeclarativeInput *input() const; DeclarativeMediaPlayer *mediaPlayer() const; @@ -126,15 +129,18 @@ Q_SIGNALS: void connectedChanged(bool connected); void uuidsChanged(const QStringList &uuids); void modaliasChanged(const QString &modalias); + void batteryChanged(DeclarativeBattery *battery); void inputChanged(DeclarativeInput *input); void mediaPlayerChanged(DeclarativeMediaPlayer *mediaPlayer); private: + void updateBattery(); void updateInput(); void updateMediaPlayer(); BluezQt::DevicePtr m_device; DeclarativeAdapter *m_adapter; + DeclarativeBattery *m_battery; DeclarativeInput *m_input; DeclarativeMediaPlayer *m_mediaPlayer; };
  47. Download patch docs/Doxyfile.local

    --- 5.62.0-1/docs/Doxyfile.local 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/docs/Doxyfile.local 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,7 @@ +### KApiDox Project-specific Overrides File + +# define so that deprecated API is not skipped +PREDEFINED += \ + "BLUEZQT_ENABLE_DEPRECATED_SINCE(x, y)=1" \ + "BLUEZQT_BUILD_DEPRECATED_SINCE(x, y)=1" \ + "BLUEZQT_DEPRECATED_VERSION(x, y, t)="
  48. Download patch src/types.h

    --- 5.62.0-1/src/types.h 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/types.h 2020-02-01 08:58:47.000000000 +0000 @@ -30,6 +30,7 @@ namespace BluezQt class Manager; class Adapter; +class Battery; class Device; class Input; class GattManager; @@ -55,6 +56,7 @@ class GattApplication; typedef QSharedPointer<BluezQt::Manager> ManagerPtr; typedef QSharedPointer<BluezQt::Adapter> AdapterPtr; +typedef QSharedPointer<BluezQt::Battery> BatteryPtr; typedef QSharedPointer<BluezQt::Device> DevicePtr; typedef QSharedPointer<BluezQt::Input> InputPtr; typedef QSharedPointer<BluezQt::GattManager> GattManagerPtr;
  49. Download patch autotests/batterytest.cpp

    --- 5.62.0-1/autotests/batterytest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/autotests/batterytest.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2019 Kai Uwe Broulik <kde@broulik.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "batterytest.h" +#include "autotests.h" +#include "pendingcall.h" +#include "initmanagerjob.h" + +#include <QTest> + +namespace BluezQt +{ +extern void bluezqt_initFakeBluezTestRun(); +} + +using namespace BluezQt; + +BatteryTest::BatteryTest() + : m_manager(nullptr) +{ + Autotests::registerMetatypes(); +} + +void BatteryTest::initTestCase() +{ + QDBusConnection connection = QDBusConnection::sessionBus(); + QString service = QStringLiteral("org.kde.bluezqt.fakebluez"); + + bluezqt_initFakeBluezTestRun(); + + FakeBluez::start(); + FakeBluez::runTest(QStringLiteral("bluez-standard")); + + // Create adapter + QString adapter = QStringLiteral("/org/bluez/hci0"); + QVariantMap adapterProps; + adapterProps[QStringLiteral("Path")] = QVariant::fromValue(QDBusObjectPath(adapter)); + adapterProps[QStringLiteral("Address")] = QStringLiteral("1C:E5:C3:BC:94:7E"); + adapterProps[QStringLiteral("Name")] = QStringLiteral("TestAdapter"); + FakeBluez::runAction(QStringLiteral("devicemanager"), QStringLiteral("create-adapter"), adapterProps); + + // Create devices + QVariantMap deviceProps; + QVariantMap batteryProps; + + QString device1 = adapter + QLatin1String("/dev_40_79_6A_0C_39_75"); + deviceProps[QStringLiteral("Path")] = QVariant::fromValue(QDBusObjectPath(device1)); + deviceProps[QStringLiteral("Adapter")] = QVariant::fromValue(QDBusObjectPath(adapter)); + deviceProps[QStringLiteral("Address")] = QStringLiteral("40:79:6A:0C:39:75"); + deviceProps[QStringLiteral("Name")] = QStringLiteral("TestDevice"); + deviceProps[QStringLiteral("UUIDs")] = QStringList(QStringLiteral("00001124-0000-1000-8000-00805F9B34FB")); + batteryProps[QStringLiteral("Percentage")] = uchar(42); + deviceProps[QStringLiteral("Battery")] = batteryProps; + FakeBluez::runAction(QStringLiteral("devicemanager"), QStringLiteral("create-device"), deviceProps); + + QString device2 = adapter + QLatin1String("/dev_50_79_6A_0C_39_75"); + deviceProps[QStringLiteral("Path")] = QVariant::fromValue(QDBusObjectPath(device2)); + deviceProps[QStringLiteral("Adapter")] = QVariant::fromValue(QDBusObjectPath(adapter)); + deviceProps[QStringLiteral("Address")] = QStringLiteral("50:79:6A:0C:39:75"); + deviceProps[QStringLiteral("Name")] = QStringLiteral("TestDevice2"); + deviceProps[QStringLiteral("UUIDs")] = QStringList(QStringLiteral("00001124-0000-1000-8000-00805F9B34FB")); + batteryProps[QStringLiteral("Percentage")] = uchar(0); + deviceProps[QStringLiteral("Battery")] = batteryProps; + FakeBluez::runAction(QStringLiteral("devicemanager"), QStringLiteral("create-device"), deviceProps); + + QString device3 = adapter + QLatin1String("/dev_60_79_6B_0C_39_55"); + deviceProps[QStringLiteral("Path")] = QVariant::fromValue(QDBusObjectPath(device3)); + deviceProps[QStringLiteral("Adapter")] = QVariant::fromValue(QDBusObjectPath(adapter)); + deviceProps[QStringLiteral("Address")] = QStringLiteral("60:79:6B:0C:39:55"); + deviceProps[QStringLiteral("Name")] = QStringLiteral("TestDevice3"); + deviceProps[QStringLiteral("UUIDs")] = QStringList(QStringLiteral("00001124-0000-1000-8000-00805F9B34FB")); + batteryProps[QStringLiteral("Percentage")] = uchar(99); + deviceProps[QStringLiteral("Battery")] = batteryProps; + FakeBluez::runAction(QStringLiteral("devicemanager"), QStringLiteral("create-device"), deviceProps); + + QString device4 = adapter + QLatin1String("/dev_70_79_6B_0C_39_55"); + deviceProps[QStringLiteral("Path")] = QVariant::fromValue(QDBusObjectPath(device4)); + deviceProps[QStringLiteral("Adapter")] = QVariant::fromValue(QDBusObjectPath(adapter)); + deviceProps[QStringLiteral("Address")] = QStringLiteral("70:79:6B:0C:39:55"); + deviceProps[QStringLiteral("Name")] = QStringLiteral("TestDevice4"); + deviceProps[QStringLiteral("UUIDs")] = QStringList(QStringLiteral("00001124-0000-1000-8000-00805F9B34FB")); + batteryProps[QStringLiteral("Percentage")] = uchar(100); + deviceProps[QStringLiteral("Battery")] = batteryProps; + FakeBluez::runAction(QStringLiteral("devicemanager"), QStringLiteral("create-device"), deviceProps); + + m_manager = new Manager(); + InitManagerJob *initJob = m_manager->init(); + initJob->exec(); + QVERIFY(!initJob->error()); + + for (DevicePtr device : m_manager->devices()) { + QVERIFY(device->battery()); + + BatteryUnit u; + u.device = device; + u.dbusBattery = new org::bluez::Battery1(service, + device->ubi(), + connection, + this); + m_units.append(u); + } + + QCOMPARE(m_manager->adapters().count(), 1); + QCOMPARE(m_manager->devices().count(), 4); +} + +void BatteryTest::cleanupTestCase() +{ + for (const BatteryUnit &unit : m_units) { + delete unit.dbusBattery; + } + + delete m_manager; + + FakeBluez::stop(); +} + +void BatteryTest::getPropertiesTest() +{ + for (const BatteryUnit &unit : m_units) { + QCOMPARE(unit.device->battery()->percentage(), unit.dbusBattery->percentage()); + } +} + +QTEST_MAIN(BatteryTest)
  50. Download patch src/interfaces/org.bluez.Battery1.xml

    --- 5.62.0-1/src/interfaces/org.bluez.Battery1.xml 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/src/interfaces/org.bluez.Battery1.xml 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,7 @@ +<?xml version="1.0"?> +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="org.bluez.Battery1"> + <property name="Percentage" type="y" access="read"/> + </interface> +</node>
  51. Download patch src/imports/bluezqtextensionplugin.cpp

    --- 5.62.0-1/src/imports/bluezqtextensionplugin.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/imports/bluezqtextensionplugin.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -23,6 +23,7 @@ #include "bluezqtextensionplugin.h" #include "declarativemanager.h" #include "declarativeadapter.h" +#include "declarativebattery.h" #include "declarativedevice.h" #include "declarativeinput.h" #include "declarativemediaplayer.h" @@ -78,6 +79,7 @@ void BluezQtExtensionPlugin::registerTyp qmlRegisterSingletonType<DeclarativeManager>(uri, 1, 0, "Manager", manager_singleton); qmlRegisterType<DeclarativeDevicesModel>(uri, 1, 0, "DevicesModelPrivate"); qmlRegisterUncreatableType<DeclarativeAdapter>(uri, 1, 0, "Adapter", QStringLiteral("Adapter cannot be created")); + qmlRegisterUncreatableType<DeclarativeBattery>(uri, 1, 0, "Battery", QStringLiteral("Battery cannot be created")); qmlRegisterUncreatableType<DeclarativeDevice>(uri, 1, 0, "Device", QStringLiteral("Device cannot be created")); qmlRegisterUncreatableType<DeclarativeInput>(uri, 1, 0, "Input", QStringLiteral("Input cannot be created")); qmlRegisterUncreatableType<DeclarativeMediaPlayer>(uri, 1, 0, "MediaPlayer", QStringLiteral("MediaPlayer cannot be created"));
  52. Download patch src/imports/declarativedevice.cpp

    --- 5.62.0-1/src/imports/declarativedevice.cpp 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/imports/declarativedevice.cpp 2020-02-01 08:58:47.000000000 +0000 @@ -22,6 +22,7 @@ #include "declarativedevice.h" #include "declarativeadapter.h" +#include "declarativebattery.h" #include "declarativeinput.h" #include "declarativemediaplayer.h" @@ -31,6 +32,7 @@ DeclarativeDevice::DeclarativeDevice(Blu : QObject(adapter) , m_device(device) , m_adapter(adapter) + , m_battery(nullptr) , m_input(nullptr) , m_mediaPlayer(nullptr) { @@ -51,6 +53,7 @@ DeclarativeDevice::DeclarativeDevice(Blu connect(m_device.data(), &BluezQt::Device::modaliasChanged, this, &DeclarativeDevice::modaliasChanged); connect(m_device.data(), &BluezQt::Device::mediaPlayerChanged, this, &DeclarativeDevice::updateMediaPlayer); connect(m_device.data(), &BluezQt::Device::inputChanged, this, &DeclarativeDevice::updateInput); + connect(m_device.data(), &BluezQt::Device::batteryChanged, this, &DeclarativeDevice::updateBattery); connect(m_device.data(), &BluezQt::Device::deviceRemoved, this, [this]() { Q_EMIT deviceRemoved(this); @@ -164,6 +167,11 @@ QString DeclarativeDevice::modalias() co return m_device->modalias(); } +DeclarativeBattery *DeclarativeDevice::battery() const +{ + return m_battery; +} + DeclarativeInput *DeclarativeDevice::input() const { return m_input; @@ -209,6 +217,20 @@ BluezQt::PendingCall *DeclarativeDevice: return m_device->cancelPairing(); } +void DeclarativeDevice::updateBattery() +{ + if (m_battery) { + m_battery->deleteLater(); + m_battery = nullptr; + } + + if (m_device->battery()) { + m_battery = new DeclarativeBattery(m_device->battery(), this); + } + + Q_EMIT batteryChanged(m_battery); +} + void DeclarativeDevice::updateInput() { if (m_input) {
  53. Download patch src/CMakeLists.txt

    --- 5.62.0-1/src/CMakeLists.txt 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/CMakeLists.txt 2020-02-01 08:58:47.000000000 +0000 @@ -4,6 +4,7 @@ set(bluezqt_SRCS manager_p.cpp adapter.cpp adapter_p.cpp + battery.cpp device.cpp device_p.cpp gattapplication.cpp @@ -67,6 +68,7 @@ qt5_add_dbus_interface(bluezqt_SRCS ${ob qt5_add_dbus_interface(bluezqt_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.freedesktop.DBus.Properties.xml dbusproperties) qt5_add_dbus_interface(bluezqt_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.Adapter1.xml bluezadapter1) qt5_add_dbus_interface(bluezqt_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.AgentManager1.xml bluezagentmanager1) +qt5_add_dbus_interface(bluezqt_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.Battery1.xml bluezbattery1) qt5_add_dbus_interface(bluezqt_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.GattCharacteristic1.xml bluezgattcharacteristic1) qt5_add_dbus_interface(bluezqt_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.GattManager1.xml bluezgattmanager1) qt5_add_dbus_interface(bluezqt_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.ProfileManager1.xml bluezprofilemanager1) @@ -83,8 +85,15 @@ qt5_add_dbus_interface(bluezqt_SRCS ${CM qt5_add_dbus_interface(bluezqt_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.obex.ObjectPush1.xml obexobjectpush1) add_library(KF5BluezQt ${bluezqt_SRCS}) -generate_export_header(KF5BluezQt BASE_NAME BluezQt) add_library(KF5::BluezQt ALIAS KF5BluezQt) +ecm_generate_export_header(KF5BluezQt + BASE_NAME BluezQt + GROUP_BASE_NAME KF + VERSION ${KF5_VERSION} + DEPRECATED_BASE_VERSION 0 + DEPRECATION_VERSIONS 5.57 + EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} +) target_include_directories(KF5BluezQt INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/BluezQt>") @@ -168,10 +177,13 @@ if(BUILD_QCH) MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md" LINK_QCHS Qt5Core_QCH + INCLUDE_DIRS + ${CMAKE_CURRENT_BINARY_DIR} BLANK_MACROS BLUEZQT_EXPORT BLUEZQT_DEPRECATED BLUEZQT_DEPRECATED_EXPORT + "BLUEZQT_DEPRECATED_VERSION(x, y, t)" TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} COMPONENT Devel
  54. Download patch autotests/batterytest.h

    --- 5.62.0-1/autotests/batterytest.h 1970-01-01 00:00:00.000000000 +0000 +++ 5.67.0-0ubuntu1/autotests/batterytest.h 2020-02-01 08:58:47.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2019 Kai Uwe Broulik <kde@broulik.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef BATTERYTEST_H +#define BATTERYTEST_H + +#include <QObject> + +#include "bluezbattery1_tst.h" + +#include "manager.h" +#include "device.h" +#include "battery.h" + +class BatteryTest : public QObject +{ + Q_OBJECT + +public: + explicit BatteryTest(); + +private Q_SLOTS: + void initTestCase(); + void cleanupTestCase(); + + void getPropertiesTest(); + +private: + struct BatteryUnit + { + BluezQt::DevicePtr device; + org::bluez::Battery1 *dbusBattery; + }; + + BluezQt::Manager *m_manager; + QList<BatteryUnit> m_units; +}; + +#endif // BATTERYTEST_H
  55. Download patch autotests/CMakeLists.txt

    --- 5.62.0-1/autotests/CMakeLists.txt 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/autotests/CMakeLists.txt 2020-02-01 08:58:47.000000000 +0000 @@ -8,6 +8,7 @@ set(bluezqt_autotests_SRCS qt5_add_dbus_interface(bluezqt_autotests_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.freedesktop.DBus.Properties.xml dbusproperties_tst) qt5_add_dbus_interface(bluezqt_autotests_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.Adapter1.xml bluezadapter1_tst) +qt5_add_dbus_interface(bluezqt_autotests_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.Battery1.xml bluezbattery1_tst) qt5_add_dbus_interface(bluezqt_autotests_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.Device1.xml bluezdevice1_tst) qt5_add_dbus_interface(bluezqt_autotests_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.MediaPlayer1.xml bluezmediaplayer1_tst) qt5_add_dbus_interface(bluezqt_autotests_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/interfaces/org.bluez.MediaTransport1.xml bluezmediatransport1_tst) @@ -28,6 +29,7 @@ bluezqt_tests( agentmanagertest obexmanagertest adaptertest + batterytest devicetest inputtest mediaplayertest
  56. Download patch tools/bluezapi2qt/CppGenerator.cpp
  57. Download patch src/a2dp-codecs.c

    --- 5.62.0-1/src/a2dp-codecs.c 2019-09-07 12:32:01.000000000 +0000 +++ 5.67.0-0ubuntu1/src/a2dp-codecs.c 2020-02-01 08:58:47.000000000 +0000 @@ -22,7 +22,7 @@ #include "a2dp-codecs.h" -/* Currently our capabilites are limited to the most common use cases. +/* Currently our capabilities are limited to the most common use cases. iOS has a fixed stream configuration anyway (for SBC and AAC). */ const a2dp_sbc_t sbcCapabilities = { .frequency =
  1. bluez-qt