[mythtv-commits] Re: Ticket #937: [PATCH]: mythfilldatabase --file tweaks

MythTV mythtv at cvs.mythtv.org
Thu Jan 5 06:14:19 UTC 2006


#937: [PATCH]: mythfilldatabase --file tweaks
--------------------------------+-------------------------------------------
 Reporter:  mcdmx at users.sf.net  |        Owner:  ijr 
     Type:  patch               |       Status:  new 
 Priority:  minor               |    Milestone:      
Component:  mythtv              |      Version:  head
 Severity:  medium              |   Resolution:      
--------------------------------+-------------------------------------------
Comment (by cpinkham):

 I haven't tested this yet since I don't use --file, but is the following
 line correct?

 QString tmp = (*i).name.stripWhiteSpace().upper();

 Shouldn't that be simplifyWhiteSpace() since you then split on spaces
 right below that?

 And stripWhiteSpace() returns a QString, it does not modify the QString in
 place, so the following line would not be stripped:

 t1.remove(4,t1.length()).stripWhiteSpace();

 Would something like this work and be easier to follow?

 QStringList words = QStringList::split(" ",
 (*i).name.simplifyWhiteSpace().upper();
 QString callsign = "";
 if (words[1].isEmpty())
 {
     callsign = words[0].left(5);
 }
 else
 {
     callsign = words[0].left(3);
     callsign += words[1].left(5-callsign.length());
 }
 (*i).callsign = callsign;

-- 
Ticket URL: <http://cvs.mythtv.org/trac/ticket/937>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list