src/hg/oneShot/tdbRewriteViewsToSubtracks/tdbRewriteViewsToSubtracks.c 1.2

1.2 2009/12/10 03:06:25 kent
Adding shortLabel to view. Fixing small indentation problem.
Index: src/hg/oneShot/tdbRewriteViewsToSubtracks/tdbRewriteViewsToSubtracks.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/oneShot/tdbRewriteViewsToSubtracks/tdbRewriteViewsToSubtracks.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 4 -r1.1 -r1.2
--- src/hg/oneShot/tdbRewriteViewsToSubtracks/tdbRewriteViewsToSubtracks.c	9 Dec 2009 17:38:19 -0000	1.1
+++ src/hg/oneShot/tdbRewriteViewsToSubtracks/tdbRewriteViewsToSubtracks.c	10 Dec 2009 03:06:25 -0000	1.2
@@ -491,19 +491,20 @@
 char *line = lmCloneString(lm, viewSubGroupTag->val);
 char *viewWord = nextWord(&line);
 assert(sameString(viewWord, "view"));
 char *viewLabelWord = nextWord(&line);
-struct slName *viewList = NULL;
+struct slPair *viewList = NULL;
 char *thisEqThat;
 while ((thisEqThat = nextWord(&line)) != NULL)
     {
     char *eq = strchr(thisEqThat, '=');
     if (eq == NULL)
         recordAbort(complexRecord, "expecting this=that got %s in %s tag", 
 		eq, viewSubGroupTag->name);
     *eq = 0;
-    slNameAddTail(&viewList, thisEqThat);
+    slPairAdd(&viewList, thisEqThat, lmCloneString(lm, eq+1));
     }
+slReverse(&viewList);
 
 /* Write self, the parent record.  This is just most but not all tags of the original record,
  * omitting settingsByView and visibilityViewDefaults which will be moved into the view. */
 struct raTag *t;
@@ -536,9 +537,9 @@
 	if (settings == NULL)
 	    recordAbort(complexRecord, "missing colon in settingsByView '%s'", viewName);
 	struct slPair *el, *list = NULL;
 	*settings++ = 0;
-	if (!slNameInListUseCase(viewList, viewName))
+	if (!slPairFind(viewList, viewName))
 	    recordAbort(complexRecord, "View '%s' in settingsByView is not defined in subGroup",
 	    	viewName);
 	char *words[32];
 	int cnt,ix;
@@ -561,15 +562,16 @@
 	}
     }
 
 /* Go through each view and write it, and then the children who are in that view. */
-struct slName *view;
+struct slPair *view;
 for (view = viewList; view != NULL; view = view->next)
     {
     char viewTrackName[256];
     safef(viewTrackName, sizeof(viewTrackName), "%sView%s", complexRecord->key, view->name);
     fprintf(f, "\n");	/* Blank line to open view. */
-    fprintf(f, "track %s\n", viewTrackName);
+    fprintf(f, "    track %s\n", viewTrackName);
+    fprintf(f, "    shortLabel %s\n", (char*)view->val);
     if (visHash != NULL)
         {
 	char *vis = hashFindVal(visHash, view->name);
 	if (vis != NULL)