[mythtv] [PATCH] uitypes.cpp - GenericTree

DanM dan at milkcarton.com
Tue Sep 30 21:07:34 EDT 2003


This patch add .stripWhiteSpace() to all prototypes of 
GenericTree::addNode.  It fixes a problem where \n is displayed in the tree.

-dan

-- 
main(){int j=1234;char t[]=":@abcdefghijklmnopqrstuvwxyz.\n",*i=
"iqgbgxmdzlolyb\nu.pax\nlek.n";char *strchr(const char*,int);
while(*i){j+=strchr(t,*i++)-t;j%=sizeof t-1;putchar(t[j]);}return 0;} 

-------------- next part --------------
Index: uitypes.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/uitypes.cpp,v
retrieving revision 1.50
diff -u -d -r1.50 uitypes.cpp
--- uitypes.cpp	26 Sep 2003 21:32:18 -0000	1.50
+++ uitypes.cpp	1 Oct 2003 03:58:06 -0000
@@ -1781,7 +1781,7 @@
 
 GenericTree* GenericTree::addNode(QString a_string)
 {
-    GenericTree *new_node = new GenericTree(a_string);
+    GenericTree *new_node = new GenericTree(a_string.stripWhiteSpace());
     new_node->setParent(this);
     my_subnodes.append(new_node);
     my_ordered_subnodes.append(new_node);
@@ -1791,7 +1791,7 @@
 
 GenericTree* GenericTree::addNode(QString a_string, int an_int)
 {
-    GenericTree *new_node = new GenericTree(a_string);
+    GenericTree *new_node = new GenericTree(a_string.stripWhiteSpace());
     new_node->setInt(an_int);
     new_node->setParent(this);
     my_subnodes.append(new_node);
@@ -1801,7 +1801,7 @@
 
 GenericTree* GenericTree::addNode(QString a_string, int an_int, bool selectable_flag)
 {
-    GenericTree *new_node = new GenericTree(a_string);
+    GenericTree *new_node = new GenericTree(a_string.stripWhiteSpace());
     new_node->setInt(an_int);
     new_node->setParent(this);
     new_node->setSelectable(selectable_flag);


More information about the mythtv-dev mailing list