Ticket #3280: separate_functions.patch

File separate_functions.patch, 2.5 KB (added by gdragon at jetcom.org, 12 years ago)

Per suggestion: separated out IsMasterHost? and IsMasterBackend?. Also changed a couple previous calls to new function, IsMasterHost? which is the intended functionality of those cases.

  • libs/libmyth/mythcontext.cpp

     
    11091114    return d->m_backend;
    11101115}
    11111116
    1112 bool MythContext::IsMasterBackend(void)
     1117bool MythContext::IsMasterHost(void)
    11131118{
    11141119    QString myip = gContext->GetSetting("BackendServerIP");
    11151120    QString masterip = gContext->GetSetting("MasterServerIP");
     
    11171122    return (masterip == myip);
    11181123}
    11191124
     1125
     1126bool MythContext::IsMasterBackend(void)
     1127{
     1128    return (IsBackend() && IsMasterHost());
     1129}
     1130
    11201131bool MythContext::BackendIsRunning(void)
    11211132{
    11221133#if defined(CONFIG_DARWIN) || (__FreeBSD__) || defined(__OpenBSD__)
  • libs/libmyth/mythcontext.h

     
    260260                              bool blockingClient = false);
    261261    bool IsConnectedToMaster(void);
    262262    void SetBackend(bool backend);
    263     bool IsBackend(void);
    264     bool IsFrontendOnly(void);
    265     bool IsMasterBackend(void);
    266     bool BackendIsRunning(void);
    267263
     264    bool IsBackend(void);         // is this process a backend process
     265    bool IsFrontendOnly(void);    // is there there only a frontend running on this host
     266    bool IsMasterHost(void);      // is this the same host as the master
     267    bool IsMasterBackend(void);   // is this the actuall mbe process
     268    bool BackendIsRunning(void);  // a backend process is running on this host
     269
    268270    void BlockShutdown(void);
    269271    void AllowShutdown(void);
    270272   
  • programs/mythbackend/main.cpp

     
    581581        return BACKEND_EXIT_NO_IP_ADDRESS;
    582582    }
    583583
    584     bool ismaster = gContext->IsMasterBackend();
     584    bool ismaster = gContext->IsMasterHost();
    585585
    586586
    587587    if (ismaster)
  • programs/mythtv-setup/main.cpp

     
    344344    }
    345345    while (haveProblems);
    346346
    347     if (gContext->IsMasterBackend())
     347    if (gContext->IsMasterHost())
    348348    {
    349349        dia = new DialogBox(mainWindow,
    350350                            QObject::tr("If this is the master backend server, "