Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package kf6-bluez-qt for openSUSE:Factory 
checked in at 2025-11-17 12:08:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kf6-bluez-qt (Old)
 and      /work/SRC/openSUSE:Factory/.kf6-bluez-qt.new.2061 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kf6-bluez-qt"

Mon Nov 17 12:08:56 2025 rev:22 rq:1317862 version:6.20.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kf6-bluez-qt/kf6-bluez-qt.changes        
2025-10-12 22:21:40.254956441 +0200
+++ /work/SRC/openSUSE:Factory/.kf6-bluez-qt.new.2061/kf6-bluez-qt.changes      
2025-11-17 12:09:46.899362662 +0100
@@ -1,0 +2,12 @@
+Thu Nov 13 20:58:42 UTC 2025 - Christophe Marin <[email protected]>
+
+- Update to 6.20.0
+  * New feature release
+  * For more details please see:
+  * https://kde.org/announcements/frameworks/6/6.20.0
+- Changes since 6.19.0:
+  * Update dependency version to 6.20.0
+  * rfkill: Write to rfkill in a thread
+  * Update version to 6.20.0
+
+-------------------------------------------------------------------

Old:
----
  bluez-qt-6.19.0.tar.xz
  bluez-qt-6.19.0.tar.xz.sig

New:
----
  bluez-qt-6.20.0.tar.xz
  bluez-qt-6.20.0.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kf6-bluez-qt.spec ++++++
--- /var/tmp/diff_new_pack.RSCeJN/_old  2025-11-17 12:09:48.019409967 +0100
+++ /var/tmp/diff_new_pack.RSCeJN/_new  2025-11-17 12:09:48.031410474 +0100
@@ -19,11 +19,11 @@
 %define qt6_version 6.8.0
 
 %define rname bluez-qt
-# Full KF6 version (e.g. 6.19.0)
+# Full KF6 version (e.g. 6.20.0)
 %{!?_kf6_version: %global _kf6_version %{version}}
 %bcond_without released
 Name:           kf6-bluez-qt
-Version:        6.19.0
+Version:        6.20.0
 Release:        0
 Summary:        Async Bluez wrapper library
 License:        LGPL-2.1-or-later

++++++ bluez-qt-6.19.0.tar.xz -> bluez-qt-6.20.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluez-qt-6.19.0/CMakeLists.txt 
new/bluez-qt-6.20.0/CMakeLists.txt
--- old/bluez-qt-6.19.0/CMakeLists.txt  2025-10-05 14:33:50.000000000 +0200
+++ new/bluez-qt-6.20.0/CMakeLists.txt  2025-11-07 19:58:03.000000000 +0100
@@ -1,10 +1,10 @@
 cmake_minimum_required(VERSION 3.16)
 
-set(KF_VERSION "6.19.0") # handled by release scripts
+set(KF_VERSION "6.20.0") # handled by release scripts
 project(BluezQt VERSION ${KF_VERSION})
 
 include(FeatureSummary)
-find_package(ECM 6.19.0 NO_MODULE)
+find_package(ECM 6.20.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)
 
@@ -37,7 +37,7 @@
 )
 
 # Dependencies
-set(REQUIRED_QT_VERSION 6.7.0)
+set(REQUIRED_QT_VERSION 6.8.0)
 
 # Required Qt components to build this framework
 find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core DBus Network)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluez-qt-6.19.0/src/rfkill.cpp 
new/bluez-qt-6.20.0/src/rfkill.cpp
--- old/bluez-qt-6.19.0/src/rfkill.cpp  2025-10-05 14:33:50.000000000 +0200
+++ new/bluez-qt-6.20.0/src/rfkill.cpp  2025-11-07 19:58:03.000000000 +0100
@@ -18,7 +18,11 @@
 #include <unistd.h>
 #endif
 
+#include <QMutex>
+#include <QMutexLocker>
 #include <QSocketNotifier>
+#include <QThread>
+#include <QWaitCondition>
 
 namespace BluezQt
 {
@@ -48,6 +52,66 @@
 };
 #endif
 
+RfkillThread::RfkillThread(QObject *parent)
+    : QThread(parent)
+{
+}
+
+void RfkillThread::interrupt()
+{
+    requestInterruption();
+    m_waitCondition.wakeOne();
+}
+
+void RfkillThread::run()
+{
+    while (!isInterruptionRequested()) {
+        QMutexLocker locker(&m_mutex);
+
+        quint8 wantedBlocked;
+        do {
+            wantedBlocked = m_pendingBlocked;
+            locker.unlock();
+            doSetSoftBlocked(wantedBlocked);
+            locker.relock();
+            // Check again in case it changed while we were busy.
+        } while (!isInterruptionRequested() && wantedBlocked != 
m_pendingBlocked);
+
+        if (!isInterruptionRequested()) {
+            m_waitCondition.wait(&m_mutex);
+        }
+    }
+}
+
+void RfkillThread::setSoftBlocked(quint8 blocked)
+{
+    QMutexLocker locker(&m_mutex);
+    m_pendingBlocked = blocked;
+    m_waitCondition.wakeOne();
+}
+
+void RfkillThread::doSetSoftBlocked(quint8 blocked)
+{
+    int fd = ::open("/dev/rfkill", O_WRONLY | O_CLOEXEC);
+    if (fd == -1) {
+        qCWarning(BLUEZQT) << "Cannot open /dev/rfkill for writing!";
+        return;
+    }
+
+    rfkill_event event;
+    ::memset(&event, 0, sizeof(event));
+    event.op = RFKILL_OP_CHANGE_ALL;
+    event.type = RFKILL_TYPE_BLUETOOTH;
+    event.soft = blocked;
+
+    if (::write(fd, &event, sizeof(event)) == sizeof(event)) {
+        qCDebug(BLUEZQT) << "Setting Rfkill soft block succeeded";
+    } else {
+        qCWarning(BLUEZQT) << "Setting Rfkill soft block failed:" << errno;
+    }
+    ::close(fd);
+};
+
 Rfkill::Rfkill(QObject *parent)
     : QObject(parent)
     , d(new RfkillPrivate)
