Thread: daperl's PoRN
View Single Post
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#15
If you get hit by a tidal wave, it's an understatement if your epitaph says you were in over your head

I successfully sent and asynchronously received IM messages today! I was going nowhere fast until I looked inside the Empathy code (Hello!). I mean, look at this snippet from empathy-tp-contact-list.c:

Code:
GValueArray  *chan_struct;
const gchar  *object_path;
const gchar  *channel_type;
TpHandleType  handle_type;
guint         handle;
                
chan_struct = g_ptr_array_index (channels, i);
object_path = g_value_get_boxed (g_value_array_get_nth (chan_struct, 0));
channel_type = g_value_get_string (g_value_array_get_nth (chan_struct, 1));
handle_type = g_value_get_uint (g_value_array_get_nth (chan_struct, 2));
handle = g_value_get_uint (g_value_array_get_nth (chan_struct, 3));
I had no idea where this particular GValueArray's structure was documented, or even that the GPtrArray values are GValueArrays! All I knew was that they weren't GObjects, but that didn't help me much (crash!). Since I'm starting to plug in to a low-level, general purpose API like Telepathy, I expect to see plenty more of this kind of data packing. But no worries, right? I have Empathy as my new Rosetta Stone, so things could start to pick up from here.
__________________
N9: Go white or go home
 

The Following User Says Thank You to daperl For This Useful Post: