Ticket #10046: mythtv.patch

File mythtv.patch, 4.6 KB (added by Jerry Rubinow <jerrymr@…>, 8 years ago)
  • mythtv/libs/libmythtv/channelsettings.cpp

    diff --git a/mythtv/libs/libmythtv/channelsettings.cpp b/mythtv/libs/libmythtv/channelsettings.cpp
    index e03829f..bb0f96f 100644
    a b QString ChannelDBStorage::GetSetClause(MSqlBindings &bindings) const 
    2727                  GetColumnName() + " = " + nameTag);
    2828
    2929    bindings.insert(fieldTag, id.getValue());
    30     bindings.insert(nameTag, user->GetDBValue());
     30
     31    if (trimTagValue)
     32    {
     33        bindings.insert(nameTag, user->GetDBValue().trimmed());
     34    }
     35    else
     36    {
     37        bindings.insert(nameTag, user->GetDBValue());
     38    }
    3139
    3240    return query;
    3341}
    class Name : public LineEditSetting, public ChannelDBStorage 
    4048{
    4149  public:
    4250    Name(const ChannelID &id) :
    43         LineEditSetting(this), ChannelDBStorage(this, id, "name")
     51        LineEditSetting(this), ChannelDBStorage(this, id, "name", true)
    4452    {
    4553        setLabel(QObject::tr("Channel Name"));
    4654    }
    class Channum : public LineEditSetting, public ChannelDBStorage 
    5058{
    5159  public:
    5260    Channum(const ChannelID &id) :
    53         LineEditSetting(this), ChannelDBStorage(this, id, "channum")
     61        LineEditSetting(this), ChannelDBStorage(this, id, "channum", true)
    5462    {
    5563        setLabel(QObject::tr("Channel Number"));
    5664    }
    class Callsign : public LineEditSetting, public ChannelDBStorage 
    114122{
    115123  public:
    116124    Callsign(const ChannelID &id) :
    117         LineEditSetting(this), ChannelDBStorage(this, id, "callsign")
     125        LineEditSetting(this), ChannelDBStorage(this, id, "callsign", true)
    118126    {
    119127        setLabel(QObject::tr("Callsign"));
    120128    }
  • mythtv/libs/libmythtv/channelsettings.h

    diff --git a/mythtv/libs/libmythtv/channelsettings.h b/mythtv/libs/libmythtv/channelsettings.h
    index 381ee44..c6a7d53 100644
    a b protected: 
    102102
    103103class ChannelDBStorage : public SimpleDBStorage
    104104{
     105  private:
     106    bool trimTagValue;
     107
    105108  protected:
    106     ChannelDBStorage(StorageUser *_user, const ChannelID &_id, QString _name) :
    107         SimpleDBStorage(_user, "channel", _name), id(_id) { }
     109    ChannelDBStorage(StorageUser *_user, const ChannelID &_id, QString _name, bool _trimTagValue = false) :
     110        SimpleDBStorage(_user, "channel", _name), id(_id), trimTagValue(_trimTagValue) { }
    108111
    109112    virtual QString GetSetClause(MSqlBindings &bindings) const;
    110113    virtual QString GetWhereClause(MSqlBindings &bindings) const;
  • mythtv/libs/libmythtv/channelutil.cpp

    diff --git a/mythtv/libs/libmythtv/channelutil.cpp b/mythtv/libs/libmythtv/channelutil.cpp
    index b872986..48d9500 100644
    a b bool ChannelUtil::CreateChannel(uint db_mplexid, 
    15741574    query.prepare(qstr);
    15751575
    15761576    query.bindValue(":CHANID",    new_channel_id);
    1577     query.bindValue(":CHANNUM",   chanNum);
     1577    query.bindValue(":CHANNUM",   chanNum.trimmed());
    15781578    query.bindValue(":SOURCEID",  db_sourceid);
    1579     query.bindValue(":CALLSIGN",  callsign);
    1580     query.bindValue(":NAME",      service_name);
     1579    query.bindValue(":CALLSIGN",  callsign.trimmed());
     1580    query.bindValue(":NAME",      service_name.trimmed());
    15811581
    15821582    if (db_mplexid > 0)
    15831583        query.bindValue(":MPLEXID",   db_mplexid);
    bool ChannelUtil::UpdateChannel(uint db_mplexid, 
    16581658    query.bindValue(":CHANID", channel_id);
    16591659
    16601660    if (set_channum)
    1661         query.bindValue(":CHANNUM", chan_num);
     1661        query.bindValue(":CHANNUM", chan_num.trimmed());
    16621662
    16631663    query.bindValue(":SOURCEID",  source_id);
    1664     query.bindValue(":CALLSIGN",  callsign);
    1665     query.bindValue(":NAME",      service_name);
     1664    query.bindValue(":CALLSIGN",  callsign.trimmed());
     1665    query.bindValue(":NAME",      service_name.trimmed());
    16661666
    16671667    query.bindValue(":MPLEXID",   db_mplexid);
    16681668
  • mythtv/libs/libmythtv/tv_rec.cpp

    diff --git a/mythtv/libs/libmythtv/tv_rec.cpp b/mythtv/libs/libmythtv/tv_rec.cpp
    index 2eedf68..a8506d5 100644
    a b bool TVRec::SetChannelInfo(uint chanid, uint sourceid, 
    31873187        "    xmltvid  = :XMLTVID   "
    31883188        "WHERE chanid   = :CHANID AND "
    31893189        "      sourceid = :SOURCEID");
    3190     query.bindValue(":CALLSIGN", callsign);
    3191     query.bindValue(":CHANNUM",  channum);
    3192     query.bindValue(":CHANNAME", channame);
     3190    query.bindValue(":CALLSIGN", callsign.trimmed());
     3191    query.bindValue(":CHANNUM",  channum.trimmed());
     3192    query.bindValue(":CHANNAME", channame.trimmed());
    31933193    query.bindValue(":XMLTVID",  xmltvid);
    31943194    query.bindValue(":CHANID",   chanid);
    31953195    query.bindValue(":SOURCEID", sourceid);