diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index c2aa9e35d..b495afb1f 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -567,16 +567,9 @@ void CInfoViewer::check_channellogo_ca_SettingsChange() void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) { if(channel) { - std::string pname = ""; - if(g_settings.infobar_show_channeldesc){ - if(channel->pname){ - pname = channel->pname; - pname=pname.substr(pname.find_first_of("]")+1); - } - } showTitle(channel->number, channel->getName(), channel->getSatellitePosition(), - channel->getChannelID(), calledFromNumZap, epgpos, pname); + channel->getChannelID(), calledFromNumZap, epgpos, channel->pname); } } @@ -584,21 +577,14 @@ void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int { CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(chid); - std::string pname = ""; if(channel) { - if(g_settings.infobar_show_channeldesc){ - if(channel->pname){ - pname = channel->pname; - pname=pname.substr(pname.find_first_of("]")+1); - } - } showTitle(channel->number, channel->getName(), channel->getSatellitePosition(), - channel->getChannelID(), calledFromNumZap, epgpos, pname); + channel->getChannelID(), calledFromNumZap, epgpos, channel->pname); } } -void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id, const bool calledFromNumZap, int epgpos, std::string pname) +void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id, const bool calledFromNumZap, int epgpos, char *pname) { check_channellogo_ca_SettingsChange(); aspectRatio = 0; @@ -726,13 +712,17 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con ChanNameX + 10 + ChanNumWidth, ChanNameY + time_height, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth, ChannelName, color /*COL_INFOBAR*/, 0, true); // UTF-8 - if(g_settings.infobar_show_channeldesc && !pname.empty()){ + //provider name + if(g_settings.infobar_show_channeldesc && pname){ + std::string prov_name = pname; + prov_name=prov_name.substr(prov_name.find_first_of("]")+1); + int chname_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (ChannelName); chname_width += (chname_width/(ChannelName.size()-1)/2); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( ChanNameX + 10 + ChanNumWidth + chname_width, ChanNameY + time_height -SHADOW_OFFSET/2, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth - chname_width, - pname, color /*COL_INFOBAR*/, 0, true); // UTF-8 + prov_name, color /*COL_INFOBAR*/, 0, true); // UTF-8 } } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 6a70a154c..c1860b4d6 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -155,7 +155,7 @@ class CInfoViewer void start(); void showEpgInfo(); - void showTitle(const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false, int epgpos = 0, std::string pname=""); // Channel must be UTF-8 encoded + void showTitle(const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false, int epgpos = 0, char *pname=NULL); // Channel must be UTF-8 encoded void showTitle(CZapitChannel * channel, const bool calledFromNumZap = false, int epgpos = 0); void showTitle(t_channel_id channel_id, const bool calledFromNumZap = false, int epgpos = 0); void lookAheadEPG(const int ChanNum, const std::string & Channel, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false); //alpha: fix for nvod subchannel update diff --git a/src/neutrino.cpp b/src/neutrino.cpp index baa905480..466566897 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1955,18 +1955,16 @@ void CNeutrinoApp::numericZap(int msg) void CNeutrinoApp::showInfo() { StopSubtitles(); - std::string name = channelList->getActiveChannelName(); - std::string pname = ""; + char *pname = NULL; if(g_settings.infobar_show_channeldesc){ - CZapitChannel* channel= channelList->getActiveChannel(); + CZapitChannel* channel = channelList->getActiveChannel(); if(channel->pname){ pname = channel->pname; - pname=pname.substr(pname.find_first_of("]")+1); } } - g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), name, channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID(), false, 0, pname); + g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), channelList->getActiveChannelName(), channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID(), false, 0, pname); StartSubtitles(); }