mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
- channellist: simplify MaxChanNr() function
This commit is contained in:
@@ -68,6 +68,7 @@
|
|||||||
#else
|
#else
|
||||||
#include <gui/widget/msgbox.h>
|
#include <gui/widget/msgbox.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <system/helpers.h>
|
||||||
#include <system/settings.h>
|
#include <system/settings.h>
|
||||||
#include <system/set_threadname.h>
|
#include <system/set_threadname.h>
|
||||||
|
|
||||||
@@ -2290,17 +2291,12 @@ bool CChannelList::SameTP(CZapitChannel * channel)
|
|||||||
|
|
||||||
std::string CChannelList::MaxChanNr()
|
std::string CChannelList::MaxChanNr()
|
||||||
{
|
{
|
||||||
zapit_list_it_t chan_it;
|
int n = 1;
|
||||||
std::stringstream ss;
|
for (zapit_list_it_t it = (*chanlist).begin(); it != (*chanlist).end(); ++it)
|
||||||
std::string maxchansize;
|
{
|
||||||
int chan_nr_max = 1;
|
n = std::max(n, (*it)->number);
|
||||||
unsigned int nr = 0;
|
|
||||||
for (chan_it=(*chanlist).begin(); chan_it!=(*chanlist).end(); ++chan_it) {
|
|
||||||
chan_nr_max = std::max(chan_nr_max, (*chanlist)[nr++]->number);
|
|
||||||
}
|
}
|
||||||
ss << chan_nr_max;
|
return to_string(n);
|
||||||
ss >> maxchansize;
|
|
||||||
return maxchansize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::paintPig (int _x, int _y, int w, int h)
|
void CChannelList::paintPig (int _x, int _y, int w, int h)
|
||||||
|
Reference in New Issue
Block a user