This class has two bindable properties - watchedServices and watchMode. What makes this class non-trivial is the fact that these properties depend on each other - setWatchedServices() need an up-to-date watchMode to set up the services, and setWatchMode() needs an up-to-date list of services in order to update the mode on them. Update the setters in such way that they remove the bindings from the updated property, and at the same time trigger the re-evaluation of the property they depend on. This includes refactoring of the helper setConnection() method in such way that it does not cause property re-evaluation, and also update of the {add,remove}Service() helper functions to take the watchMode as an input parameter. The public {add,remove}WatchedService() methods were updated similarly. The logic of the removeWatchedService() method was additionally updated to do some changes to the properties only if the service-to-be-removed actually existed in the list. Task-number: QTBUG-116346 Change-Id: If46cf926c7ace9dc4893d8daaef088f61e41c21a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d85663ced8762b3096dbcbcfbc3894895a6e11c7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%