src/gui/channellist.cpp: show epg info1 if info2 empty (THX bazi98)

Origin commit data
------------------
Branch: ni/coolstream
Commit: 4cb0870b9b
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2015-07-05 (Sun, 05 Jul 2015)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2015-07-05 13:20:47 +02:00
parent 2eee2dfdf9
commit 8ed12ffc0f

View File

@@ -2326,17 +2326,46 @@ void CChannelList::readEvents(const t_channel_id channel_id)
void CChannelList::showdescription(int index)
{
std::string strEpisode = ""; // Episode title in case info1 gets stripped
ffheight = g_Font[eventFont]->getHeight();
CZapitChannel* chan = (*chanlist)[index];
CChannelEvent *p_event = &chan->currentEvent;
epgData.info1.clear();
epgData.info2.clear();
epgText.clear();
CEitManager::getInstance()->getEPGid(p_event->eventID, p_event->startTime, &epgData);
if (!(epgData.info2.empty()))
processTextToArray(epgData.info2);
if (!epgData.info1.empty()) {
bool bHide = false;
if (false == epgData.info2.empty()) {
// Look for the first . in info1, usually this is the title of an episode.
std::string::size_type nPosDot = epgData.info1.find('.');
if (std::string::npos != nPosDot) {
nPosDot += 2; // Skip dot and first blank
if (nPosDot < epgData.info2.length() && nPosDot < epgData.info1.length()) { // Make sure we don't overrun the buffer
// Check if the stuff after the dot equals the beginning of info2
if (0 == epgData.info2.find(epgData.info1.substr(nPosDot, epgData.info1.length() - nPosDot))) {
strEpisode = epgData.info1.substr(0, nPosDot) + "\n";
bHide = true;
}
}
}
// Compare strings normally if not positively found to be equal before
if (false == bHide && 0 == epgData.info2.find(epgData.info1)) {
bHide = true;
}
}
if (false == bHide) {
processTextToArray(epgData.info1);
}
}
//scan epg-data - sort to list
if (((epgData.info2.empty())) && (!(strEpisode.empty())))
processTextToArray(g_Locale->getText(LOCALE_EPGVIEWER_NODETAILED)); // UTF-8
else
processTextToArray(g_Locale->getText(LOCALE_EPGVIEWER_NODETAILED));
processTextToArray(strEpisode + epgData.info2); // UTF-8
frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0);
for (int i = 1; (i < (int)epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++)