Ticket #876: mythtv_remoteblock.patch

File mythtv_remoteblock.patch, 2.5 KB (added by Mark Spieth, 18 years ago)
  • libs/libmythtv/remoteutil.cpp

     
    351351{
    352352    QStringList strlist = "QUERY_ISRECORDING";
    353353
    354     if (!gContext->SendReceiveStringList(strlist))
     354    if (!gContext->SendReceiveStringList(strlist, false, false))
    355355        return -1;
    356356
    357357    return strlist[0].toInt();
  • libs/libmyth/mythcontext.h

     
    359361    QPixmap *LoadScalePixmap(QString filename, bool fromcache = true);
    360362    QImage *LoadScaleImage(QString filename, bool fromcache = true);
    361363
    362     bool SendReceiveStringList(QStringList &strlist, bool quickTimeout = false);
     364    bool SendReceiveStringList(QStringList &strlist, bool quickTimeout = false,
     365                               bool block = true);
    363366
    364367    QImage *CacheRemotePixmap(const QString &url, bool reCache = false);
    365368
  • libs/libmyth/mythcontext.cpp

     
    22732273    ClearSettingsCache(key, newValue);
    22742274}
    22752275
    2276 bool MythContext::SendReceiveStringList(QStringList &strlist, bool quickTimeout)
     2276bool MythContext::SendReceiveStringList(QStringList &strlist, bool quickTimeout, bool block)
    22772277{
    22782278    d->serverSockLock.lock();
    22792279   
    22802280    if (!d->serverSock)
     2281    {
    22812282        ConnectToMasterServer(false);
     2283        // should clear popup if it is currently active here. Not sure of the correct way. TBD
     2284    }
    22822285
    22832286    bool ok = false;
    22842287   
     
    23122315
    23132316        if (!ok)
    23142317        {
     2318            delete d->serverSock;
     2319            d->serverSock = NULL;
     2320
    23152321            qApp->lock();
     2322            if (!block)
     2323                d->serverSockLock.unlock();
    23162324            VERBOSE(VB_ALL, QString("Reconnection to backend server failed"));
    23172325            MythPopupBox::showOkPopup(d->mainWindow, "connection failure",
    23182326                             tr("The connection to the master backend "
    23192327                                "server has gone away for some reason.. "
    23202328                                "Is it running?"));
    23212329
    2322             delete d->serverSock;
    2323             d->serverSock = NULL;
     2330            if (!block)
     2331                d->serverSockLock.lock();
    23242332            qApp->unlock();
    23252333        }
    23262334    }