[Bug 33252] Refactoring of TplEntity
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed Jan 19 18:47:47 CET 2011
https://bugs.freedesktop.org/show_bug.cgi?id=33252
Emilio Pozuelo Monfort <pochu27 at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pochu27 at gmail.com
--- Comment #2 from Emilio Pozuelo Monfort <pochu27 at gmail.com> 2011-01-19 09:47:46 PST ---
+++ b/telepathy-logger/channel-text.c
+ _tpl_event_set_id (log, _tpl_channel_text_get_chatroom_id ( tpl_text));
Remove whitespace after parenthesis.
--- a/telepathy-logger/entity.c
+++ b/telepathy-logger/entity.c
+ case PROP_TYPE:
+ priv->type = g_value_get_int (value);
Shouldn't it be g_value_get_uint (since it's an enum) ?
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
Use G_PARAM_CONSTRUCT_ONLY.
- _tpl_entity_set_alias (self, g_value_get_string (value));
+ g_free (priv->alias);
+ priv->alias = g_value_dup_string (value);
Since they are construct-only, instead g_free(), do
g_assert (priv->alias == NULL); /* construct-only */
Same for the other construct-only properties.
+ param_spec = g_param_spec_int ("type",
+ "Type",
+ "The entity's type",
+ TPL_ENTITY_UNKNOWN,
+ TPL_ENTITY_SELF,
+ TPL_ENTITY_UNKNOWN,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
Not sure if you should set the maximum to TPL_ENTITY_SELF, since if at some
point we add a new type, we'll probably forget to update this. Also I've
usually seen G_MAXINT there.
Looks quite good otherwise!
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list