mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
src/gui/bouquetlist.cpp: do not add dublicate channels while copy bouquet to favorite,
if favorite bouquet already exist
This commit is contained in:
@@ -243,6 +243,7 @@ int CBouquetList::doMenu()
|
|||||||
delete menu;
|
delete menu;
|
||||||
delete selector;
|
delete selector;
|
||||||
printf("CBouquetList::doMenu: %d selected\n", select);
|
printf("CBouquetList::doMenu: %d selected\n", select);
|
||||||
|
bool added = false;
|
||||||
if(select >= 0) {
|
if(select >= 0) {
|
||||||
old_selected = select;
|
old_selected = select;
|
||||||
switch(select) {
|
switch(select) {
|
||||||
@@ -251,16 +252,28 @@ int CBouquetList::doMenu()
|
|||||||
bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName());
|
bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName());
|
||||||
if(bouquet_id < 0) {
|
if(bouquet_id < 0) {
|
||||||
tmp = g_bouquetManager->addBouquet(Bouquets[selected]->channelList->getName(), true);
|
tmp = g_bouquetManager->addBouquet(Bouquets[selected]->channelList->getName(), true);
|
||||||
|
bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName());
|
||||||
} else
|
} else
|
||||||
tmp = g_bouquetManager->Bouquets[bouquet_id];
|
tmp = g_bouquetManager->Bouquets[bouquet_id];
|
||||||
|
|
||||||
|
if(bouquet_id < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
channels = &zapitBouquet->tvChannels;
|
channels = &zapitBouquet->tvChannels;
|
||||||
for(int li = 0; li < (int) channels->size(); li++)
|
for(int li = 0; li < (int) channels->size(); li++) {
|
||||||
|
if (!g_bouquetManager->existsChannelInBouquet(bouquet_id, ((*channels)[li])->getChannelID())) {
|
||||||
|
added = true;
|
||||||
tmp->addService((*channels)[li]);
|
tmp->addService((*channels)[li]);
|
||||||
|
}
|
||||||
|
}
|
||||||
channels = &zapitBouquet->radioChannels;
|
channels = &zapitBouquet->radioChannels;
|
||||||
for(int li = 0; li < (int) channels->size(); li++)
|
for(int li = 0; li < (int) channels->size(); li++) {
|
||||||
|
if (!g_bouquetManager->existsChannelInBouquet(bouquet_id, ((*channels)[li])->getChannelID())) {
|
||||||
|
added = true;
|
||||||
tmp->addService((*channels)[li]);
|
tmp->addService((*channels)[li]);
|
||||||
return 1;
|
}
|
||||||
|
}
|
||||||
|
return added ? 1 : -1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user