# HG changeset patch # User Eric Warmenhoven # Date 973071154 0 # Node ID 45ec860a254cd7eac7bf48d294d897f2066320a4 # Parent db1e7e936587373cd44db3cd6c4e2d5cc8574593 [gaim-migrate @ 1053] insert protocols in sorted order. this may seem odd but it helps things in the account editor diff -r db1e7e936587 -r 45ec860a254c src/prpl.c --- a/src/prpl.c Wed Nov 01 09:14:07 2000 +0000 +++ b/src/prpl.c Wed Nov 01 09:32:34 2000 +0000 @@ -41,10 +41,16 @@ return NULL; } +static gint proto_compare(struct prpl *a, struct prpl *b) { + /* neg if a before b, 0 if equal, pos if a after b */ + return a->protocol - b->protocol; +} + void load_protocol(proto_init pi) { struct prpl *p = g_new0(struct prpl, 1); struct prpl *old; + GSList *n = protocols; pi(p); if (old = find_prpl(p->protocol)) { GSList *c = connections; @@ -65,7 +71,7 @@ protocols = g_slist_remove(protocols, old); g_free(old); } - protocols = g_slist_append(protocols, p); + protocols = g_slist_insert_sorted(protocols, p, (GCompareFunc)proto_compare); } void static_proto_init()