Ticket #1586: trunk_9499_lcd.patch

File trunk_9499_lcd.patch, 1.6 KB (added by perveilerj@…, 18 years ago)

patch against trunk r9499

  • libs/libmyth/lcddevice.cpp

     
    7272    connect(LEDTimer,   SIGNAL(timeout()),   this, SLOT(outputLEDs()));
    7373}
    7474
     75bool LCD::m_enabled = false;
    7576bool LCD::m_server_unavailable = false;
    7677class LCD * LCD::m_lcd = NULL;
    7778
    7879class LCD * LCD::Get(void)
    7980{
    80     if (m_lcd == NULL && m_server_unavailable == false)
     81    if (m_enabled && m_lcd == NULL && m_server_unavailable == false)
    8182        m_lcd = new LCD;
    8283    return m_lcd;
    8384}
     
    9697
    9798    lcd_host = gContext->GetSetting("LCDServerHost", "localhost");
    9899    lcd_port = gContext->GetNumSetting("LCDServerPort", 6545);
     100    m_enabled  = gContext->GetNumSetting("LCDEnable", 0) != 0;
    99101
    100     if (lcd_host.length() > 0 && lcd_port > 1024)
     102    if (m_enabled && lcd_host.length() > 0 && lcd_port > 1024)
    101103    {
    102104        class LCD * lcd = LCD::Get();
    103105        if (lcd->connectToHost(lcd_host, lcd_port) == false)
     
    127129    port = lport;
    128130   
    129131    // Don't even try to connect if we're currently disabled.
    130     if (!gContext->GetNumSetting("LCDEnable", 0))
     132    if (!(m_enabled = gContext->GetNumSetting("LCDEnable", 0)))
    131133    {
    132134        connected = false;
    133135        m_server_unavailable = true;
  • libs/libmyth/lcddevice.h

     
    104104  protected:
    105105    LCD();
    106106
     107    static bool m_enabled;
    107108    static bool m_server_unavailable;
    108109    static class LCD * m_lcd;
    109110