changeset 2397:520257562955

[gaim-migrate @ 2410] changing aim_users to GSList. this works better for me since in gaim-core i had them as a GSList. besides, it saves memory. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 30 Sep 2001 19:58:48 +0000
parents 78fab38249a2
children 837f8ff999be
files src/aim.c src/dialogs.c src/gaim.h src/gaimrc.c src/multi.c src/perl.c src/util.c
diffstat 7 files changed, 25 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/aim.c	Sun Sep 30 19:48:44 2001 +0000
+++ b/src/aim.c	Sun Sep 30 19:58:48 2001 +0000
@@ -181,7 +181,7 @@
 
 static GList *combo_user_names()
 {
-	GList *usr = aim_users;
+	GSList *usr = aim_users;
 	GList *tmp = NULL;
 	struct aim_user *u;
 
@@ -423,10 +423,10 @@
 		u = g_new0(struct aim_user, 1);
 		g_snprintf(u->username, sizeof(u->username), "%s", name);
 		u->protocol = DEFAULT_PROTO;
-		aim_users = g_list_prepend(aim_users, u);
+		aim_users = g_slist_prepend(aim_users, u);
 	} else {		/* user already exists */
-		aim_users = g_list_remove(aim_users, u);
-		aim_users = g_list_prepend(aim_users, u);
+		aim_users = g_slist_remove(aim_users, u);
+		aim_users = g_slist_prepend(aim_users, u);
 	}
 	save_prefs();
 }
--- a/src/dialogs.c	Sun Sep 30 19:48:44 2001 +0000
+++ b/src/dialogs.c	Sun Sep 30 19:58:48 2001 +0000
@@ -963,7 +963,7 @@
 	GtkWidget *optmenu;
 	GtkWidget *menu;
 	GtkWidget *opt;
-	GList *u = aim_users;
+	GSList *u = aim_users;
 	struct aim_user *a;
 
 	hbox = gtk_hbox_new(FALSE, 5);
@@ -998,7 +998,7 @@
 
 	gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
 	gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu),
-				    g_list_index(aim_users,
+				    g_slist_index(aim_users,
 						 ((struct gaim_connection *)connections->data)->user));
 	b->user = ((struct gaim_connection *)connections->data)->user;
 
--- a/src/gaim.h	Sun Sep 30 19:48:44 2001 +0000
+++ b/src/gaim.h	Sun Sep 30 19:58:48 2001 +0000
@@ -580,7 +580,7 @@
 
 extern int report_idle;
 extern int web_browser;
-extern GList *aim_users;
+extern GSList *aim_users;
 extern GSList *message_queue;
 extern GSList *away_time_queue;
 extern char sound_cmd[2048];
--- a/src/gaimrc.c	Sun Sep 30 19:48:44 2001 +0000
+++ b/src/gaimrc.c	Sun Sep 30 19:58:48 2001 +0000
@@ -39,7 +39,7 @@
 #define BORING_DEFAULT_AWAY_MSG "sorry, i ran out for a while. bbl"
 #define MAX_VALUES 10
 
-GList *aim_users = NULL;
+GSList *aim_users = NULL;
 guint misc_options;
 guint logging_options;
 guint blist_options;
@@ -599,13 +599,13 @@
 
 		u = gaimrc_read_user(f);
 
