Skip to content

Commit

Permalink
fix m_iInfoCode in CGUIProgressControl
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed Jul 31, 2011
1 parent f4d964c commit cd04d6e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xbmc/guilib/GUIControlFactory.cpp
Expand Up @@ -1234,10 +1234,12 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl
textureBackground, textureLeft, textureMid, textureRight,
textureOverlay, bReveal);

CGUIInfoLabel progress;
GetInfoLabel(pControlNode, "progress", progress);
if (!progress.IsEmpty())
if (XMLUtils::HasChild(pControlNode, "progress"))
{
CGUIInfoLabel progress;
GetInfoLabel(pControlNode, "progress", progress);
((CGUIProgressControl *)control)->SetListInfo(progress);
}
else
((CGUIProgressControl *)control)->SetInfo(singleInfo);
}
Expand Down
8 changes: 8 additions & 0 deletions xbmc/utils/XMLUtils.cpp
Expand Up @@ -132,6 +132,14 @@ bool XMLUtils::GetString(const TiXmlNode* pRootNode, const char* strTag, CStdStr
return false;
}

bool XMLUtils::HasChild(const TiXmlNode* pRootNode, const char* strTag)
{
const TiXmlElement* pElement = pRootNode->FirstChildElement(strTag);
if (!pElement) return false;
const TiXmlNode* pNode = pElement->FirstChild();
return (pNode != NULL);
}

bool XMLUtils::GetAdditiveString(const TiXmlNode* pRootNode, const char* strTag,
const CStdString& strSeparator, CStdString& strStringValue)
{
Expand Down
1 change: 1 addition & 0 deletions xbmc/utils/XMLUtils.h
Expand Up @@ -29,6 +29,7 @@ class XMLUtils
{
public:
static bool HasUTF8Declaration(const CStdString &strXML);
static bool HasChild(const TiXmlNode* pRootNode, const char* strTag);

static bool GetHex(const TiXmlNode* pRootNode, const char* strTag, uint32_t& dwHexValue);
static bool GetUInt(const TiXmlNode* pRootNode, const char* strTag, uint32_t& dwUIntValue);
Expand Down

0 comments on commit cd04d6e

Please sign in to comment.