Skip to content

Commit ef38222

Browse files
lemirepMiKom
authored andcommitted
registerDestructionHelper: silence warnings KDBinding::Signal::connect
Since connect is now [nodiscard]. Yet when connecting to a property's signal, we know there's no need to keep the connection handle around as long as the property remains valid. Change-Id: Icd5124abc7c6bb28c5b81e7e047157b6abbb3dc4
1 parent 7c00c94 commit ef38222

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/KDFoundation/destruction_helpers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ class DestructionHelperManager
7878
template<typename DependencyType, typename ContainerType>
7979
void registerDestructionHelper(Property<DependencyType *> *property, ConnectionHandle *connectionHandle, ContainerType *owner)
8080
{
81-
property->valueAboutToChange().connect([=](DependencyType *oldVal, DependencyType * /* newVal */) {
81+
std::ignore = property->valueAboutToChange().connect([=](DependencyType *oldVal, DependencyType * /* newVal */) {
8282
if (!oldVal) {
8383
return;
8484
}
8585
oldVal->destroyed.disconnect(*connectionHandle);
8686
});
87-
property->valueChanged().connect([=](DependencyType *newVal) {
87+
std::ignore = property->valueChanged().connect([=](DependencyType *newVal) {
8888
if (!newVal) {
8989
return;
9090
}
@@ -93,7 +93,7 @@ void registerDestructionHelper(Property<DependencyType *> *property, ConnectionH
9393
});
9494
});
9595
if (owner) {
96-
owner->destroyed.connect([=] {
96+
std::ignore = owner->destroyed.connect([=] {
9797
if ((*property)() && connectionHandle->isActive()) {
9898
(*property)()->destroyed.disconnect(*connectionHandle);
9999
}

0 commit comments

Comments
 (0)