-		aim_users = g_list_append(aim_users, u);
+		aim_users = g_slist_append(aim_users, u);
 	}
 }
 
 static void gaimrc_write_users(FILE *f)
 {
-	GList *usr = aim_users;
+	GSList *usr = aim_users;
 	struct aim_user *u;
 
 	fprintf(f, "users {\n");
--- a/src/multi.c	Sun Sep 30 19:48:44 2001 +0000
+++ b/src/multi.c	Sun Sep 30 19:58:48 2001 +0000
@@ -139,7 +139,7 @@
 void regenerate_user_list()
 {
 	char *titles[4];
-	GList *u = aim_users;
+	GSList *u = aim_users;
 	struct aim_user *a;
 	int i;
 
@@ -645,7 +645,7 @@
 	while (l) {
 		row = (int)l->data;
 		if (row != -1) {
-			u = g_list_nth_data(aim_users, row);
+			u = g_slist_nth_data(aim_users, row);
 			if (u)
 				show_acct_mod(u);
 		}
@@ -744,7 +744,7 @@
 	struct aim_user *u;
 	while (l) {
 		row = (int)l->data;
-		u = g_list_nth_data(aim_users, row);
+		u = g_slist_nth_data(aim_users, row);
 		if (!u->gc) {
 			struct prpl *p = find_prpl(u->protocol);
 			if (p && !(p->options & OPT_PROTO_NO_PASSWORD) && !u->password[0]) {
@@ -770,8 +770,8 @@
 		u->gc->wants_to_die = TRUE;
 		signoff(u->gc);
 	}
-	gtk_clist_remove(GTK_CLIST(list), g_list_index(aim_users, u));
-	aim_users = g_list_remove(aim_users, u);
+	gtk_clist_remove(GTK_CLIST(list), g_slist_index(aim_users, u));
+	aim_users = g_slist_remove(aim_users, u);
 	save_prefs();
 }
 
@@ -783,7 +783,7 @@
 	struct aim_user *u;
 	while (l) {
 		row = (int)l->data;
-		u = g_list_nth_data(aim_users, row);
+		u = g_slist_nth_data(aim_users, row);
 		if (!u)
 			return;
 
@@ -795,7 +795,7 @@
 
 static void sel_auto(gpointer w, gpointer d)
 {
-	GList *l = aim_users;
+	GSList *l = aim_users;
 	struct aim_user *u;
 	int i = 0;		/* faster than doing g_list_index each time */
 	while (l) {
@@ -965,7 +965,7 @@
 
 void auto_login()
 {
-	GList *u = aim_users;
+	GSList *u = aim_users;
 	struct aim_user *a = NULL;
 
 	while (u) {
@@ -1123,7 +1123,7 @@
 	g_snprintf(u->user_info, sizeof(u->user_info), "%s", DEFAULT_INFO);
 	u->protocol = proto;
 	u->options = opts;
-	aim_users = g_list_append(aim_users, u);
+	aim_users = g_slist_append(aim_users, u);
 
 	if (list) {
 		titles[0] = u->username;
--- a/src/perl.c	Sun Sep 30 19:48:44 2001 +0000
+++ b/src/perl.c	Sun Sep 30 19:58:48 2001 +0000
@@ -346,14 +346,14 @@
 			struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1));
 			debug_printf("%lu %lu\n", connections->data, gc);
 			if (g_slist_find(connections, gc))
-				XST_mIV(i++, g_list_index(aim_users, gc->user));
+				XST_mIV(i++, g_slist_index(aim_users, gc->user));
 			else
 				XST_mIV(i++, -1);
 		}
 		break;
 	case 5:
 		{
-			GList *a = aim_users;
+			GSList *a = aim_users;
 			while (a) {
 				struct aim_user *u = a->data;
 				XST_mPV(i++, u->username);
@@ -363,7 +363,7 @@
 		break;
 	case 6:
 		{
-			GList *a = aim_users;
+			GSList *a = aim_users;
 			while (a) {
 				struct aim_user *u = a->data;
 				XST_mIV(i++, u->protocol);
@@ -470,8 +470,8 @@
 	if (!command) XSRETURN(0);
 	if        (!strncasecmp(command, "signon", 6)) {
 		int index = SvIV(ST(1));
-		if (g_list_nth_data(aim_users, index))
-		serv_login(g_list_nth_data(aim_users, index));
+		if (g_slist_nth_data(aim_users, index))
+		serv_login(g_slist_nth_data(aim_users, index));
 	} else if (!strncasecmp(command, "signoff", 7)) {
 		struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1));
 		if (g_slist_find(connections, gc)) signoff(gc);
--- a/src/util.c	Sun Sep 30 19:48:44 2001 +0000
+++ b/src/util.c	Sun Sep 30 19:58:48 2001 +0000
@@ -640,7 +640,7 @@
 struct aim_user *find_user(const char *name, int protocol)
 {
 	char *who = g_strdup(normalize(name));
-	GList *usr = aim_users;
+	GSList *usr = aim_users;
 	struct aim_user *u;
 
 	while (usr) {