changeset 940:9fca1293f871

[gaim-migrate @ 950] Patches from kylev committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sun, 01 Oct 2000 00:20:03 +0000
parents 69955d88ab42
children 0c3bdd59f983
files src/aim.c src/away.c src/buddy.c src/dialogs.c src/gaim.h src/gaimrc.c src/gnome_applet_mgr.c src/perl.c src/prefs.c src/toc.c
diffstat 10 files changed, 58 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- a/src/aim.c	Sun Oct 01 00:06:43 2000 +0000
+++ b/src/aim.c	Sun Oct 01 00:20:03 2000 +0000
@@ -66,8 +66,8 @@
 GList *deny = NULL;
 GList *log_conversations = NULL;
 GList *buddy_pounces = NULL;
-GList *away_messages = NULL;
-GList *groups = NULL;
+GSList *away_messages = NULL;
+GSList *groups = NULL;
 GList *buddy_chats = NULL;
 GList *conversations = NULL;
 GList *chat_rooms = NULL;
@@ -131,12 +131,6 @@
 
         while (gtk_events_pending())
                gtk_main_iteration();
-
-	/* Why do I need these? */
-	usleep(10);
-	while (gtk_events_pending())
-               gtk_main_iteration();
-	       
 }
 
 void hide_login_progress(char *why)
@@ -148,11 +142,6 @@
 
         while (gtk_events_pending())
                gtk_main_iteration();
-
-	/* Why do I need these? */
-	usleep(10);
-	while (gtk_events_pending())
-               gtk_main_iteration();
 }
 
 static int snd_tmout;
--- a/src/away.c	Sun Oct 01 00:06:43 2000 +0000
+++ b/src/away.c	Sun Oct 01 00:20:03 2000 +0000
@@ -176,7 +176,7 @@
 	strcat(awayname, a->name);
 	applet_widget_unregister_callback(APPLET_WIDGET(applet), awayname);
 #endif
-        away_messages = g_list_remove(away_messages, a);
+        away_messages = g_slist_remove(away_messages, a);
         g_free(a);
         do_away_menu();
         save_prefs();
@@ -192,7 +192,7 @@
 	GtkWidget *sep;
 	GList *l;
 	GtkWidget *list_item;
-        GList *awy = away_messages;
+        GSList *awy = away_messages;
         struct away_message *a;
 
 #ifdef USE_APPLET
@@ -222,7 +222,7 @@
 			gtk_container_add(GTK_CONTAINER(prefs_away_list), list_item);
 			gtk_widget_show(list_item);
 
-			awy = awy->next;
+			awy = g_slist_next(awy);
 		}
 		if (away_messages != NULL)
                         gtk_list_select_item(GTK_LIST(prefs_away_list), 0);
@@ -238,15 +238,12 @@
 
 
 	remmenu = gtk_menu_new();
-	
-	
 
 	menuitem = gtk_menu_item_new_with_label(_("New Away Message"));
 	gtk_menu_append(GTK_MENU(awaymenu), menuitem);
 	gtk_widget_show(menuitem);
 	gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(create_away_mess), NULL);
 
-
 	awy = away_messages;
         while(awy) {
                 a = (struct away_message *)awy->data;
@@ -256,7 +253,7 @@
 		gtk_widget_show(remitem);
 		gtk_signal_connect(GTK_OBJECT(remitem), "activate", GTK_SIGNAL_FUNC(rem_away_mess), a);
 
-		awy = awy->next;
+		awy = g_slist_next(awy);
 
 	}
 	
@@ -266,7 +263,6 @@
 	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), remmenu);
 	gtk_widget_show(remmenu);
 	
-
 	sep = gtk_hseparator_new();
 	menuitem = gtk_menu_item_new();
 	gtk_menu_append(GTK_MENU(awaymenu), menuitem);
@@ -285,7 +281,7 @@
 		gtk_widget_show(menuitem);
 		gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(do_away_message), a);
 
-		awy = awy->next;
+		awy = g_slist_next(awy);
 
 	}
 
--- a/src/buddy.c	Sun Oct 01 00:06:43 2000 +0000
+++ b/src/buddy.c	Sun Oct 01 00:20:03 2000 +0000
@@ -117,7 +117,7 @@
 
 void update_num_groups()
 {
-	GList *grp = groups;
+	GSList *grp = groups;
 	GList *mem;
         struct buddy *b;
 	struct group *g;
@@ -155,7 +155,7 @@
 		if (display_options & OPT_DISP_SHOW_GRPNUM)
 #endif
                 gtk_label_set(GTK_LABEL(g->label), buf);
-                grp = grp->next;
+                grp = g_slist_next(grp);
         }
 #ifdef USE_APPLET
 	g_snprintf(buf, sizeof(buf), _("%d/%d Buddies Online"), onl, all);
