libpurple/status.c

changeset 23236
e6acfffcc51b
parent 22793
b58dbbc5955e
child 23389
6c30d2766837
equal deleted inserted replaced
23235:cb7d22017162 23236:e6acfffcc51b
109 109
110 const char *title; 110 const char *title;
111 111
112 gboolean active; 112 gboolean active;
113 113
114 /*
115 * The current values of the attributes for this status. The
116 * key is a string containing the name of the attribute. It is
117 * a borrowed reference from the list of attrs in the
118 * PurpleStatusType. The value is a PurpleValue.
119 */
114 GHashTable *attr_values; 120 GHashTable *attr_values;
115 }; 121 };
116 122
117 typedef struct 123 typedef struct
118 { 124 {
561 567
562 status->type = status_type; 568 status->type = status_type;
563 status->presence = presence; 569 status->presence = presence;
564 570
565 status->attr_values = 571 status->attr_values =
566 g_hash_table_new_full(g_str_hash, g_str_equal, g_free, 572 g_hash_table_new_full(g_str_hash, g_str_equal, NULL,
567 (GDestroyNotify)purple_value_destroy); 573 (GDestroyNotify)purple_value_destroy);
568 574
569 for (l = purple_status_type_get_attrs(status_type); l != NULL; l = l->next) 575 for (l = purple_status_type_get_attrs(status_type); l != NULL; l = l->next)
570 { 576 {
571 PurpleStatusAttr *attr = (PurpleStatusAttr *)l->data; 577 PurpleStatusAttr *attr = (PurpleStatusAttr *)l->data;
572 PurpleValue *value = purple_status_attr_get_value(attr); 578 PurpleValue *value = purple_status_attr_get_value(attr);
573 PurpleValue *new_value = purple_value_dup(value); 579 PurpleValue *new_value = purple_value_dup(value);
574 580
575 g_hash_table_insert(status->attr_values, 581 g_hash_table_insert(status->attr_values,
576 g_strdup(purple_status_attr_get_id(attr)), 582 (char *)purple_status_attr_get_id(attr),
577 new_value); 583 new_value);
578 } 584 }
579 585
580 return status; 586 return status;
581 } 587 }

mercurial