Remove explicit disconnections where object lifetime is the same

This commit is contained in:
Ilya Fedin
2026-04-17 11:46:53 +04:00
committed by John Preston
parent 92488b29d5
commit bc2eb3df82

View File

@@ -432,7 +432,7 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) {
return;
}
const auto actionInvoked = _interface.signal_action_invoked().connect([=](
_interface.signal_action_invoked().connect([=](
XdgNotifications::Notifications,
uint id,
std::string actionName) {
@@ -453,11 +453,7 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) {
});
});
_lifetime.add([=] {
_interface.disconnect(actionInvoked);
});
const auto replied = _interface.signal_notification_replied().connect([=](
_interface.signal_notification_replied().connect([=](
XdgNotifications::Notifications,
uint id,
std::string text) {
@@ -476,11 +472,7 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) {
});
});
_lifetime.add([=] {
_interface.disconnect(replied);
});
const auto tokenSignal = _interface.signal_activation_token().connect([=](
_interface.signal_activation_token().connect([=](
XdgNotifications::Notifications,
uint id,
std::string token) {
@@ -495,11 +487,7 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) {
}
});
_lifetime.add([=] {
_interface.disconnect(tokenSignal);
});
const auto closed = _interface.signal_notification_closed().connect([=](
_interface.signal_notification_closed().connect([=](
XdgNotifications::Notifications,
uint id,
uint reason) {
@@ -529,10 +517,6 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) {
}
});
});
_lifetime.add([=] {
_interface.disconnect(closed);
});
}
void Manager::Private::showNotification(