mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
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:
@@ -2326,17 +2326,46 @@ void CChannelList::readEvents(const t_channel_id channel_id)
|
|||||||
|
|
||||||
void CChannelList::showdescription(int index)
|
void CChannelList::showdescription(int index)
|
||||||
{
|
{
|
||||||
|
std::string strEpisode = ""; // Episode title in case info1 gets stripped
|
||||||
ffheight = g_Font[eventFont]->getHeight();
|
ffheight = g_Font[eventFont]->getHeight();
|
||||||
CZapitChannel* chan = (*chanlist)[index];
|
CZapitChannel* chan = (*chanlist)[index];
|
||||||
CChannelEvent *p_event = &chan->currentEvent;
|
CChannelEvent *p_event = &chan->currentEvent;
|
||||||
|
epgData.info1.clear();
|
||||||
epgData.info2.clear();
|
epgData.info2.clear();
|
||||||
epgText.clear();
|
epgText.clear();
|
||||||
CEitManager::getInstance()->getEPGid(p_event->eventID, p_event->startTime, &epgData);
|
CEitManager::getInstance()->getEPGid(p_event->eventID, p_event->startTime, &epgData);
|
||||||
|
|
||||||
if (!(epgData.info2.empty()))
|
if (!epgData.info1.empty()) {
|
||||||
processTextToArray(epgData.info2);
|
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
|
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);
|
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++)
|
for (int i = 1; (i < (int)epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++)
|
||||||
|
Reference in New Issue
Block a user