Mercurial > pidgin.yaz
comparison pidgin/gtkstatusbox.c @ 18118:ab6d2763b8d8
Re-fix the DBus list handling code by killing const GList* / const GSList*
everywhere. Now we maintain a list of functions which return a GList or
GSList which must not be freed. Ideally at some point this will be
replaced with code that looks at the Doxygen comment for the function and
honors @constreturn, which I've declared as a macro around @return that
prints a @note about not modifying or freeing the returned value.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 16 Jun 2007 19:44:59 +0000 |
parents | 926ccb104da0 |
children | 09eb621782bc |
comparison
equal
deleted
inserted
replaced
18117:cd81f8f36788 | 18118:ab6d2763b8d8 |
---|---|
189 } | 189 } |
190 | 190 |
191 static void | 191 static void |
192 update_to_reflect_account_status(PidginStatusBox *status_box, PurpleAccount *account, PurpleStatus *newstatus) | 192 update_to_reflect_account_status(PidginStatusBox *status_box, PurpleAccount *account, PurpleStatus *newstatus) |
193 { | 193 { |
194 const GList *l; | 194 GList *l; |
195 int status_no = -1; | 195 int status_no = -1; |
196 const PurpleStatusType *statustype = NULL; | 196 const PurpleStatusType *statustype = NULL; |
197 const char *message; | 197 const char *message; |
198 | 198 |
199 statustype = purple_status_type_find_with_id((GList *)purple_account_get_status_types(account), | 199 statustype = purple_status_type_find_with_id((GList *)purple_account_get_status_types(account), |
730 } | 730 } |
731 | 731 |
732 static PurpleStatusType * | 732 static PurpleStatusType * |
733 find_status_type_by_index(const PurpleAccount *account, gint active) | 733 find_status_type_by_index(const PurpleAccount *account, gint active) |
734 { | 734 { |
735 const GList *l = purple_account_get_status_types(account); | 735 GList *l = purple_account_get_status_types(account); |
736 gint i; | 736 gint i; |
737 | 737 |
738 for (i = 0; l; l = l->next) { | 738 for (i = 0; l; l = l->next) { |
739 PurpleStatusType *status_type = l->data; | 739 PurpleStatusType *status_type = l->data; |
740 if (!purple_status_type_is_user_settable(status_type)) | 740 if (!purple_status_type_is_user_settable(status_type)) |
939 * statuses and a token account if they do */ | 939 * statuses and a token account if they do */ |
940 static PurpleAccount* check_active_accounts_for_identical_statuses() | 940 static PurpleAccount* check_active_accounts_for_identical_statuses() |
941 { | 941 { |
942 PurpleAccount *acct = NULL, *acct2; | 942 PurpleAccount *acct = NULL, *acct2; |
943 GList *tmp, *tmp2, *active_accts = purple_accounts_get_all_active(); | 943 GList *tmp, *tmp2, *active_accts = purple_accounts_get_all_active(); |
944 const GList *s, *s1, *s2; | 944 GList *s, *s1, *s2; |
945 | 945 |
946 for (tmp = active_accts; tmp; tmp = tmp->next) { | 946 for (tmp = active_accts; tmp; tmp = tmp->next) { |
947 acct = tmp->data; | 947 acct = tmp->data; |
948 s = purple_account_get_status_types(acct); | 948 s = purple_account_get_status_types(acct); |
949 for (tmp2 = tmp->next; tmp2; tmp2 = tmp2->next) { | 949 for (tmp2 = tmp->next; tmp2; tmp2 = tmp2->next) { |
987 | 987 |
988 static void | 988 static void |
989 add_account_statuses(PidginStatusBox *status_box, PurpleAccount *account) | 989 add_account_statuses(PidginStatusBox *status_box, PurpleAccount *account) |
990 { | 990 { |
991 /* Per-account */ | 991 /* Per-account */ |
992 const GList *l; | 992 GList *l; |
993 GdkPixbuf *pixbuf; | 993 GdkPixbuf *pixbuf; |
994 | 994 |
995 for (l = purple_account_get_status_types(account); l != NULL; l = l->next) | 995 for (l = purple_account_get_status_types(account); l != NULL; l = l->next) |
996 { | 996 { |
997 PurpleStatusType *status_type = (PurpleStatusType *)l->data; | 997 PurpleStatusType *status_type = (PurpleStatusType *)l->data; |
2221 | 2221 |
2222 if (changed) | 2222 if (changed) |
2223 { | 2223 { |
2224 /* Manually find the appropriate transient acct */ | 2224 /* Manually find the appropriate transient acct */ |
2225 if (status_box->token_status_account) { | 2225 if (status_box->token_status_account) { |
2226 const GList *iter = purple_savedstatuses_get_all(); | 2226 GList *iter = purple_savedstatuses_get_all(); |
2227 GList *tmp, *active_accts = purple_accounts_get_all_active(); | 2227 GList *tmp, *active_accts = purple_accounts_get_all_active(); |
2228 | 2228 |
2229 for (; iter != NULL; iter = iter->next) { | 2229 for (; iter != NULL; iter = iter->next) { |
2230 PurpleSavedStatus *ss = iter->data; | 2230 PurpleSavedStatus *ss = iter->data; |
2231 const char *ss_msg = purple_savedstatus_get_message(ss); | 2231 const char *ss_msg = purple_savedstatus_get_message(ss); |