00aee5a29696330531412216c28e60c57c8574b0
tdreszer
Tue May 10 15:04:50 2011 -0700
Cleaned up some not needed code.
diff --git src/hg/hgFileUi/hgFileUi.c src/hg/hgFileUi/hgFileUi.c
index 8ee1896..be4f7b3 100644
--- src/hg/hgFileUi/hgFileUi.c
+++ src/hg/hgFileUi/hgFileUi.c
@@ -3,32 +3,30 @@
#include "hash.h"
#include "cheapcgi.h"
#include "htmshell.h"
#include "jsHelper.h"
#include "trackDb.h"
#include "hdb.h"
#include "web.h"
#include "mdb.h"
#include "hCommon.h"
#include "hui.h"
#include "fileUi.h"
#define MAIN_FORM "mainForm"
#define WIGGLE_HELP_PAGE "../goldenPath/help/hgWiggleTrackHelp.html"
-struct hash *trackHash = NULL; /* Hash of all tracks in database. */
-
void fileUi(struct cart *cart,struct trackDb *tdb, char *db, char *chrom, boolean ajax)
// Downloadable Files UI
{
if (!ajax)
{
jsIncludeFile("jquery.js", NULL);
webIncludeResourceFile("jquery-ui.css");
jsIncludeFile("jquery-ui.js", NULL);
jsIncludeFile("utils.js",NULL);
}
// QUESTION: Is this needed? Are we doing a submit on hgTrackUi to get here?? Probably not.
//if(tdbIsContainer(tdb) && !ajax)
// cartTdbTreeReshapeIfNeeded(cart,tdb);
@@ -94,75 +92,54 @@
printPennantIconNote(tdb);
puts(tdb->html);
printf("
");
cgiDown(0.7); // positions top link below line
makeTopLink(tdb);
printf("  | ");
makeTopLink(tdb);
printf("  |
");
}
}
void doMiddle(struct cart *cart)
/* Write body of web page. */
{
-struct trackDb *tdbList = NULL;
struct trackDb *tdb = NULL;
char *track;
char *ignored;
char *db = NULL;
track = cartString(cart, "g"); // QUESTION: Should this be 'f' ??
getDbAndGenome(cart, &db, &ignored, NULL);
char *chrom = cartUsualString(cart, "c", hDefaultChrom(db));
-// QUESTION: Do We need track list ??? trackHash ??? Can't we just get one track and no children
-// ANSWER: The way the code is set up now you will get the whole list. This is just to put all
-// the logic for resolving loading parents and children in one place. We do occassionally pay the
-// price of a 200 millisecond delay because of it though - JK.
-trackHash = trackHashMakeWithComposites(db,chrom,&tdbList,FALSE);
-tdb = tdbForTrack(db, track,&tdbList);
+tdb = tdbForTrack(db, track,NULL);// We only need to see one tdb.
if (tdb == NULL)
{
errAbort("Can't find %s in track database %s", track, db);
return;
}
cartWebStart(cart, db, "%s %s", tdb->shortLabel, DOWNLOADS_ONLY_TITLE);
if (!tdbIsComposite(tdb) && !tdbIsDownloadsOnly(tdb))
{
warn("Track '%s' of type %s is not supported by hgFileUi.",track, tdb->type);
return;
}
-// QUESTION: Do we need superTrack? If we have lnk to superTrack, then yes.
-// ANSWER: No, you shouldn't need to do this here. The call that generated the
-// tdbList already took care of this. -JK
-#ifdef UNNEEDED
-char *super = trackDbGetSupertrackName(tdb);
-if (super)
- {
- if (tdb->parent) // configured as a supertrack member in trackDb
- {
- tdbMarkAsSuperTrack(tdb->parent);
- trackDbSuperMemberSettings(tdb);
- }
- }
-#endif /* UNNEEDED */
-
fileUi(cart, tdb, db, chrom, FALSE);
printf("
\n");
webEnd();
}
char *excludeVars[] = { "submit", "Submit", "g", NULL, "ajax", NULL,}; // HOW IS 'ajax" going to be supported?
int main(int argc, char *argv[])
/* Process command line. */
{
cgiSpoof(&argc, argv);
htmlSetBackground(hBackgroundImage());
cartEmptyShell(doMiddle, hUserCookie(), excludeVars, NULL);
return 0;