1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

* Fixed not properly deleting temporary pages.

This commit is contained in:
Christian Muehlhaeuser
2012-06-21 18:25:38 +02:00
parent cccd5db05a
commit d46889706b

View File

@@ -611,19 +611,22 @@ ViewManager::historyPages() const
void
ViewManager::destroyPage( ViewPage* page )
{
if ( !page )
return;
tDebug() << Q_FUNC_INFO << "Deleting page:" << page->title();
if ( m_currentPage == page )
{
delete page;
m_currentPage = 0;
historyBack();
return;
}
QList< Tomahawk::ViewPage* > p = historyPages();
if ( p.contains( page ) )
historyBack();
}
else if ( historyPages().contains( page ) )
{
m_pageHistoryBack.removeAll( page );
m_pageHistoryFwd.removeAll( page );
emit historyBackAvailable( m_pageHistoryBack.count() );
emit historyForwardAvailable( m_pageHistoryFwd.count() );