e799659d7a2d201840dd99c1d021ab6dea1a60f9 max Sun Jan 5 13:39:33 2014 -0800 fixing slightly weird code in pubs track color reading diff --git src/hg/hgTracks/pubsTracks.c src/hg/hgTracks/pubsTracks.c index c6f9097..6ce5b8f 100644 --- src/hg/hgTracks/pubsTracks.c +++ src/hg/hgTracks/pubsTracks.c @@ -54,36 +54,36 @@ // support to ways to color: either by shade (year, impact) or directly with rgb values int shade; // year or impact are shades which we can't resolve to rgb easily struct rgbColor *color; }; /* assignment of pubs classes to colors */ static struct hash* pubsClassColors = NULL; static void pubsParseClassColors() /* parse class colors from hgFixed.pubsClassColors into the hash pubsClassColors */ { if (pubsClassColors!=NULL) return; pubsClassColors = hashNew(0); -struct sqlConnection *conn = hAllocConn(database); -if (!sqlTableExists(conn, "hgFixed.pubsClassColors")) +struct sqlConnection *conn = hAllocConn("hgFixed"); +if (!sqlTableExists(conn, "pubsClassColors")) { return; } -char *query = "NOSQLINJ SELECT class, rgbColor FROM hgFixed.pubsClassColors"; +char *query = "NOSQLINJ SELECT class, rgbColor FROM pubsClassColors"; struct sqlResult *sr = sqlGetResult(conn, query); char **row = NULL; while ((row = sqlNextRow(sr)) != NULL) { char *class = row[0]; char *colStr = row[1]; // copied from genePredItemClassColor - is there no function for this? // convert comma sep rgb string to array char *rgbVals[5]; chopString(colStr, ",", rgbVals, sizeof(rgbVals)); struct rgbColor *rgb; AllocVar(rgb); rgb->r = (sqlUnsigned(rgbVals[0])); rgb->g = (sqlUnsigned(rgbVals[1])); rgb->b = (sqlUnsigned(rgbVals[2]));