Re: G_PARAM_STATIC_*



On Sat, 10 Mar 2007, Stefan Kost wrote:

hi,

I just found G_PARAM_STATIC_NAME, G_PARAM_STATIC_NICK, G_PARAM_STATIC_BLURB
flags. Does it mean that if I do:

g_param_spec_string("name", "name prop", "name for blabla",
 NULL, G_PARAM_READWRITE);

I can apply them to save a g_strdup? If so wouldn't it make send to have:

yes, it has some hidden pitfalls though, e.g. you couldn't do the above
in a dynamic module which is possibly unloaded at some point.

#define	G_PARAM_STATIC_DETAIL \
 (G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB)

i don't like "DETAIL" in particular (already using that for a different param
spec extension in another library).
G_PARAM_STATIC_STRINGS could work though (and *possibly* be extended in
the future).

And finally G_PARAM_STATIC_NICK is not documented. I can send a patch.

please do.

Stefan

---
ciaoTJ



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