diff 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
line wrap: on
line diff
--- a/src/account.c	Tue Jun 03 11:24:34 2003 +0000
+++ b/src/account.c	Tue Jun 03 11:42:13 2003 +0000
@@ -129,8 +129,6 @@
 	account->settings = g_hash_table_new_full(g_str_hash, g_str_equal,
 											  g_free, __delete_setting);
 
-	accounts = g_list_append(accounts, account);
-
 	return account;
 }
 
@@ -150,8 +148,6 @@
 
 	g_hash_table_destroy(account->settings);
 
-	accounts = g_list_remove(accounts, account);
-
 	g_free(account);
 }
 
@@ -637,6 +633,8 @@
 			data->account = gaim_account_new(buffer, data->protocol);
 			data->account->protocol_id = data->protocol_id;
 
+			gaim_accounts_add(data->account);
+
 			data->protocol_id = NULL;
 		}
 	}
@@ -960,6 +958,26 @@
 }
 
 void
+gaim_accounts_add(GaimAccount *account)
+{
+	g_return_if_fail(account != NULL);
+
+	accounts = g_list_append(accounts, account);
+
+	schedule_accounts_save();
+}
+
+void
+gaim_accounts_remove(GaimAccount *account)
+{
+	g_return_if_fail(account != NULL);
+
+	accounts = g_list_remove(accounts, account);
+
+	schedule_accounts_save();
+}
+
+void
 gaim_accounts_reorder(GaimAccount *account, size_t new_index)
 {
 	size_t index;