@@ -165,7 +165,7 @@
 
 void update_show_idlepix()
 {
-	GList *grp = groups;
+	GSList *grp = groups;
 	GList *mem;
 	struct group *g;
         struct buddy *b;
@@ -188,13 +188,13 @@
                                 gtk_widget_hide(b->pix);
                         mem = mem->next;
                 }
-                grp = grp->next;
+                grp = g_slist_next(grp);
         }
 }
 
 void update_all_buddies()
 {
-	GList *grp = groups;
+	GSList *grp = groups;
 	GList *mem;
         struct buddy *b;
 	struct group *g;
@@ -219,7 +219,7 @@
 			gtk_widget_hide(g->item);
 		else gtk_widget_show(g->item);
 
-                grp = grp->next;
+                grp = g_slist_next(grp);
         }
 
 
@@ -298,7 +298,7 @@
                         mem = g_list_remove(mem, mem->data);
 		}
 		g_free(groups->data);
-                groups = g_list_remove(groups, groups->data);
+                groups = g_slist_remove(groups, groups->data);
 	}
 
 	sprintf(debug_buff, "date: %s\n", full_date());
@@ -478,7 +478,7 @@
 
 void remove_buddy(struct group *rem_g, struct buddy *rem_b)
 {
-	GList *grp;
+	GSList *grp;
 	GList *mem;
 	struct buddy *b;
 	int count = 0;
@@ -486,7 +486,7 @@
 	struct group *delg;
 	struct buddy *delb;
 
-	grp = g_list_find(groups, rem_g);
+	grp = g_slist_find(groups, rem_g);
         delg = (struct group *)grp->data;
         mem = delg->members;
 	
@@ -514,19 +514,17 @@
 	do_export( (GtkWidget *) NULL, 0 );
         
 	update_num_groups();
-
-
 }
 
 void remove_group(struct group *rem_g)
 {
-	GList *grp;
+	GSList *grp;
 	GList *mem;
 	
 	struct group *delg;
 	struct buddy *delb;
 
-	grp = g_list_find(groups, rem_g);
+	grp = g_slist_find(groups, rem_g);
         delg = (struct group *)grp->data;
         mem = delg->members;
 
@@ -540,7 +538,7 @@
 
 
 	gtk_tree_remove_items(GTK_TREE(buddies), g_list_append(NULL, delg->item));
-	groups = g_list_remove(groups, delg);
+	groups = g_slist_remove(groups, delg);
 	g_free(delg);
 
         serv_save_config();
@@ -596,7 +594,8 @@
 
 	
 	if (!parent) {
-		GList *grps, *buds;
+		GSList *grps;
+		GList *buds;
 		struct group *g, *g2;
 		GList *tmp, *mem;
 		int pos, count;
@@ -626,7 +625,7 @@
 		gtk_tree_remove_items(GTK_TREE(buddies), tmp);
 		g_list_free(tmp);
 
-                groups = g_list_remove(groups, g);
+                groups = g_slist_remove(groups, g);
 
                 g->item = gtk_tree_item_new_with_label(g->name);
 		mem = g->members; count = 0;
@@ -639,17 +638,17 @@
 
 		if (sibling) {
 			g2 = find_group(target2);
-                        pos = g_list_index(groups, g2);
+                        pos = g_slist_index(groups, g2);
                         if (pos == 0) {
-				groups = g_list_prepend(groups, g);
+				groups = g_slist_prepend(groups, g);
 				gtk_tree_prepend(GTK_TREE(buddies), g->item);
 			} else {
-				groups = g_list_insert(groups, g, pos);
+				groups = g_slist_insert(groups, g, pos);
 				gtk_tree_insert(GTK_TREE(buddies), g->item, pos);
 			}
          
 		} else {
-			groups = g_list_append(groups, g);
+			groups = g_slist_append(groups, g);
 			gtk_tree_append(GTK_TREE(buddies), g->item);
 
 		}
@@ -665,7 +664,6 @@
 
                 update_num_groups();
 
-
 		buds = g->members;
 
 		while(buds) {
@@ -677,7 +675,7 @@
 		grps = groups;
 		while(grps) {
 			g = (struct group *)grps->data;
-			grps = grps->next;
+			grps = g_slist_next(grps);
 		}
 
         } else {
@@ -774,7 +772,7 @@
 void build_edit_tree()
 {
         GtkCTreeNode *p = NULL, *n;
-	GList *grp = groups;
+	GSList *grp = groups;
 	GList *mem;
 	struct group *g;
 	struct buddy *b;
@@ -810,7 +808,7 @@
 			mem = mem->next;
                         
  		}
-		grp = grp->next;
+		grp = g_slist_next(grp);
 	}
 
 	gtk_clist_thaw(GTK_CLIST(edittree));
@@ -897,7 +895,7 @@
 		return NULL;
 
 	strncpy(g->name, group, sizeof(g->name));
-        groups = g_list_append(groups, g);
+        groups = g_slist_append(groups, g);
 
         if (blist == NULL)
                 return g;
@@ -1094,7 +1092,7 @@
 struct group *find_group(char *group)
 {
 	struct group *g;
-        GList *grp = groups;
+        GSList *grp = groups;
 	char *grpname = g_malloc(strlen(group) + 1);
 
 	strcpy(grpname, normalize(group));
@@ -1104,7 +1102,7 @@
 				g_free(grpname);
 				return g;
 		}
-		grp = grp->next;
+		grp = g_slist_next(grp);
 	}
 
 	g_free(grpname);
@@ -1117,7 +1115,7 @@
 {
 	struct group *g;
 	struct buddy *b;
-	GList *grp = groups;
+	GSList *grp = groups;
 	GList *mem;
         char *whoname = g_malloc(strlen(who) + 1);
 
@@ -1135,7 +1133,7 @@
 			}
 			mem = mem->next;
 		}
