fixed bug in menu header if title is NULL

This commit is contained in:
louis 2016-02-20 17:55:27 +01:00
parent 6accb0b563
commit 7af7daafc2

View File

@ -49,6 +49,8 @@ void cVeDmHeader::SetTokenContainer(void) {
}
void cVeDmHeader::SetTitle(const char *title) {
if (!title)
return;
if (this->title && !strcmp(this->title, title))
return;
free(this->title);
@ -79,12 +81,13 @@ void cVeDmHeader::Set(eMenuCategory menuCat) {
//check for standard menu entries
bool hasIcon = false;
string icon = imgCache->GetIconName(title, menuCat);
if (imgCache->MenuIconExists(icon))
hasIcon = true;
tokenContainer->AddStringToken((int)eDMHeaderST::icon, icon.c_str());
tokenContainer->AddIntToken((int)eDMHeaderIT::hasicon, hasIcon);
if (title) {
string icon = imgCache->GetIconName(title, menuCat);
if (imgCache->MenuIconExists(icon))
hasIcon = true;
tokenContainer->AddStringToken((int)eDMHeaderST::icon, icon.c_str());
tokenContainer->AddIntToken((int)eDMHeaderIT::hasicon, hasIcon);
}
//Disc Usage
tokenContainer->AddStringToken((int)eDMHeaderST::vdrusagestring, *cVideoDiskUsage::String());