Ticket #13544: mythuiwebbrowser.diff

File mythuiwebbrowser.diff, 2.1 KB (added by paul-h, 7 years ago)

Possible fix

  • mythtv/libs/libmythui/mythuiwebbrowser.cpp

    diff --git a/mythtv/libs/libmythui/mythuiwebbrowser.cpp b/mythtv/libs/libmythui/mythuiwebbrowser.cpp
    index 34b448adfe..2f59307c5b 100644
    a b void MythUIWebBrowser::Finalize(void)  
    872872 */
    873873void MythUIWebBrowser::Init(void)
    874874{
     875    // only do the initialisation for widgets not being stored in the global object store
     876    if (parent() == GetGlobalObjectStore())
     877        return;
     878   
    875879    if (m_initialized)
    876880        return;
    877881
    void MythUIWebBrowser::SetBackgroundColor(QColor color)  
    11271131 */
    11281132void MythUIWebBrowser::SetActive(bool active)
    11291133{
     1134    if (!m_browser)
     1135        return;
     1136
    11301137    if (m_active == active)
    11311138        return;
    11321139
    QVariant MythUIWebBrowser::evaluateJavaScript(const QString &scriptSource)  
    13251332
    13261333void MythUIWebBrowser::Scroll(int dx, int dy)
    13271334{
     1335    if (!m_browser)
     1336        return;
     1337
    13281338    QPoint startPos = m_browser->page()->currentFrame()->scrollPosition();
    13291339    QPoint endPos = startPos + QPoint(dx, dy);
    13301340
    bool MythUIWebBrowser::IsOnTopScreen(void)  
    14341444
    14351445void MythUIWebBrowser::UpdateScrollBars(void)
    14361446{
     1447    if (!m_browser)
     1448        return;
     1449
    14371450    QPoint position = m_browser->page()->currentFrame()->scrollPosition();
    14381451    if (m_verticalScrollbar)
    14391452    {
    void MythUIWebBrowser::UpdateBuffer(void)  
    14601473{
    14611474    UpdateScrollBars();
    14621475
    1463     if (!m_image)
     1476    if (!m_image || !m_browser)
    14641477        return;
    14651478
    14661479    if (!m_active || (m_active && !m_browser->hasFocus()))
    void MythUIWebBrowser::UpdateBuffer(void)  
    14791492 */
    14801493void MythUIWebBrowser::Pulse(void)
    14811494{
     1495    if (!m_browser)
     1496        return;
     1497
    14821498    if (m_scrollAnimation.IsActive() &&
    14831499        m_destinationScrollPos !=
    14841500        m_browser->page()->currentFrame()->scrollPosition())
    void MythUIWebBrowser::DrawSelf(MythPainter *p, int xoffset, int yoffset,  
    15211537 */
    15221538bool MythUIWebBrowser::keyPressEvent(QKeyEvent *event)
    15231539{
     1540    if (!m_browser)
     1541        return false;
     1542
    15241543    QStringList actions;
    15251544    bool handled = false;
    15261545    handled = GetMythMainWindow()->TranslateKeyPress("Browser", event, actions);