diff src/gtkaccount.c @ 12121:943307dd6ee9

[gaim-migrate @ 14421] When adding a new account, set the status before enabling it.That way, the correct status ends up being used, and you don't run into a a weird situation where the account tries to connect and then the offline status is appled when your current status is 'Offline'. Also a warning fix. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 17 Nov 2005 04:42:16 +0000
parents 36a0c8719af3
children 355c7acbb61d
line wrap: on
line diff
--- a/src/gtkaccount.c	Thu Nov 17 03:38:38 2005 +0000
+++ b/src/gtkaccount.c	Thu Nov 17 04:42:16 2005 +0000
@@ -965,8 +965,8 @@
 	GtkWidget *check;
 	GtkWidget *entry;
 	GtkWidget *combo;
-	GList *list;
-	GList *node;
+	const GList *list;
+	const GList *node;
 	gint i, idx;
 	GtkListStore *model;
 	GtkTreeIter iter;
@@ -1623,12 +1623,16 @@
 	/* If this is a new account, then sign on! */
 	if (new) {
 		const char *current_savedstatus_name;
-		const GaimSavedStatus *saved_status;
-
-		gaim_account_set_enabled(account, GAIM_GTK_UI, TRUE);
+		const GaimSavedStatus *saved_status = NULL;
+
 		current_savedstatus_name = gaim_prefs_get_string("/core/status/current");
-		saved_status = gaim_savedstatus_find(current_savedstatus_name);
-		gaim_savedstatus_activate_for_account(saved_status, account);
+		if (current_savedstatus_name)
+			saved_status = gaim_savedstatus_find(current_savedstatus_name);
+
+		if (saved_status) {
+			gaim_savedstatus_activate_for_account(saved_status, account);
+			gaim_account_set_enabled(account, GAIM_GTK_UI, TRUE);
+		}
 	}
 
 	return account;
@@ -2339,7 +2343,7 @@
 	gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, COLUMN_DATA, &account, -1);
 
 	if ((account != NULL) && (event->button == 1) &&
-		(event->type == GDK_2BUTTON_PRESS) && 
+		(event->type == GDK_2BUTTON_PRESS) &&
 		(strcmp(gtk_tree_view_column_get_title(column), title)))
 	{
 		gaim_gtk_account_dialog_show(GAIM_GTK_MODIFY_ACCOUNT_DIALOG, account);