@@ -62,8 +126,9 @@
         ::close(d->m_readFd);
     }
 
-    if (d->m_writeFd != -1) {
-        ::close(d->m_writeFd);
+    if (d->m_thread) {
+        d->m_thread->interrupt();
+        d->m_thread->wait();
     }
 #endif
 }
@@ -125,32 +190,6 @@
 #endif
 }
 
-bool Rfkill::openForWriting()
-{
-#ifndef Q_OS_LINUX
-    return false;
-#else
-    if (d->m_writeFd != -1) {
-        return true;
-    }
-
-    d->m_writeFd = ::open("/dev/rfkill", O_WRONLY | O_CLOEXEC);
-
-    if (d->m_writeFd == -1) {
-        qCWarning(BLUEZQT) << "Cannot open /dev/rfkill for writing!";
-        return false;
-    }
-
-    if (::fcntl(d->m_writeFd, F_SETFL, O_NONBLOCK) < 0) {
-        ::close(d->m_writeFd);
-        d->m_writeFd = -1;
-        return false;
-    }
-
-    return true;
-#endif
-}
-
 #ifdef Q_OS_LINUX
 static Rfkill::State getState(const rfkill_event &event)
 {
@@ -214,25 +253,16 @@
 #endif
 }
 
-bool Rfkill::setSoftBlock(quint8 soft)
+void Rfkill::setSoftBlock(quint8 soft)
 {
 #ifndef Q_OS_LINUX
     Q_UNUSED(soft)
-    return false;
 #else
-    if (!openForWriting()) {
-        return false;
+    if (!d->m_thread) {
+        d->m_thread = new RfkillThread(this);
     }
-
-    rfkill_event event;
-    ::memset(&event, 0, sizeof(event));
-    event.op = RFKILL_OP_CHANGE_ALL;
-    event.type = RFKILL_TYPE_BLUETOOTH;
-    event.soft = soft;
-
-    bool ret = ::write(d->m_writeFd, &event, sizeof(event)) == sizeof(event);
-    qCDebug(BLUEZQT) << "Setting Rfkill soft block succeeded:" << ret;
-    return ret;
+    d->m_thread->setSoftBlocked(soft);
+    d->m_thread->start();
 #endif
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluez-qt-6.19.0/src/rfkill.h 
new/bluez-qt-6.20.0/src/rfkill.h
--- old/bluez-qt-6.19.0/src/rfkill.h    2025-10-05 14:33:50.000000000 +0200
+++ new/bluez-qt-6.20.0/src/rfkill.h    2025-11-07 19:58:03.000000000 +0100
@@ -75,7 +75,7 @@
     BLUEZQT_NO_EXPORT void init();
     BLUEZQT_NO_EXPORT bool openForWriting();
     BLUEZQT_NO_EXPORT void updateRfkillDevices();
-    BLUEZQT_NO_EXPORT bool setSoftBlock(quint8 soft);
+    BLUEZQT_NO_EXPORT void setSoftBlock(quint8 soft);
 
     std::unique_ptr<RfkillPrivate> d;
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bluez-qt-6.19.0/src/rfkill_p.h 
new/bluez-qt-6.20.0/src/rfkill_p.h
--- old/bluez-qt-6.19.0/src/rfkill_p.h  2025-10-05 14:33:50.000000000 +0200
+++ new/bluez-qt-6.20.0/src/rfkill_p.h  2025-11-07 19:58:03.000000000 +0100
@@ -10,19 +10,45 @@
 #define BLUEZQT_RFKILL_P_H
 
 #include <QHash>
+#include <QMutex>
 #include <QObject>
+#include <QThread>
+#include <QWaitCondition>
 
 #include "bluezqt_export.h"
 #include "rfkill.h"
 
 namespace BluezQt
 {
+
+class RfkillThread : public QThread
+{
+    Q_OBJECT
+
+public:
+    explicit RfkillThread(QObject *parent);
+
+    void interrupt();
+    void setSoftBlocked(quint8 blocked);
+
+protected:
+    void run() override;
+
+private:
+    void doSetSoftBlocked(quint8 blocked);
+
+    QWaitCondition m_waitCondition;
+    QMutex m_mutex;
+    quint8 m_pendingBlocked;
+};
+
 struct RfkillPrivate {
     int m_readFd = -1;
-    int m_writeFd = -1;
     Rfkill::State m_state = Rfkill::State::Unknown;
     QHash<quint32, Rfkill::State> m_devices;
+    RfkillThread *m_thread = nullptr;
 };
+
 } // namespace BluezQt
 
 #endif // BLUEZQT_RFKILL_P_H

Reply via email to