<div class="gmail_quote">On Fri, Sep 16, 2011 at 1:18 AM, Jerry Rubinow <span dir="ltr">&lt;<a href="mailto:jerrymr@gmail.com" target="_blank">jerrymr@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="gmail_quote"><div><div></div><div>On Fri, Sep 16, 2011 at 12:31 AM, Michael T. Dean <span dir="ltr">&lt;<a href="mailto:mtdean@thirdcontact.com" target="_blank">mtdean@thirdcontact.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div>On 09/15/2011 09:58 PM, Jerry Rubinow wrote:<br>
&gt; On Thu, Sep 15, 2011 at 1:44 PM, Michael T. Dean&lt;<a href="mailto:mtdean@thirdcontact.com" target="_blank">mtdean@thirdcontact.com</a>&gt;wrote:<br>
&gt;<br>
&gt;&gt; On 09/15/2011 12:15 PM, Jerry Rubinow wrote:<br>
&gt;&gt;&gt; On Thu, Sep 15, 2011 at 12:06 PM, Stuart Morgan wrote:<br>
&gt;&gt;&gt;&gt; On Thursday 15 Sep 2011 07:44:51 Jerry Rubinow wrote:<br>
&gt;&gt;&gt;&gt;&gt; Would a patch be accepted which trimmed off trailing whitespace in the channel callsigns before doing the comparison for merging channels in the program guide?<br>
&gt;&gt;&gt;&gt; Would it not be easier in the long term to trim the whitespace at the time the callsign is inserted into the database instead of all the places that it&#39;s read back from the database?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; A one-off DB update could address the existing instances of trailing/leading whitespace.<br>
&gt;&gt; Ah, yeah, I misread it thinking he was asking about fixing the callsigns<br>
&gt;&gt; in the editors so they&#39;re put in the database correctly.  But, yeah, I<br>
&gt;&gt; agree it should be fixed upon insert--meaning we only need a fix for the<br>
&gt;&gt; 4 channel editors (mythtv-setup, frontend, MythWeb, and HTTP setup).<br>
&gt; I started looking at mythtv-setup, channeleditor.cpp to be specific.  I see<br>
&gt; where it reads the DB and populates the UI with the channel info, but I<br>
&gt; don&#39;t see how edited info gets back into the DB.  Background: lots of C++<br>
&gt; experience, not so much with QT, some DB work, enough to puzzle my way<br>
&gt; through understanding a query.<br>
&gt;<br>
<br>
</div></div>Looks like ChannelUtil::CreateChannel() and<br>
ChannelUtil::UpdateChannel(), which are probably used by the frontend<br>
editor, too.<br>
<br>
Also, it seems that the xmltv config(?) uses ChannelData::handleChannels().</blockquote><div><br></div></div></div><div>Ok, it looks like there are four places that UPDATE the channel table and one place that INSERTs into the channel table.  Would modifying these five places to trim trailing whitespace before modifying callsign cover all four channel editors?  </div>


<div><br></div><div>UPDATE:</div><div>libmythtv/tv_rec.cpp:</div><div><span style="white-space:pre-wrap">        </span>SetChannelInfo</div><div>mfdb/channeldata.cpp:</div><div><span style="white-space:pre-wrap">        </span>handleChannels</div>


<div>libmythtv/datadirect.cpp:</div><div><span style="white-space:pre-wrap">        </span>UpdateChannelsUnsafe</div><div>libmythtv/channelutil.cpp:</div><div><span style="white-space:pre-wrap">        </span>UpdateChannel</div>
<div><br></div><div>INSERT:</div><div>libmythtv/channelutil.cpp:</div><div><span style="white-space:pre-wrap">        </span>CreateChannel</div><div> </div><font color="#888888"><div>-Jerry</div></font></div>
</blockquote></div><br><div>I put trimmed() calls in all the above places, but mythtv-setup doesn&#39;t seem to use UpdateChannel in channelutil.cpp in the channel editor.  I&#39;m having a bit of trouble following the GUI code as far as finding the code path from channeleditor.cpp to any code which updates the database.  It looks like ChannelEditor::edit puts up the channel edit screen, using ChannelWizard, and then updates the main page when the user is done, using fillList. So I guess the updating must happen inside ChannelWizard, but I&#39;m unable to find any code path to database updating.  Any nudges in the right direction appreciated.</div>

<div><br></div><div>Also, Mike, you mentioned a frontend channel editor and HTTP setup channel editor - is the MFE channel editor somewhere in the setup screens?  What/where is the HTTP setup?</div><div><br></div><div>Thanks,</div>

<div>Jerry</div>