Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
pvr: recreate pvr views when the pvr db is reset
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed May 8, 2011
1 parent d1d81a4 commit abc1469
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion xbmc/pvr/PVRManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void CPVRManager::Process(void)
/* reset observers that are observing pvr related data in the pvr windows, or updates won't work after a reload */
CGUIWindowPVR *pWindow = (CGUIWindowPVR *) g_windowManager.GetWindow(WINDOW_PVR);
if (pWindow)
pWindow->ResetObservers();
pWindow->Reset();

/* start the other pvr related update threads */
m_addons->Start();
Expand Down
13 changes: 12 additions & 1 deletion xbmc/pvr/windows/GUIWindowPVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,21 @@ void CGUIWindowPVR::UnlockWindow(void)
}
}

void CGUIWindowPVR::ResetObservers(void)
void CGUIWindowPVR::Reset(void)
{
CSingleLock graphicsLock(g_graphicsContext);
CSingleLock lock(m_critSection);

if (m_bViewsCreated)
{
delete m_windowChannelsRadio;
delete m_windowChannelsTV;
delete m_windowGuide;
delete m_windowRecordings;
delete m_windowSearch;
delete m_windowTimers;
}

CreateViews();

m_windowChannelsRadio->ResetObservers();
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/windows/GUIWindowPVR.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace PVR
virtual void OnWindowLoaded(void);
virtual void OnWindowUnload(void);
virtual void InitializeEpgCache(void);
virtual void ResetObservers(void);
virtual void Reset(void);

void UnlockWindow();

Expand Down

0 comments on commit abc1469

Please sign in to comment.