Cleanup the code related to emit_interface_added
sdbusplus now supports action::emit_interface_added() when an object is
constructed, so the code that manually invokes emit_interface_added()
could be cleaned up and use the above action instead.
Tested:Tested on fp5280g2, and psu update is normal.
Signed-off-by: Albert Zhang <zhanghaodi@inspur.com>
Change-Id: I0ca12a0941c1d45c860478c6f0d72675668de653
diff --git a/src/version.hpp b/src/version.hpp
index e26bb31..2f72189 100644
--- a/src/version.hpp
+++ b/src/version.hpp
@@ -40,17 +40,9 @@
*/
Delete(sdbusplus::bus::bus& bus, const std::string& path,
Version& version) :
- DeleteInherit(bus, path.c_str(), true),
- version(version), bus(bus), path(path)
+ DeleteInherit(bus, path.c_str(), action::emit_interface_added),
+ version(version)
{
- std::vector<std::string> interfaces({interface});
- bus.emit_interfaces_added(path.c_str(), interfaces);
- }
-
- ~Delete()
- {
- std::vector<std::string> interfaces({interface});
- bus.emit_interfaces_removed(path.c_str(), interfaces);
}
/**
@@ -63,10 +55,6 @@
private:
/** @brief The Version Object. */
Version& version;
-
- static constexpr auto interface = "xyz.openbmc_project.Object.Delete";
- sdbusplus::bus::bus& bus;
- std::string path;
};
/** @class Version