zapit/src/bouquets.cpp: allow to change GUI channel name in ubouquets.xml;

avoid delete remainChannels bouquet


Origin commit data
------------------
Branch: ni/coolstream
Commit: 70fa01b318
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-10-14 (Tue, 14 Oct 2014)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2014-10-14 16:25:11 +04:00
parent 6478f0f84c
commit fe1f568654
2 changed files with 13 additions and 6 deletions

View File

@@ -117,6 +117,7 @@ class CZapitChannel
private:
/* channel name */
std::string name;
std::string uname;
/* WebTV */
std::string url;
@@ -215,7 +216,7 @@ class CZapitChannel
/* get methods - read and write variables */
const std::string& getName(void) const { return name; }
const std::string& getName(void) const { return (!uname.empty() ? uname : name); }
const std::string& getUrl(void) const { return url; }
const std::string& getDesc(void) const { return desc; }
t_satellite_position getSatellitePosition(void) const { return satellitePosition; }
@@ -240,7 +241,8 @@ class CZapitChannel
/* set methods */
void setServiceType(const unsigned char pserviceType) { serviceType = pserviceType; }
inline void setName(const std::string pName) { name = pName; }
inline void setName(const std::string &pName) { name = pName; }
inline void setUserName(const std::string &pName) { uname = pName; }
void setAudioChannel(unsigned char pAudioChannel) { if (pAudioChannel < audioChannels.size()) currentAudioChannel = pAudioChannel; }
void setPcrPid(unsigned short pPcrPid) { pcrPid = pPcrPid; }
void setPmtPid(unsigned short pPmtPid) { pmtPid = pPmtPid; }

View File

@@ -426,10 +426,8 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser)
chan = CServiceManager::getInstance()->FindChannel(chid);
if (chan != NULL) {
DBG("%04x %04x %04x %s\n", transport_stream_id, original_network_id, service_id, xmlGetAttribute(channel_node, "n"));
#if 0
if(bUser && (name2.length() > 1))
chan->setName(name2);
#endif
chan->setUserName(name2);
if(!bUser)
chan->pname = (char *) newBouquet->Name.c_str();
chan->bLocked = clock;
@@ -517,7 +515,8 @@ void CBouquetManager::makeRemainingChannelsBouquet(void)
sort(unusedChannels.begin(), unusedChannels.end(), CmpChannelByChName());
// TODO: use locales
remainChannels = addBouquet( Bouquets.empty() ? "All Channels" : "Other", false); // UTF-8 encoded
if (remainChannels == NULL)
remainChannels = addBouquet( Bouquets.empty() ? "All Channels" : "Other", false); // UTF-8 encoded
remainChannels->bOther = true;
for (ZapitChannelList::const_iterator it = unusedChannels.begin(); it != unusedChannels.end(); ++it) {
@@ -531,10 +530,16 @@ void CBouquetManager::makeRemainingChannelsBouquet(void)
void CBouquetManager::renumServices()
{
#if 0
if(remainChannels)
deleteBouquet(remainChannels);
remainChannels = NULL;
#endif
if(remainChannels) {
remainChannels->tvChannels.clear();
remainChannels->radioChannels.clear();
}
makeRemainingChannelsBouquet();
}