Add a setting-changed signal to PurpleAccount and propagate it from PurpleAccountManager

Review Request #2060 — Created Nov. 15, 2022 and submitted

Information

pidgin/pidgin
default

Reviewers

Also add a freeze and thaw mechanism to make sure state is consistent when the
signal is emitted.

Add a GParamSpec parameter to the account-changed signal as well, so that users can determine which property changed.

Used g_message in the propagator to verify that everything was behaving.

Summary ID
Add a setting-changed signal to PurpleAccount and propagate it from PurpleAccountManager
Also as a freeze and thaw mechanism to make sure state is consistent when the signal is emitted.
14cff41e028277dac1ced01ad5d13c65f8ce8a90

Description From Last Updated

Theoretically, this could use the g_rc_box API, but not sure if that's better.

QuLogicQuLogic

Bit confused why this seems to be a global lock, when the freezing is per-instance?

QuLogicQuLogic
QuLogic
  1. 
      
  2. libpurple/account.c (Diff revision 1)
     
     
    Show all issues

    Theoretically, this could use the g_rc_box API, but not sure if that's better.

    1. I always forget about this thing. Since the data type is just a GSList it might make things easier to read? I can give it a try if you like.

    2. Sure, let's see how it looks?

    3. So after looking at this, I'm not sure we can use it at all. The biggest issue is that g_rc_box_release clears the memory if it was the last reference but doesn't tell us. So we can't use that, as we need to emit all the signals when the last reference is released.

      g_rc_box_release_full takes a clear function, that we could use to emit the signals, however, we would have to put a pointer to the account in the PurpleAccountSettingFreezeQueue so that we could emit the signals on the account. We would also use this pointer to clear the freeze queue in the account. I'll give this method a try, but this definitely seems way more confusing than what we're currently doing.

    4. OK, let's go ahead with this as is.

  3. libpurple/account.c (Diff revision 1)
     
     
    Show all issues

    Bit confused why this seems to be a global lock, when the freezing is per-instance?

    1. I just followed what g_object_freeze_notify did, and figured if it worked there, then the global lock isn't a big deal? But we can make this per instance if we want.

  4. 
      
grim
grim
QuLogic
  1. Ship It!
  2. 
      
grim
Review request changed
Status:
Completed