[mythtv] Trailing spaces in callsigns

Jerry Rubinow jerrymr at gmail.com
Tue Oct 11 02:58:40 UTC 2011


On Mon, Oct 10, 2011 at 9:15 AM, Daniel Kristjansson
<danielk at cuymedia.net>wrote:

> On Sat, 2011-10-08 at 23:24 -0400, Jerry Rubinow wrote:
>
> > I've managed to locate where the updated channel info is getting into
> > the database in the mythtv-setup channel editor, and the initial
> > suggestion from Mike and Stuart of simply trimming the argument to the
> > UPDATE/INSERT doesn't look like it is going to work in this case.  The
> > channel editor uses some kind of data-driven system which ends up
> > calling ConfigurationGroup::Save => SimpleDBStorage::Save, which is a
> > very generic method for updating table info and would have no idea
> > what and when to trim.  It just cycles through the list of data and
> > writes out each piece.  There may be a way to do it, but I don't
> > understand how the mythtv-setup UI system works in connection with the
> > data it's updating.
>
> SimpleDBStorage::GetSetClause(...) const is virtual, you can override it
> in the Callsign class in channelsettings.cpp. Make it something like:
>
> QString Callsign::GetSetClause(MSqlBindings &bindings) const
> {
>   QString tagname(":SET" + GetColumnName().toUpper());
>   QString clause(ChannelDBStorage::GetSetClause(bindings));
>   bindings[tagname] = user->GetDBValue().trimmed();
>   return clause;
> }
>
> Basically, this runs the parent's GetSetClause() method, but rebinds
> :SETCALLSIGN with a trimmed version of the callsign value.


Thanks Daniel, that worked perfectly.   And I have a mod for the mythweb
channel editor done too.

Now I just need to know where the channel editor in the frontend is (I feel
stupid asking, but I was unable to find it browsing through the menus), and
what HTTP setup is.  If those don't prove troublesome, I should be able to
generate a patch this week.

Thanks,
Jerry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mythtv.org/pipermail/mythtv-dev/attachments/20111010/20a5cb14/attachment.html 


More information about the mythtv-dev mailing list