Mercurial > pidgin.yaz
comparison src/account.c @ 5710:dbac958d8937
[gaim-migrate @ 6131]
Accounts are no longer automatically added or removed from the list when
creating or destroying them. They must now be added/removed with
gaim_accounts_add() and gaim_accounts_removed(). Also fixed a bug where
garbage would appear on the screenname.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Tue, 03 Jun 2003 11:42:13 +0000 |
parents | b69400aa008e |
children | e33778b9d395 |
comparison
equal
deleted
inserted
replaced
5709:2c4e7df0a688 | 5710:dbac958d8937 |
---|---|
127 gaim_account_set_protocol(account, protocol); | 127 gaim_account_set_protocol(account, protocol); |
128 | 128 |
129 account->settings = g_hash_table_new_full(g_str_hash, g_str_equal, | 129 account->settings = g_hash_table_new_full(g_str_hash, g_str_equal, |
130 g_free, __delete_setting); | 130 g_free, __delete_setting); |
131 | 131 |
132 accounts = g_list_append(accounts, account); | |
133 | |
134 return account; | 132 return account; |
135 } | 133 } |
136 | 134 |
137 void | 135 void |
138 gaim_account_destroy(GaimAccount *account) | 136 gaim_account_destroy(GaimAccount *account) |
147 if (account->password != NULL) g_free(account->password); | 145 if (account->password != NULL) g_free(account->password); |
148 if (account->user_info != NULL) g_free(account->user_info); | 146 if (account->user_info != NULL) g_free(account->user_info); |
149 if (account->protocol_id != NULL) g_free(account->protocol_id); | 147 if (account->protocol_id != NULL) g_free(account->protocol_id); |
150 | 148 |
151 g_hash_table_destroy(account->settings); | 149 g_hash_table_destroy(account->settings); |
152 | |
153 accounts = g_list_remove(accounts, account); | |
154 | 150 |
155 g_free(account); | 151 g_free(account); |
156 } | 152 } |
157 | 153 |
158 GaimConnection * | 154 GaimConnection * |
634 gaim_proxy_info_set_username(data->proxy_info, buffer); | 630 gaim_proxy_info_set_username(data->proxy_info, buffer); |
635 } | 631 } |
636 else { | 632 else { |
637 data->account = gaim_account_new(buffer, data->protocol); | 633 data->account = gaim_account_new(buffer, data->protocol); |
638 data->account->protocol_id = data->protocol_id; | 634 data->account->protocol_id = data->protocol_id; |
635 | |
636 gaim_accounts_add(data->account); | |
639 | 637 |
640 data->protocol_id = NULL; | 638 data->protocol_id = NULL; |
641 } | 639 } |
642 } | 640 } |
643 else if (data->tag == TAG_PASSWORD) { | 641 else if (data->tag == TAG_PASSWORD) { |
958 g_free(filename); | 956 g_free(filename); |
959 g_free(filename_real); | 957 g_free(filename_real); |
960 } | 958 } |
961 | 959 |
962 void | 960 void |
961 gaim_accounts_add(GaimAccount *account) | |
962 { | |
963 g_return_if_fail(account != NULL); | |
964 | |
965 accounts = g_list_append(accounts, account); | |
966 | |
967 schedule_accounts_save(); | |
968 } | |
969 | |
970 void | |
971 gaim_accounts_remove(GaimAccount *account) | |
972 { | |
973 g_return_if_fail(account != NULL); | |
974 | |
975 accounts = g_list_remove(accounts, account); | |
976 | |
977 schedule_accounts_save(); | |
978 } | |
979 | |
980 void | |
963 gaim_accounts_reorder(GaimAccount *account, size_t new_index) | 981 gaim_accounts_reorder(GaimAccount *account, size_t new_index) |
964 { | 982 { |
965 size_t index; | 983 size_t index; |
966 GList *l; | 984 GList *l; |
967 | 985 |