[frameworks/kwallet] src: ksecretd: Drop registering KWallet interface

Nicolas Fella <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit e2b68f90d5b6963e87302c2c92f2864d56a9ce5e by Nicolas Fella.
Committed on 02/08/2026 at 14:40.
Pushed by nicolasfella into branch 'master'.

ksecretd: Drop registering KWallet interface

Currently ksecretd registers the KWallet DBus interface (at a custom path).

This is used by kwalletd, but only for one function: changePassword.

Instead of registering the full KWallet interface for this only register
the one function we need

A  +10   -0    src/api/KWallet/org.kde.kwalletcompat.xml
M  +2    -8    src/runtime/ksecretd/CMakeLists.txt
M  +0    -8    src/runtime/ksecretd/autotests/CMakeLists.txt
M  +2    -2    src/runtime/ksecretd/ksecretd.cpp
M  +4    -4    src/runtime/kwalletd/kwalletd.cpp

https://invent.kde.org/frameworks/kwallet/-/commit/e2b68f90d5b6963e87302c2c92f2864d56a9ce5e

diff --git a/src/api/KWallet/org.kde.kwalletcompat.xml b/src/api/KWallet/org.kde.kwalletcompat.xml
new file mode 100644
index 00000000..dbf0dd00
--- /dev/null
+++ b/src/api/KWallet/org.kde.kwalletcompat.xml
@@ -0,0 +1,10 @@
+<!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.kde.kwalletcompat">
+        <method name="changePassword">
+            <arg name="wallet" type="s" direction="in"/>
+            <arg name="wId" type="x" direction="in"/>
+            <arg name="appid" type="s" direction="in"/>
+        </method>
+    </interface>
+</node>
diff --git a/src/runtime/ksecretd/CMakeLists.txt b/src/runtime/ksecretd/CMakeLists.txt
index ea3321cf..b49877d1 100644
--- a/src/runtime/ksecretd/CMakeLists.txt
+++ b/src/runtime/ksecretd/CMakeLists.txt
@@ -93,13 +93,7 @@ if (Gpgmepp_FOUND)
     )
 endif(Gpgmepp_FOUND)
 
-if (NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND
-    EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.72.0)
-    set(kwallet_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.kde.KWallet.xml)
-else()
-    # copy of org.kde.KWallet.xml, but with all deprecated API removed
-    set(kwallet_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.kde.nodeprecated.KWallet.xml)
-endif()
+set(kwalletcompat_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.kde.kwalletcompat.xml)
 set(fdo_service_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Service.xml)
 set(fdo_session_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Session.xml)
 set(fdo_collection_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Collection.xml)
@@ -108,7 +102,7 @@ set(fdo_prompt_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.P
 set(fdo_portal_secret_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.impl.portal.Secret.xml)
 
 set(ksecretd_dbus_SRCS)
-qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${kwallet_xml} ksecretd.h KSecretD kwalletadaptor KWalletAdaptor)
+qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${kwalletcompat_xml} ksecretd.h KSecretD kwalletcompatadaptor KWalletCompatAdaptor)
 qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${fdo_service_xml} kwalletfreedesktopservice.h KWalletFreedesktopService
     kwalletfreedesktopserviceadaptor KWalletFreedesktopServiceAdaptor)
 qt_add_dbus_adaptor(ksecretd_dbus_SRCS ${fdo_session_xml} kwalletfreedesktopsession.h KWalletFreedesktopSession
diff --git a/src/runtime/ksecretd/autotests/CMakeLists.txt b/src/runtime/ksecretd/autotests/CMakeLists.txt
index 3871db58..58559c4a 100644
--- a/src/runtime/ksecretd/autotests/CMakeLists.txt
+++ b/src/runtime/ksecretd/autotests/CMakeLists.txt
@@ -15,13 +15,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../api/KWallet)
 add_definitions(-DFDO_ENABLE_DUMMY_MESSAGE_CONNECTION)
 remove_definitions(-DQT_NO_CAST_FROM_ASCII)
 
-if (NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND
-    EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.72.0)
-    set(kwallet_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.kde.KWallet.xml)
-else()
-    # copy of org.kde.KWallet.xml, but with all deprecated API removed
-    set(kwallet_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.kde.nodeprecated.KWallet.xml)
-endif()
 set(fdo_service_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Service.xml)
 set(fdo_session_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Session.xml)
 set(fdo_collection_xml ${CMAKE_SOURCE_DIR}/src/api/KWallet/org.freedesktop.Secrets.Collection.xml)
@@ -38,7 +31,6 @@ set(TEST_SRC
     ../kwalletfreedesktopattributes.cpp
 )
 
-qt_add_dbus_adaptor( TEST_SRC ${kwallet_xml} ../ksecretd.h KSecretD kwalletadaptor KWalletAdaptor)
 qt_add_dbus_adaptor( TEST_SRC ${fdo_service_xml} ../kwalletfreedesktopservice.h KWalletFreedesktopService
     kwalletfreedesktopserviceadaptor KWalletFreedesktopServiceAdaptor)
 qt_add_dbus_adaptor( TEST_SRC ${fdo_session_xml} ../kwalletfreedesktopsession.h KWalletFreedesktopSession
diff --git a/src/runtime/ksecretd/ksecretd.cpp b/src/runtime/ksecretd/ksecretd.cpp
index e8043aef..40ebd580 100644
--- a/src/runtime/ksecretd/ksecretd.cpp
+++ b/src/runtime/ksecretd/ksecretd.cpp
@@ -53,7 +53,7 @@
 
 #include <assert.h>
 
-#include "kwalletadaptor.h"
+#include "kwalletcompatadaptor.h"
 
 static void startManagerForKSecretD()
 {
@@ -137,7 +137,7 @@ KSecretD::KSecretD()
     KConfigGroup cfgWallet(&kwalletrc, "Wallet");
 
     if (cfgWallet.readEntry<bool>("apiEnabled", true)) {
-        (void)new KWalletAdaptor(this);
+        (void)new KWalletCompatAdaptor(this);
         // register legacy services
         QDBusConnection::sessionBus().registerObject(QStringLiteral("/ksecretd"), this);
         QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.ksecretd"));
diff --git a/src/runtime/kwalletd/kwalletd.cpp b/src/runtime/kwalletd/kwalletd.cpp
index 4f7d1695..9b477827 100644
--- a/src/runtime/kwalletd/kwalletd.cpp
+++ b/src/runtime/kwalletd/kwalletd.cpp
@@ -532,16 +532,16 @@ void KWalletD::changePassword(const QString &wallet, qlonglong wId, const QStrin
         return;
     }
 
-    QDBusInterface legacyKWalletInterface(QStringLiteral("org.kde.ksecretd"),
+    QDBusInterface kwalletCompatInterface(QStringLiteral("org.kde.ksecretd"),
                                           QStringLiteral("/ksecretd"),
-                                          QStringLiteral("org.kde.KWallet"),
+                                          QStringLiteral("org.kde.kwalletcompat"),
                                           QDBusConnection::sessionBus());
 
-    if (!legacyKWalletInterface.isValid()) {
+    if (!kwalletCompatInterface.isValid()) {
         return;
     }
 
-    legacyKWalletInterface.asyncCall(QStringLiteral("changePassword"), wallet, wId, appId);
+    kwalletCompatInterface.asyncCall(QStringLiteral("changePassword"), wallet, wId, appId);
 }
 
 QStringList KWalletD::wallets() const
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.