From 7133b7455546e6cbd82bb0a89e881bbe885d59d5 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 6 Sep 2024 10:08:40 +0200 Subject: [PATCH] dnfdaemon: Signals should use "object_path" type for the session_object_path argument The interface is defined as the "session_object_path" is of type "object_path", but when setting the arguments it's passing the path as a string, which causes a type mismatch and the client side can reject the signal. Store the object path as an sdbus::ObjectPath in the Session class to have correct types in the signal emission. Closes https://github.com/rpm-software-management/dnf5/issues/1646 --- dnf5daemon-server/session.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dnf5daemon-server/session.hpp b/dnf5daemon-server/session.hpp index de46d5ed7..defc2cf74 100644 --- a/dnf5daemon-server/session.hpp +++ b/dnf5daemon-server/session.hpp @@ -70,7 +70,7 @@ class Session { return dnfdaemon::key_value_map_get(session_configuration, key); } - std::string get_object_path() { return object_path; }; + const sdbus::ObjectPath & get_object_path() const { return object_path; }; sdbus::IConnection & get_connection() { return connection; }; libdnf5::Base * get_base() { return base.get(); }; ThreadsManager & get_threads_manager() { return threads_manager; }; @@ -105,7 +105,7 @@ class Session { libdnf5::Goal goal; std::unique_ptr transaction{nullptr}; dnfdaemon::KeyValueMap session_configuration; - std::string object_path; + sdbus::ObjectPath object_path; std::vector> services{}; ThreadsManager threads_manager; std::atomic repositories_status{dnfdaemon::RepoStatus::NOT_READY};