aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2016-06-28 10:10:46 +0200
committerGitHub <noreply@github.com>2016-06-28 10:10:46 +0200
commitc605aa8d029d7aa9fcb4a37f531f39d40d9a1e89 (patch)
tree6b7ea2167333b324ba0ff048626ea3269d76fde2
parent1f9e2a2cdc5b96c944bf4f5494dadd2cd0600518 (diff)
parent1ab2edf338a70274983263bf980a982a1b0f74e6 (diff)
Merge pull request #10036 from ksooo/pvr-fix-timer-icon-issues
[PVR] Guide window: Fix timer icon issues. Fixes #16621
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRBase.cpp16
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRBase.h6
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRChannels.cpp9
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRGuide.cpp24
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRRecordings.cpp14
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp7
6 files changed, 55 insertions, 21 deletions
diff --git a/xbmc/pvr/windows/GUIWindowPVRBase.cpp b/xbmc/pvr/windows/GUIWindowPVRBase.cpp
index c228c87249..3308ffccff 100644
--- a/xbmc/pvr/windows/GUIWindowPVRBase.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRBase.cpp
@@ -94,6 +94,20 @@ void CGUIWindowPVRBase::ResetObservers(void)
RegisterObservers();
}
+void CGUIWindowPVRBase::RegisterObservers(void)
+{
+ CSingleLock lock(m_critSection);
+ if (m_group)
+ m_group->RegisterObserver(this);
+};
+
+void CGUIWindowPVRBase::UnregisterObservers(void)
+{
+ CSingleLock lock(m_critSection);
+ if (m_group)
+ m_group->UnregisterObserver(this);
+};
+
void CGUIWindowPVRBase::Notify(const Observable &obs, const ObservableMessage msg)
{
CGUIMessage m(GUI_MSG_REFRESH_LIST, GetID(), 0, msg);
@@ -374,7 +388,7 @@ CPVRChannelGroupPtr CGUIWindowPVRBase::GetGroup(void)
return m_group;
}
-void CGUIWindowPVRBase::SetGroup(CPVRChannelGroupPtr group)
+void CGUIWindowPVRBase::SetGroup(const CPVRChannelGroupPtr &group)
{
CSingleLock lock(m_critSection);
if (!group)
diff --git a/xbmc/pvr/windows/GUIWindowPVRBase.h b/xbmc/pvr/windows/GUIWindowPVRBase.h
index 414367abdf..ebf134709f 100644
--- a/xbmc/pvr/windows/GUIWindowPVRBase.h
+++ b/xbmc/pvr/windows/GUIWindowPVRBase.h
@@ -97,7 +97,7 @@ namespace PVR
virtual std::string GetDirectoryPath(void) = 0;
virtual CPVRChannelGroupPtr GetGroup(void);
- virtual void SetGroup(CPVRChannelGroupPtr group);
+ virtual void SetGroup(const CPVRChannelGroupPtr &group);
virtual bool ActionShowTimerRule(CFileItem *item);
virtual bool ActionToggleTimer(CFileItem *item);
@@ -119,8 +119,8 @@ namespace PVR
bool OnContextButtonEditTimerRule(CFileItem *item, CONTEXT_BUTTON button);
bool OnContextButtonDeleteTimerRule(CFileItem *item, CONTEXT_BUTTON button);
- virtual void RegisterObservers(void) {};
- virtual void UnregisterObservers(void) {};
+ virtual void RegisterObservers(void);
+ virtual void UnregisterObservers(void);
static CCriticalSection m_selectedItemPathsLock;
static std::string m_selectedItemPaths[2];
diff --git a/xbmc/pvr/windows/GUIWindowPVRChannels.cpp b/xbmc/pvr/windows/GUIWindowPVRChannels.cpp
index 493db65f53..8580529703 100644
--- a/xbmc/pvr/windows/GUIWindowPVRChannels.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRChannels.cpp
@@ -56,17 +56,20 @@ void CGUIWindowPVRChannels::RegisterObservers(void)
{
CSingleLock lock(m_critSection);
g_EpgContainer.RegisterObserver(this);
- g_PVRTimers->RegisterObserver(this);
+ if (g_PVRTimers)
+ g_PVRTimers->RegisterObserver(this);
g_infoManager.RegisterObserver(this);
+ CGUIWindowPVRBase::RegisterObservers();
}
void CGUIWindowPVRChannels::UnregisterObservers(void)
{
CSingleLock lock(m_critSection);
- g_EpgContainer.UnregisterObserver(this);
+ CGUIWindowPVRBase::UnregisterObservers();
+ g_infoManager.UnregisterObserver(this);
if (g_PVRTimers)
g_PVRTimers->UnregisterObserver(this);
- g_infoManager.UnregisterObserver(this);
+ g_EpgContainer.UnregisterObserver(this);
}
void CGUIWindowPVRChannels::GetContextButtons(int itemNumber, CContextButtons &buttons)
diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
index 61ad4e328b..194d1b5a0f 100644
--- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
@@ -97,11 +97,19 @@ void CGUIWindowPVRGuide::StopRefreshTimelineItemsThread()
void CGUIWindowPVRGuide::RegisterObservers(void)
{
+ CSingleLock lock(m_critSection);
g_EpgContainer.RegisterObserver(this);
+ if (g_PVRTimers)
+ g_PVRTimers->RegisterObserver(this);
+ CGUIWindowPVRBase::RegisterObservers();
}
void CGUIWindowPVRGuide::UnregisterObservers(void)
{
+ CSingleLock lock(m_critSection);
+ CGUIWindowPVRBase::UnregisterObservers();
+ if (g_PVRTimers)
+ g_PVRTimers->UnregisterObserver(this);
g_EpgContainer.UnregisterObserver(this);
}
@@ -110,6 +118,7 @@ void CGUIWindowPVRGuide::Notify(const Observable &obs, const ObservableMessage m
if (m_viewControl.GetCurrentControl() == GUIDE_VIEW_TIMELINE &&
(msg == ObservableMessageEpg ||
msg == ObservableMessageEpgContainer ||
+ msg == ObservableMessageChannelGroupReset ||
msg == ObservableMessageChannelGroup))
{
CSingleLock lock(m_critSection);
@@ -396,6 +405,7 @@ bool CGUIWindowPVRGuide::OnMessage(CGUIMessage& message)
case GUI_MSG_REFRESH_LIST:
switch(message.GetParam1())
{
+ case ObservableMessageChannelGroupReset:
case ObservableMessageChannelGroup:
case ObservableMessageEpg:
case ObservableMessageEpgContainer:
@@ -403,6 +413,12 @@ bool CGUIWindowPVRGuide::OnMessage(CGUIMessage& message)
Refresh(true);
break;
}
+ case ObservableMessageTimersReset:
+ case ObservableMessageTimers:
+ {
+ SetInvalid();
+ break;
+ }
case ObservableMessageEpgActiveItem:
{
if (m_viewControl.GetCurrentControl() != GUIDE_VIEW_TIMELINE)
@@ -423,8 +439,7 @@ bool CGUIWindowPVRGuide::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
return false;
CFileItemPtr pItem = m_vecItems->Get(itemNumber);
- bool bReturn
- = OnContextButtonPlay(pItem.get(), button) ||
+ return OnContextButtonPlay(pItem.get(), button) ||
OnContextButtonInfo(pItem.get(), button) ||
OnContextButtonStartRecord(pItem.get(), button) ||
OnContextButtonStopRecord(pItem.get(), button) ||
@@ -436,11 +451,6 @@ bool CGUIWindowPVRGuide::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
OnContextButtonEnd(pItem.get(), button) ||
OnContextButtonNow(pItem.get(), button) ||
CGUIWindowPVRBase::OnContextButton(itemNumber, button);
-
- if (bReturn)
- SetInvalid();
-
- return bReturn;
}
void CGUIWindowPVRGuide::GetViewChannelItems(CFileItemList &items)
diff --git a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
index 03854548f5..5ff21c779f 100644
--- a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
@@ -52,19 +52,23 @@ CGUIWindowPVRRecordings::CGUIWindowPVRRecordings(bool bRadio) :
void CGUIWindowPVRRecordings::RegisterObservers(void)
{
CSingleLock lock(m_critSection);
- g_PVRRecordings->RegisterObserver(this);
- g_PVRTimers->RegisterObserver(this);
+ if (g_PVRRecordings)
+ g_PVRRecordings->RegisterObserver(this);
+ if (g_PVRTimers)
+ g_PVRTimers->RegisterObserver(this);
g_infoManager.RegisterObserver(this);
+ CGUIWindowPVRBase::RegisterObservers();
}
void CGUIWindowPVRRecordings::UnregisterObservers(void)
{
CSingleLock lock(m_critSection);
- if (g_PVRRecordings)
- g_PVRRecordings->UnregisterObserver(this);
+ CGUIWindowPVRBase::UnregisterObservers();
+ g_infoManager.UnregisterObserver(this);
if (g_PVRTimers)
g_PVRTimers->UnregisterObserver(this);
- g_infoManager.UnregisterObserver(this);
+ if (g_PVRRecordings)
+ g_PVRRecordings->UnregisterObserver(this);
}
void CGUIWindowPVRRecordings::OnWindowLoaded()
diff --git a/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp b/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp
index 7a8071a037..acf7c0b571 100644
--- a/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp
@@ -48,16 +48,19 @@ CGUIWindowPVRTimersBase::CGUIWindowPVRTimersBase(bool bRadio, int id, const std:
void CGUIWindowPVRTimersBase::RegisterObservers(void)
{
CSingleLock lock(m_critSection);
- g_PVRTimers->RegisterObserver(this);
+ if (g_PVRTimers)
+ g_PVRTimers->RegisterObserver(this);
g_infoManager.RegisterObserver(this);
+ CGUIWindowPVRBase::RegisterObservers();
}
void CGUIWindowPVRTimersBase::UnregisterObservers(void)
{
CSingleLock lock(m_critSection);
+ CGUIWindowPVRBase::UnregisterObservers();
+ g_infoManager.UnregisterObserver(this);
if (g_PVRTimers)
g_PVRTimers->UnregisterObserver(this);
- g_infoManager.UnregisterObserver(this);
}
void CGUIWindowPVRTimersBase::GetContextButtons(int itemNumber, CContextButtons &buttons)