mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
CChannelList: fix "prev bouquet" if empty bouquets are present
also do proper wrap-around when selecting previous / next bouquet
Origin commit data
------------------
Branch: ni/coolstream
Commit: 80e7f9753b
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-04-06 (Sat, 06 Apr 2013)
------------------
This commit was generated by Migit
This commit is contained in:
committed by
Jacek Jendrzej
parent
ee338d72e9
commit
16e7b8bb91
@@ -744,12 +744,13 @@ int CChannelList::show()
|
|||||||
if (!bouquetList->Bouquets.empty()) {
|
if (!bouquetList->Bouquets.empty()) {
|
||||||
bool found = true;
|
bool found = true;
|
||||||
int dir = msg == (neutrino_msg_t)g_settings.key_bouquet_up ? 1 : -1;
|
int dir = msg == (neutrino_msg_t)g_settings.key_bouquet_up ? 1 : -1;
|
||||||
int b_size = bouquetList->Bouquets.size();
|
int b_size = bouquetList->Bouquets.size(); /* bigger than 0 */
|
||||||
int nNext = (bouquetList->getActiveBouquetNumber() + b_size + dir) % b_size;
|
int nNext = (bouquetList->getActiveBouquetNumber() + b_size + dir) % b_size;
|
||||||
if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) {
|
if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) {
|
||||||
found = false;
|
found = false;
|
||||||
|
int n_old = nNext;
|
||||||
nNext = (nNext + b_size + dir) % b_size;
|
nNext = (nNext + b_size + dir) % b_size;
|
||||||
for (int i = nNext; i < b_size; i++) {
|
for (int i = nNext; i != n_old; i = (i + b_size + dir) % b_size) {
|
||||||
if( !bouquetList->Bouquets[i]->channelList->isEmpty() ) {
|
if( !bouquetList->Bouquets[i]->channelList->isEmpty() ) {
|
||||||
found = true;
|
found = true;
|
||||||
nNext = i;
|
nNext = i;
|
||||||
|
Reference in New Issue
Block a user