From 8ed12ffc0fb04492e1d25ce5e7869d60b48e5d27 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 5 Jul 2015 13:20:47 +0200 Subject: [PATCH] src/gui/channellist.cpp: show epg info1 if info2 empty (THX bazi98) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4cb0870b9b4431259d732cd36fcfc7f68e5e84f8 Author: Jacek Jendrzej Date: 2015-07-05 (Sun, 05 Jul 2015) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 13d06dd66..aa7c223ab 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -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++)