Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libngf-qt] Make multiple state changes more robust. JB#61050 #9

Merged
merged 1 commit into from Dec 1, 2023

Conversation

pvuorela
Copy link
Contributor

If calling e.g. stop() twice both of those request were passed to ngfd which at later moment didn't anymore have the event with such id, got confused and issued warnings.

Some details adjusted:

  • State change method bool return values are defined as "False if no connection to NGF daemon", so making them behave as such. Though didn't find any place interested in the return values.
  • Some methods renamed a bit to match better what they do, e.g. set or request something.
  • Splitted the pending state change requested to its own member variable to keep it simpler. Active state is now what's reported active by the server and wanted state is what's requested the last time from the server, protecting against requesting same thing many times.

If calling e.g. stop() twice both of those request were passed to ngfd
which at later moment didn't anymore have the event with such id,
got confused and issued warnings.

Some details adjusted:
- State change method bool return values are defined as
"False if no connection to NGF daemon", so making them behave as such.
Though didn't find any place interested in the return values.
- Some methods renamed a bit to match better what they do, e.g. set
or request something.
- Splitted the pending state change requested to its own member variable
to keep it simpler. Active state is now what's reported active by the
server and wanted state is what's requested the last time from the server,
protecting against requesting same thing many times.
src/dbus/clientprivate.cpp Show resolved Hide resolved
@pvuorela pvuorela merged commit 00577c7 into master Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants