# HG changeset patch # User Eric Warmenhoven # Date 973071154 0 # Node ID 1528d05b3e6bb42d8c37516ddd0cdac999fe5e61 # Parent 8a4290984d1e89ad7a0ae1508f40a066b89782b4 [gaim-migrate @ 1053] insert protocols in sorted order. this may seem odd but it helps things in the account editor committer: Tailor Script diff -r 8a4290984d1e -r 1528d05b3e6b 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()