src/hg/lib/hdb.c 1.423

1.423 2010/03/23 00:57:01 braney
third times the charm. hTrackDb now returns list sorted by priority
Index: src/hg/lib/hdb.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/hdb.c,v
retrieving revision 1.422
retrieving revision 1.423
diff -b -B -U 4 -r1.422 -r1.423
--- src/hg/lib/hdb.c	19 Mar 2010 17:53:10 -0000	1.422
+++ src/hg/lib/hdb.c	23 Mar 2010 00:57:01 -0000	1.423
@@ -3332,9 +3332,8 @@
 	    }
         }
     }
 
-slReverse(tdbList);
 hFreeConn(&conn);
 return exists;
 }
 
@@ -3526,15 +3525,17 @@
 /* Load tracks associated with current chromosome (which may be NULL for
  * all).  Supertracks are loaded as a trackDb, but are not in the returned list,
  * but are accessible via the parent pointers of the member tracks.  Also,
  * the supertrack trackDb subtrack fields are not set here (would be
- * incompatible with the returned list) */
+ * incompatible with the returned list).
+ * Returns list sorted by priority */
 {
 struct trackDb *tdbList = loadTrackDb(db, NULL);
 tdbList = trackDbLinkUpGenerations(tdbList);
 tdbList = pruneEmpties(tdbList, db, chrom, hIsPrivateHost(), 0);
 trackDbCompositeMarkup(NULL, tdbList);
 rInheritFields(tdbList);
+slSort(&tdbList, trackDbCmp);
 return tdbList;
 }
 
 static struct trackDb *loadAndLookupTrackDb(struct sqlConnection *conn,