shared: rename PROP_0 in NM_GOBJECT_PROPERTIES_DEFINE() and skip it in nm_gobject_notify_together()
PROP_0 is how we commonly name this property when we don't use NM_GOBJECT_PROPERTIES_DEFINE(). Rename it. Also, allow to skip PROP_0 in nm_gobject_notify_together(), that is handy to optionally invoke a notification, like nm_gobject_notify_together (obj, PROP_SOMETHING, changed ? PROP_OTHER : PROP_0);
This commit is contained in:
@@ -900,7 +900,7 @@ nm_str_realloc (char *str)
|
|||||||
|
|
||||||
#define NM_GOBJECT_PROPERTIES_DEFINE_BASE(...) \
|
#define NM_GOBJECT_PROPERTIES_DEFINE_BASE(...) \
|
||||||
typedef enum { \
|
typedef enum { \
|
||||||
_PROPERTY_ENUMS_0, \
|
PROP_0, \
|
||||||
__VA_ARGS__ \
|
__VA_ARGS__ \
|
||||||
_PROPERTY_ENUMS_LAST, \
|
_PROPERTY_ENUMS_LAST, \
|
||||||
} _PropertyEnums; \
|
} _PropertyEnums; \
|
||||||
@@ -921,8 +921,11 @@ _nm_gobject_notify_together_impl (obj_type *obj, guint n, const _PropertyEnums *
|
|||||||
while (n-- > 0) { \
|
while (n-- > 0) { \
|
||||||
const _PropertyEnums prop = *props++; \
|
const _PropertyEnums prop = *props++; \
|
||||||
\
|
\
|
||||||
nm_assert ((gsize) prop < G_N_ELEMENTS (obj_properties)); \
|
if (prop != PROP_0) { \
|
||||||
g_object_notify_by_pspec ((GObject *) obj, obj_properties[prop]); \
|
nm_assert ((gsize) prop < G_N_ELEMENTS (obj_properties)); \
|
||||||
|
nm_assert (obj_properties[prop]); \
|
||||||
|
g_object_notify_by_pspec ((GObject *) obj, obj_properties[prop]); \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
if (freeze_thaw) \
|
if (freeze_thaw) \
|
||||||
g_object_thaw_notify ((GObject *) obj); \
|
g_object_thaw_notify ((GObject *) obj); \
|
||||||
|
Reference in New Issue
Block a user