Re: #50218 - Notification on write-only properties is questionable/problematic



On 26 Mar 2001, Owen Taylor wrote:

> I think you were in agreement that notification on write-only properties
> was a bad idea. 
> 
> What was the concrete step to take here - something like the following
> patch?
> 
> Regards,
>                                         Owen
> 

> -      NotifyQueue *nqueue = object_freeze_notifies (object);
> +      NotifyQueue *nqueue;
> +
> +      g_return_if_fail (pspec->flags & G_PARAM_READABLE != 0);
> +
> +      nqueue = object_freeze_notifies (object);

dude, you're cruel! ;)
shouldn't we just silently ignore this?
also this would still queue changes for g_obejct_set(), so i'll add the
check to object_queue_property():

static inline void
object_queue_property (GObject     *object,
                       GParamSpec  *pspec,
                       NotifyQueue *nqueue)
{
  if (pspec->flags & G_PARAM_READABLE)
    {
      /* we will dedup later */
      nqueue->pspecs = g_slist_prepend (nqueue->pspecs, pspec);
      nqueue->n_pspecs++;
    }
}


---
ciaoTJ





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]