From 0ba0f29836bc868d0ac94edeeef31ea6fb7cb439 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 3 Nov 2017 09:36:19 +0100 Subject: [PATCH] fix mode in SetChannelMode() Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8d3f2ce860e3e4646cac6f3ced08e87e76b4c909 Author: vanhofen Date: 2017-11-03 (Fri, 03 Nov 2017) Origin message was: ------------------ - fix mode in SetChannelMode() Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- src/neutrino.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 229fb8436..1e9e87590 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1794,10 +1794,12 @@ void CNeutrinoApp::channelsInit(bool bOnly) void CNeutrinoApp::SetChannelMode(int newmode) { - printf("CNeutrinoApp::SetChannelMode %d [%s]\n", newmode, mode == mode_radio ? "radio" : "tv"); + bool isRadioMode = (mode == mode_radio || mode == mode_webradio); + + printf("CNeutrinoApp::SetChannelMode %d [%s]\n", newmode, isRadioMode ? "radio" : "tv"); int *sortmode; - if(mode == mode_radio) { + if (isRadioMode) { channelList = RADIOchannelList; g_settings.channel_mode_radio = newmode; sortmode = radiosort; @@ -1809,25 +1811,25 @@ void CNeutrinoApp::SetChannelMode(int newmode) switch(newmode) { case LIST_MODE_FAV: - if(mode == mode_radio) + if (isRadioMode) bouquetList = RADIOfavList; else bouquetList = TVfavList; break; case LIST_MODE_SAT: - if(mode == mode_radio) + if (isRadioMode) bouquetList = RADIOsatList; else bouquetList = TVsatList; break; case LIST_MODE_WEBTV: - if(mode == mode_radio) + if (isRadioMode) bouquetList = RADIOwebList; else bouquetList = TVwebList; break; case LIST_MODE_ALL: - if(mode == mode_radio) + if (isRadioMode) bouquetList = RADIOallList; else bouquetList = TVallList; @@ -1836,7 +1838,7 @@ void CNeutrinoApp::SetChannelMode(int newmode) newmode = LIST_MODE_PROV; /* fall through */ case LIST_MODE_PROV: - if(mode == mode_radio) + if (isRadioMode) bouquetList = RADIObouquetList; else bouquetList = TVbouquetList;