summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-02-07 16:07:00 +0100
committerlouis <louis.braun@gmx.de>2014-02-07 16:07:00 +0100
commit51df65e90bb7c9805e4d22cefd93a3bb8708beb0 (patch)
treeb3a74c9fba669e7d853028c2633ca237fe92436a
parent15ab7fa08b6f99cd436892bbb726c82d086b7f05 (diff)
downloadvdr-plugin-tvguide-51df65e90bb7c9805e4d22cefd93a3bb8708beb0.tar.gz
vdr-plugin-tvguide-51df65e90bb7c9805e4d22cefd93a3bb8708beb0.tar.bz2
order of search timers in search timer list in alphabetical order
-rw-r--r--HISTORY1
-rw-r--r--recmanager.c3
-rw-r--r--recmenumanager.c1
-rw-r--r--searchtimer.c9
-rw-r--r--searchtimer.h3
5 files changed, 16 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index d9cdb01..e2a570a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -122,3 +122,4 @@ Version 1.2.0
- changed video directory choosage behaviour: added possibility to use
a fixed recording dir which also supports epgsearch variables
- fixed a bug when scrolling page up and the menu footer is active
+- order of search timers in search timer list in alphabetical order
diff --git a/recmanager.c b/recmanager.c
index 3dec771..dcb5d0c 100644
--- a/recmanager.c
+++ b/recmanager.c
@@ -1,3 +1,5 @@
+#define __STL_CONFIG_H
+
#include <string>
#include <sstream>
#include <vector>
@@ -385,6 +387,7 @@ void cRecManager::GetSearchTimers(std::vector<cTVGuideSearchTimer> *searchTimer)
searchTimer->push_back(timer);
}
}
+ std::sort(searchTimer->begin(), searchTimer->end());
}
int cRecManager::CreateSearchTimer(std::string epgSearchString) {
diff --git a/recmenumanager.c b/recmenumanager.c
index f0b2074..ddd95a8 100644
--- a/recmenumanager.c
+++ b/recmenumanager.c
@@ -795,6 +795,7 @@ void cRecMenuManager::DisplaySearchTimerList(void) {
delete activeMenu;
std::vector<cTVGuideSearchTimer> searchTimers;
recManager->GetSearchTimers(&searchTimers);
+ //std::sort(searchTimers.begin(), searchTimers.end());
activeMenu = new cRecMenuSearchTimers(searchTimers);
activeMenu->Display();
}
diff --git a/searchtimer.c b/searchtimer.c
index 67dd2b3..04601fb 100644
--- a/searchtimer.c
+++ b/searchtimer.c
@@ -71,6 +71,15 @@ 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) {
std::stringstream searchTimerString;
searchTimerString << "0:";
diff --git a/searchtimer.h b/searchtimer.h
index a5a4f71..f797ebd 100644
--- a/searchtimer.h
+++ b/searchtimer.h
@@ -64,13 +64,14 @@ private:
public:
cTVGuideSearchTimer(void);
virtual ~cTVGuideSearchTimer(void);
+ bool operator < (const cTVGuideSearchTimer& other) const;
void SetEPGSearchString(std::string strTimer) { this->strTimer = strTimer; };
void SetTemplate(std::string tmpl);
bool Parse(bool readTemplate = false);
std::string BuildSearchString(void);
int GetID(void) { return ID; };
//GETTER
- std::string SearchString(void) { return searchString; };
+ std::string SearchString(void) const { return searchString; };
bool Active(void);
bool UseTitle(void) { return useTitle; };
bool UseSubtitle(void) { return useSubtitle; };