Ticket #7425: 0001-Fixes-7425.-Update-tree-position-remmeber-functiona.patch

File 0001-Fixes-7425.-Update-tree-position-remmeber-functiona.patch, 2.1 KB (added by mythtv@…, 2 years ago)

Fixes "Save tree position" functionality in MythVideo?

  • mythplugins/mythvideo/mythvideo/videodlg.cpp

    From f7d9331e9fbebeb218619e00bd86be5bd85ad93f Mon Sep 17 00:00:00 2001
    From: Pasha Golovko <mythtv@golovko.org>
    Date: Wed, 20 Jan 2010 14:31:11 -0800
    Subject: [PATCH] Fixes #7425. Update tree position remmeber functionality for post-MythUI changes.
    
    ---
     mythplugins/mythvideo/mythvideo/videodlg.cpp |   13 ++++++++++---
     1 files changed, 10 insertions(+), 3 deletions(-)
    
    diff --git a/mythplugins/mythvideo/mythvideo/videodlg.cpp b/mythplugins/mythvideo/mythvideo/videodlg.cpp
    index 24a6c1a..066cf85 100644
    a b class VideoDialogPrivate 
    14321432 
    14331433        if (m_rememberPosition && m_lastTreeNodePath.length()) 
    14341434        { 
     1435            VERBOSE(VB_GENERAL, QString("Saving tree position: %1").arg(m_lastTreeNodePath)); 
    14351436            gContext->SaveSetting("mythvideo.VideoTreeLastActive", 
    14361437                    m_lastTreeNodePath); 
    14371438        } 
    void VideoDialog::loadData() 
    17971798 
    17981799            if (m_d->m_rememberPosition) 
    17991800            { 
    1800                 QStringList route = 
    1801                         gContext->GetSetting("mythvideo.VideoTreeLastActive", 
    1802                                 "").split("\n"); 
     1801                /* 
     1802                 * We need to remove first element of the route since it is the name of the 
     1803                 * root 'Video Home' element 
     1804                 */ 
     1805                m_d->m_lastTreeNodePath = gContext->GetSetting("mythvideo.VideoTreeLastActive", ""); 
     1806                QStringList route = m_d->m_lastTreeNodePath.split("\n"); 
     1807                route.removeFirst();  
     1808                VERBOSE(VB_GENERAL, QString("Setting tree position: %1").arg(route.join("->"))); 
    18031809                m_videoButtonTree->SetNodeByString(route); 
    18041810            } 
    18051811        } 
    void VideoDialog::UpdateText(MythUIButtonListItem *item) 
    29162922 
    29172923    if (m_d->m_currentNode) 
    29182924        CheckedSet(m_crumbText, m_d->m_currentNode->getRouteByString().join(" > ")); 
     2925    m_d->m_lastTreeNodePath = m_d->m_currentNode->getRouteByString().join("\n"); 
    29192926 
    29202927    if (node && node->getInt() == kSubFolder) 
    29212928        CheckedSet(this, "childcount",