Skip to content

Commit

Permalink
dnfdaemon: Signals should use "object_path" type for the session_obje…
Browse files Browse the repository at this point in the history
…ct_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 rpm-software-management#1646
  • Loading branch information
mcrha committed Sep 6, 2024
1 parent 546af1d commit 7133b74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dnf5daemon-server/session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Session {
return dnfdaemon::key_value_map_get<ItemType>(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; };
Expand Down Expand Up @@ -105,7 +105,7 @@ class Session {
libdnf5::Goal goal;
std::unique_ptr<libdnf5::base::Transaction> transaction{nullptr};
dnfdaemon::KeyValueMap session_configuration;
std::string object_path;
sdbus::ObjectPath object_path;
std::vector<std::unique_ptr<IDbusSessionService>> services{};
ThreadsManager threads_manager;
std::atomic<dnfdaemon::RepoStatus> repositories_status{dnfdaemon::RepoStatus::NOT_READY};
Expand Down

0 comments on commit 7133b74

Please sign in to comment.