Ticket #2013: channel_zeros_prefix.patch

File channel_zeros_prefix.patch, 2.1 KB (added by russell@…, 19 years ago)

patch to fix changing channels with leading zeros

  • libs/libmythtv/tv_play.h

     
    464464    mutable QString queuedChanNum;
    465465    /// Queued ChanID (from EPG channel selector)
    466466    uint            queuedChanID;
    467     /// Used to strip unwanted characters from queuedChanNum
    468     QRegExp         queuedChanNumExpr;
    469467    /// Lock used so that input QStrings can be used across threads, and so
    470468    /// that queuedChanNumExpr can be used safely in Qt 3.2 and earlier.
    471469    mutable QMutex  queuedInputLock;
  • libs/libmythtv/tv_play.cpp

     
    306306      asInputMode(false), asInputModeExpires(QTime::currentTime()),
    307307      // Channel changing state variables
    308308      queuedChanNum(""),
    309       queuedChanNumExpr(QRegExp("([1-9]|\\w)")),
    310309      muteTimer(new QTimer(this)),
    311310      lockTimerOn(false),
    312311      // previous channel functionality state variables
     
    335334      // Window info (GUI is optional, transcoding, preview img, etc)
    336335      myWindow(NULL), embedWinID(0), embedBounds(0,0,0,0)
    337336{
    338     queuedChanNumExpr.setMinimal(true); // we don't need greedy matching
    339 
    340337    for (uint i = 0; i < 2; i++)
    341338    {
    342339        pseudoLiveTVRec[i]   = NULL;
     
    38963893    if (!queuedChanNum.isEmpty())
    38973894    {
    38983895        // strip initial zeros.
    3899         int nzi = queuedChanNum.find(queuedChanNumExpr);
    3900         if (nzi > 0)
    3901             queuedChanNum = queuedChanNum.right(queuedChanNum.length() - nzi);
     3896        while (queuedChanNum.startsWith("0"))
     3897            queuedChanNum = queuedChanNum.right(queuedChanNum.length() - 1);
    39023898        queuedChanNum.stripWhiteSpace();
    39033899    }
    39043900
     
    40664062             !pseudoLiveTVState[(activenvp == nvp) ? 0 : 1])
    40674063    {
    40684064        QString channum = GetQueuedChanNum();
    4069         QString chaninput = GetQueuedInput();
    40704065        if (browsemode)
    40714066        {
    40724067            commited = true;