-		grp = grp->next;
+		grp = g_slist_next(grp);
 	}
 	g_free(whoname);
 	return NULL;
@@ -1146,7 +1144,7 @@
 {
 	struct group *g;
 	struct buddy *b;
-	GList *grp = groups;
+	GSList *grp = groups;
 	GList *mem;
         char *whoname = g_malloc(strlen(who) + 1);
 
@@ -1164,7 +1162,7 @@
 			}
 			mem = mem->next;
 		}
-		grp = grp->next;
+		grp = g_slist_next(grp);
 	}
 	g_free(whoname);
 	return NULL;
--- a/src/dialogs.c	Sun Oct 01 00:06:43 2000 +0000
+++ b/src/dialogs.c	Sun Oct 01 00:20:03 2000 +0000
@@ -927,7 +927,7 @@
 	GList *tmp=NULL;
         char *tmp2;
 	struct group *g;
-        GList *grp = groups;
+        GSList *grp = groups;
         
 	if (!grp) {
                 tmp2 = g_strdup(_("Buddies"));
@@ -937,7 +937,7 @@
 			g = (struct group *)grp->data;
                         tmp2 = g->name;
                         tmp=g_list_append(tmp, tmp2);
-			grp = grp->next;
+			grp = g_slist_next(grp);
 		}
 	}
 	return tmp;
@@ -3016,7 +3016,7 @@
 	g_free(away_message);
 
 	if (!ca->mess) {
-		away_messages = g_list_append(away_messages, am);
+		away_messages = g_slist_append(away_messages, am);
 		if (GTK_TOGGLE_BUTTON(ca->checkbx)->active)
 			do_away_message(NULL, am);
 	}
@@ -3024,7 +3024,7 @@
 	save_prefs();
 	do_away_menu();	
 	if (prefs_away_list != NULL)
-		gtk_list_select_item(GTK_LIST(prefs_away_list), g_list_index(away_messages, am));
+		gtk_list_select_item(GTK_LIST(prefs_away_list), g_slist_index(away_messages, am));
 	
 	destroy_dialog(NULL, ca->window);
 	
--- a/src/gaim.h	Sun Oct 01 00:06:43 2000 +0000
+++ b/src/gaim.h	Sun Oct 01 00:20:03 2000 +0000
@@ -414,7 +414,7 @@
 #define TYPE_SIGNOFF   4
 #define TYPE_KEEPALIVE 5
 
-#define REVISION "gaim:$Revision: 945 $"
+#define REVISION "gaim:$Revision: 950 $"
 #define FLAPON "FLAPON\r\n\r\n"
 
 #define ROAST "Tic/Toc"
@@ -458,8 +458,8 @@
 extern GList *deny;    /* The list of people denied */
 extern GList *log_conversations;
 extern GList *buddy_pounces;
-extern GList *away_messages;
-extern GList *groups;
+extern GSList *away_messages;
+extern GSList *groups;
 extern GList *buddy_chats;
 extern GList *conversations;
 extern GList *chat_rooms;
