Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2903 from davilla/change-rss-urls

fixed, update of rss feed URLS
  • Loading branch information...
commit bc7b5631f019b217c2afb9ee2c26ac29e4203bcc 2 parents a18beb6 + 16d84cc
@jmarshallnz jmarshallnz authored
View
8 xbmc/guilib/GUIControlFactory.cpp
@@ -1066,15 +1066,9 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl
control = new CGUIRSSControl(
parentID, id, posX, posY, width, height,
labelInfo, textColor3, headlineColor, strRSSTags);
-
RssUrls::const_iterator iter = CRssManager::Get().GetUrls().find(iUrlSet);
if (iter != CRssManager::Get().GetUrls().end())
- {
- ((CGUIRSSControl *)control)->SetUrls(iter->second.url,iter->second.rtl);
- ((CGUIRSSControl *)control)->SetIntervals(iter->second.interval);
- }
- else
- CLog::Log(LOGERROR,"invalid rss url set referenced in skin");
+ ((CGUIRSSControl *)control)->SetUrlSet(iUrlSet);
}
else if (type == CGUIControl::GUICONTROL_BUTTON)
{
View
30 xbmc/guilib/GUIRSSControl.cpp
@@ -42,6 +42,7 @@ CGUIRSSControl::CGUIRSSControl(int parentID, int controlID, float posX, float po
m_pReader = NULL;
m_rtl = false;
m_stopped = false;
+ m_urlset = 1;
ControlType = GUICONTROL_RSS;
}
@@ -55,6 +56,7 @@ CGUIRSSControl::CGUIRSSControl(const CGUIRSSControl &from)
m_pReader = NULL;
m_rtl = from.m_rtl;
m_stopped = from.m_stopped;
+ m_urlset = 1;
ControlType = GUICONTROL_RSS;
}
@@ -66,16 +68,6 @@ CGUIRSSControl::~CGUIRSSControl(void)
m_pReader = NULL;
}
-void CGUIRSSControl::SetUrls(const vector<string> &vecUrl, bool rtl)
-{
- m_vecUrls = vecUrl;
- m_rtl = rtl;
- if (m_scrollInfo.pixelSpeed > 0 && rtl)
- m_scrollInfo.pixelSpeed *= -1;
- else if (m_scrollInfo.pixelSpeed < 0 && !rtl)
- m_scrollInfo.pixelSpeed *= -1;
-}
-
void CGUIRSSControl::OnFocus()
{
m_stopped = true;
@@ -86,9 +78,9 @@ void CGUIRSSControl::OnUnFocus()
m_stopped = false;
}
-void CGUIRSSControl::SetIntervals(const vector<int>& vecIntervals)
+void CGUIRSSControl::SetUrlSet(const int urlset)
{
- m_vecIntervals = vecIntervals;
+ m_urlset = urlset;
}
bool CGUIRSSControl::UpdateColors()
@@ -118,6 +110,20 @@ void CGUIRSSControl::Render()
// Create RSS background/worker thread if needed
if (m_pReader == NULL)
{
+ RssUrls::const_iterator iter = CRssManager::Get().GetUrls().find(m_urlset);
+ if (iter == CRssManager::Get().GetUrls().end())
+ {
+ CGUIControl::Render();
+ return;
+ }
+ m_rtl = iter->second.rtl;
+ m_vecUrls = iter->second.url;
+ m_vecIntervals = iter->second.interval;
+ if (m_scrollInfo.pixelSpeed > 0 && m_rtl)
+ m_scrollInfo.pixelSpeed *= -1;
+ else if (m_scrollInfo.pixelSpeed < 0 && !m_rtl)
+ m_scrollInfo.pixelSpeed *= -1;
+
if (CRssManager::Get().GetReader(GetID(), GetParentID(), this, m_pReader))
m_scrollInfo.characterPos = m_pReader->m_SavedScrollPos;
else
View
6 xbmc/guilib/GUIRSSControl.h
@@ -56,12 +56,11 @@ class CGUIRSSControl : public CGUIControl, public IRssObserver
virtual bool CanFocus() const { return true; };
virtual CRect CalcRenderRegion() const;
- void SetIntervals(const std::vector<int>& vecIntervals);
- void SetUrls(const std::vector<std::string>& vecUrl, bool rtl);
-
virtual void OnFocus();
virtual void OnUnFocus();
+ void SetUrlSet(const int urlset);
+
protected:
virtual bool UpdateColors();
@@ -81,5 +80,6 @@ class CGUIRSSControl : public CGUIControl, public IRssObserver
bool m_rtl;
CScrollInfo m_scrollInfo;
bool m_stopped;
+ int m_urlset;
};
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.