order of search timers in search timer list in alphabetical order

This commit is contained in:
louis 2014-02-07 16:07:00 +01:00
parent 15ab7fa08b
commit 51df65e90b
5 changed files with 16 additions and 1 deletions

View File

@ -122,3 +122,4 @@ Version 1.2.0
- changed video directory choosage behaviour: added possibility to use - changed video directory choosage behaviour: added possibility to use
a fixed recording dir which also supports epgsearch variables a fixed recording dir which also supports epgsearch variables
- fixed a bug when scrolling page up and the menu footer is active - fixed a bug when scrolling page up and the menu footer is active
- order of search timers in search timer list in alphabetical order

View File

@ -1,3 +1,5 @@
#define __STL_CONFIG_H
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
@ -385,6 +387,7 @@ void cRecManager::GetSearchTimers(std::vector<cTVGuideSearchTimer> *searchTimer)
searchTimer->push_back(timer); searchTimer->push_back(timer);
} }
} }
std::sort(searchTimer->begin(), searchTimer->end());
} }
int cRecManager::CreateSearchTimer(std::string epgSearchString) { int cRecManager::CreateSearchTimer(std::string epgSearchString) {

View File

@ -795,6 +795,7 @@ void cRecMenuManager::DisplaySearchTimerList(void) {
delete activeMenu; delete activeMenu;
std::vector<cTVGuideSearchTimer> searchTimers; std::vector<cTVGuideSearchTimer> searchTimers;
recManager->GetSearchTimers(&searchTimers); recManager->GetSearchTimers(&searchTimers);
//std::sort(searchTimers.begin(), searchTimers.end());
activeMenu = new cRecMenuSearchTimers(searchTimers); activeMenu = new cRecMenuSearchTimers(searchTimers);
activeMenu->Display(); activeMenu->Display();
} }

View File

@ -71,6 +71,15 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) {
cTVGuideSearchTimer::~cTVGuideSearchTimer(void) { cTVGuideSearchTimer::~cTVGuideSearchTimer(void) {
} }
bool cTVGuideSearchTimer::operator < (const cTVGuideSearchTimer& other) const {
std::string searchStringOther = other.SearchString();
int comp = searchString.compare(searchStringOther);
if (comp < 0)
return true;
return false;
}
void cTVGuideSearchTimer::SetTemplate(std::string tmpl) { void cTVGuideSearchTimer::SetTemplate(std::string tmpl) {
std::stringstream searchTimerString; std::stringstream searchTimerString;
searchTimerString << "0:"; searchTimerString << "0:";

View File

@ -64,13 +64,14 @@ private:
public: public:
cTVGuideSearchTimer(void); cTVGuideSearchTimer(void);
virtual ~cTVGuideSearchTimer(void); virtual ~cTVGuideSearchTimer(void);
bool operator < (const cTVGuideSearchTimer& other) const;
void SetEPGSearchString(std::string strTimer) { this->strTimer = strTimer; }; void SetEPGSearchString(std::string strTimer) { this->strTimer = strTimer; };
void SetTemplate(std::string tmpl); void SetTemplate(std::string tmpl);
bool Parse(bool readTemplate = false); bool Parse(bool readTemplate = false);
std::string BuildSearchString(void); std::string BuildSearchString(void);
int GetID(void) { return ID; }; int GetID(void) { return ID; };
//GETTER //GETTER
std::string SearchString(void) { return searchString; }; std::string SearchString(void) const { return searchString; };
bool Active(void); bool Active(void);
bool UseTitle(void) { return useTitle; }; bool UseTitle(void) { return useTitle; };
bool UseSubtitle(void) { return useSubtitle; }; bool UseSubtitle(void) { return useSubtitle; };