[frameworks/kio] src/core: WorkerBase: give connectWorker and disconnectWorker back, deprecated

Méven Car <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 5f92953964d5eb898582430d8311b2f56dfbbf7d by Méven Car.
Committed on 07/08/2026 at 11:39.
Pushed by meven into branch 'master'.

WorkerBase: give connectWorker and disconnectWorker back, deprecated

They were dropped when the worker began taking a connection backend instead of a
socket address, and they are public methods of an exported class in an installed
header, so anything built against 6.28 that names them no longer builds or links
against 6.29.

They do what they did, over the backend the worker now holds: the address is made
into a connection backend and handed to it, and disconnecting hands it none. They
are marked deprecated, as they say themselves that they are internal.

M  +1    -1    src/core/CMakeLists.txt
M  +12   -0    src/core/workerbase.cpp
M  +20   -0    src/core/workerbase.h

https://invent.kde.org/frameworks/kio/-/commit/5f92953964d5eb898582430d8311b2f56dfbbf7d

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index ce8b108000..7c1f3864fa 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -175,7 +175,7 @@ ecm_generate_export_header(KF6KIOCore
     USE_VERSION_HEADER
     VERSION_BASE_NAME KIO
     DEPRECATED_BASE_VERSION 0
-    DEPRECATION_VERSIONS 5.101 6.3 6.4 6.6 6.9 6.11 6.15 6.19 6.26
+    DEPRECATION_VERSIONS 5.101 6.3 6.4 6.6 6.9 6.11 6.15 6.19 6.26 6.29
     EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
 )
 
diff --git a/src/core/workerbase.cpp b/src/core/workerbase.cpp
index a212698678..b494705e83 100644
--- a/src/core/workerbase.cpp
+++ b/src/core/workerbase.cpp
@@ -27,6 +27,18 @@ void WorkerBase::dispatchLoop()
     d->bridge.dispatchLoop();
 }
 
+#if KIOCORE_BUILD_DEPRECATED_SINCE(6, 29)
+void WorkerBase::connectWorker(const QString &address)
+{
+    d->bridge.setConnectionBackend(WorkerBasePrivate::makeConnectionBackend(QFile::encodeName(address)));
+}
+
+void WorkerBase::disconnectWorker()
+{
+    d->bridge.setConnectionBackend({});
+}
+#endif
+
 void WorkerBase::setMetaData(const QString &key, const QString &value)
 {
     d->bridge.setMetaData(key, value);
diff --git a/src/core/workerbase.h b/src/core/workerbase.h
index f3cc1e750c..83fcbf5a5d 100644
--- a/src/core/workerbase.h
+++ b/src/core/workerbase.h
@@ -839,6 +839,26 @@ public:
      */
     void listEntry(const UDSEntry &entry);
 
+#if KIOCORE_ENABLE_DEPRECATED_SINCE(6, 29)
+    /*!
+     * Internal function to connect a worker to either the worker pool or the application.
+     *
+     * \deprecated[6.29]
+     */
+    KIOCORE_DEPRECATED_VERSION(6, 29, "Internal, do not use")
+    void connectWorker(const QString &path);
+#endif
+
+#if KIOCORE_ENABLE_DEPRECATED_SINCE(6, 29)
+    /*!
+     * Internal function to disconnect a worker from either the worker pool or the application.
+     *
+     * \deprecated[6.29]
+     */
+    KIOCORE_DEPRECATED_VERSION(6, 29, "Internal, do not use")
+    void disconnectWorker();
+#endif
+
     /*!
      * Prompt the user for Authorization info (login & password).
      *
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.