From ed4adff745e5564a913249b6dfcf26b6ce292fe7 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 8 Nov 2015 19:30:59 +0100 Subject: [PATCH] - channellist, bouquetlist and bouqueteditor: fix pagedown logic --- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bouquetlist.cpp | 2 +- src/gui/channellist.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index c68d26427..d8f151a87 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -293,7 +293,7 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int new_selected = selected + step; if (new_selected >= (int) Bouquets->size()) { - if ((Bouquets->size() - listmaxshow -1 < selected) && (selected != (Bouquets->size() - 1)) && (step != 1)) + if (((Bouquets->size() - listmaxshow -1 < selected) && (step != 1)) || (selected != (Bouquets->size() - 1))) new_selected = Bouquets->size() - 1; else if (((Bouquets->size() / listmaxshow) + 1) * listmaxshow == Bouquets->size() + listmaxshow) // last page has full entries new_selected = 0; diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 8126de0c8..834b0a263 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -374,7 +374,7 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int new_selected = selected + step; if (new_selected >= (int) Channels->size()) { - if ((Channels->size() - listmaxshow -1 < selected) && (selected != (Channels->size() - 1)) && (step != 1)) + if (((Channels->size() - listmaxshow -1 < selected) && (step != 1)) || (selected != (Channels->size() - 1))) new_selected = Channels->size() - 1; else if (((Channels->size() / listmaxshow) + 1) * listmaxshow == Channels->size() + listmaxshow) // last page has full entries new_selected = 0; diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index c3185364b..331976f32 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -547,7 +547,7 @@ int CBouquetList::show(bool bShowChannelList) int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int new_selected = selected + step; if (new_selected >= (int) Bouquets.size()) { - if ((Bouquets.size() - listmaxshow -1 < selected) && (selected != (Bouquets.size() - 1)) && (step != 1)) + if (((Bouquets.size() - listmaxshow -1 < selected) && (step != 1)) || (selected != (Bouquets.size() - 1))) new_selected = Bouquets.size() - 1; else if (((Bouquets.size() / listmaxshow) + 1) * listmaxshow == Bouquets.size() + listmaxshow) // last page has full entries new_selected = 0; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index f59fb6efc..4dc660589 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -748,7 +748,7 @@ int CChannelList::show() int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int new_selected = selected + step; if (new_selected >= (int) (*chanlist).size()) { - if (((*chanlist).size() - listmaxshow -1 < selected) && (selected != ((*chanlist).size() - 1)) && (step != 1)) + if ((((*chanlist).size() - listmaxshow -1 < selected) && (step != 1)) || (selected != ((*chanlist).size() - 1))) new_selected = (*chanlist).size() - 1; else if ((((*chanlist).size() / listmaxshow) + 1) * listmaxshow == (*chanlist).size() + listmaxshow) // last page has full entries new_selected = 0;