--- a/src/gaimrc.c	Sun Oct 01 00:06:43 2000 +0000
+++ b/src/gaimrc.c	Sun Oct 01 00:20:03 2000 +0000
@@ -207,14 +207,14 @@
 			g_snprintf(a->name, sizeof(a->name),  "%s", p->value[0]);
 			g_snprintf(a->message, sizeof(a->message), "%s", p->value[1]);
 			filter_break(a->message);
-			away_messages = g_list_append(away_messages, a);
+			away_messages = g_slist_append(away_messages, a);
 		}
 	}
 }
 
 static void gaimrc_write_away(FILE *f)
 {
-	GList *awy = away_messages;
+	GSList *awy = away_messages;
 	struct away_message *a;
 
 	fprintf(f, "away {\n");
@@ -235,7 +235,7 @@
 			free(str1);
 			free(str2);
 	
-			awy = awy->next;
+			awy = g_slist_next(awy);
 		}
 	}
 	else
@@ -670,7 +670,7 @@
        	 	}
        	 	if (away_messages)
        	 	{
-       	 		g_list_free(away_messages);
+       	 		g_slist_free(away_messages);
         		away_messages = NULL;
         	}
 	}
--- a/src/gnome_applet_mgr.c	Sun Oct 01 00:06:43 2000 +0000
+++ b/src/gnome_applet_mgr.c	Sun Oct 01 00:20:03 2000 +0000
@@ -186,7 +186,7 @@
 }
 
 void insert_applet_away() {
-	GList *awy = away_messages;
+	GSList *awy = away_messages;
 	struct away_message *a;
 	char  *awayname;
 
@@ -212,13 +212,13 @@
 			(AppletCallbackFunc)do_away_message,
 			a);
 
-		awy = awy->next;
+		awy = g_slist_next(awy);
 		free(awayname);
 	}
 }
 
 void remove_applet_away() {
-	GList *awy = away_messages;
+	GSList *awy = away_messages;
 	struct away_message *a;
 	char  *awayname;
 
@@ -233,7 +233,7 @@
 		strcat(awayname, a->name);
 		applet_widget_unregister_callback(APPLET_WIDGET(applet), awayname);
 
-		awy = awy->next;
+		awy = g_slist_next(awy);
 		free(awayname);
 	}
 	applet_widget_unregister_callback_dir(APPLET_WIDGET(applet), "away/");
--- a/src/perl.c	Sun Oct 01 00:06:43 2000 +0000
+++ b/src/perl.c	Sun Oct 01 00:20:03 2000 +0000
@@ -330,7 +330,7 @@
 {
 	struct buddy *buddy;
 	struct group *g;
-	GList *list = groups;
+	GSList *list = groups;
 	GList *mem;
 	int i = 0;
 	dXSARGS;
@@ -344,7 +344,7 @@
 			XST_mPV(i++, buddy->name);
 			mem = mem->next;
 		}
-		list = list->next;
+		list = g_slist_next(list);
 	}
 	XSRETURN(i);
 }
@@ -353,7 +353,7 @@
 {
 	struct buddy *b;
 	struct group *g;
-	GList *list = groups;
+	GSList *list = groups;
 	GList *mem;
 	int i = 0;
 	dXSARGS;
@@ -367,7 +367,7 @@
 			if (b->present) XST_mPV(i++, b->name);
 			mem = mem->next;
 		}
-		list = list->next;
+		list = g_slist_next(list);
 	}
 	XSRETURN(i);
 }
--- a/src/prefs.c	Sun Oct 01 00:06:43 2000 +0000
+++ b/src/prefs.c	Sun Oct 01 00:20:03 2000 +0000
@@ -1499,7 +1499,7 @@
 	GtkWidget *label;
 	GtkWidget *list_item;
 	GtkWidget *sep;
-	GList *awy = away_messages;
+	GSList *awy = away_messages;
 	struct away_message *a;
 	char buffer[BUF_LONG];
 
--- a/src/toc.c	Sun Oct 01 00:06:43 2000 +0000
+++ b/src/toc.c	Sun Oct 01 00:20:03 2000 +0000
@@ -822,7 +822,7 @@
 
 void toc_build_config(char *s, int len, gboolean show)
 {
-	GList *grp = groups;
+	GSList *grp = groups;
 	GList *mem;
 	struct group *g;
 	struct buddy *b;
@@ -845,7 +845,7 @@
 					show ? ":" : "", show ? b->show : "");
 			mem = mem->next;
 		}
-		grp = grp ->next;
+		grp = g_slist_next(grp);
 	}
 
 	while(plist) {