[Pidgin] #192: document prpl_info->list_icon(NULL, NULL)

Pidgin trac at pidgin.im
Wed Apr 18 21:26:40 EDT 2007


#192: document prpl_info->list_icon(NULL, NULL)
------------------------+---------------------------------------------------
  Reporter:  jeff       |       Owner:                         
      Type:  patch      |      Status:  reopened               
  Priority:  minor      |   Milestone:                         
 Component:  libpurple  |     Version:  2.0                    
Resolution:             |    Keywords:  msimprpl msim myspaceim
------------------------+---------------------------------------------------
Changes (by jeff):

  * status:  closed => reopened
  * type:  defect => patch
  * resolution:  fixed =>
  * summary:  msimprpl crashes add/edit accounts window => document
              prpl_info->list_icon(NULL, NULL)

Comment:

 When is this getting called with a NULL account? That seems a little odd.

 At least on Gaim 2.0.0beta6, this reliably happens when modifying any
 account in the Accounts window, presumably for populating the protocol
 dropdown in the Login Options. I didn't expect it either, but the call is
 in gtk/gtkutils.c line 478:

 {{{
         /* Load the image. */
         proto_name = prpl_info->list_icon(NULL, NULL);
         g_snprintf(buf, sizeof(buf), "%s.png", proto_name);
 }}}

 Assuming this is desirable behavior, I attached a patch to update the
 documentation of list_icon to mention the case of calling it with a NULL
 account.

   Also, g_return_val_if_fail() should only be used for protecting against
 abnormal situations, not for normal conditions.

 I'd figured (incorrectly) that a NULL account was abnormal behavior.

 Regards,
 -Jeff

-- 
Ticket URL: <http://developer.pidgin.im/ticket/192#comment:4>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list