summaryrefslogtreecommitdiff
path: root/vdr-vdrmanager
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2011-10-19 16:31:47 +0200
committerlado <herrlado@gmail.com>2011-10-19 16:31:47 +0200
commitb3453c5ee19608992fec0dfb4c533ed7d94a6fdc (patch)
tree684fadfe5650aefba156dac4f978cfe2e6e97306 /vdr-vdrmanager
parenta6acfa47afa39d13d9eb90266a4735967ec34386 (diff)
downloadvdr-manager-b3453c5ee19608992fec0dfb4c533ed7d94a6fdc.tar.gz
vdr-manager-b3453c5ee19608992fec0dfb4c533ed7d94a6fdc.tar.bz2
use toLower rather the toUpper on search in epg. Added epg info to timer
Diffstat (limited to 'vdr-vdrmanager')
-rw-r--r--vdr-vdrmanager/helpers.cpp43
1 files changed, 39 insertions, 4 deletions
diff --git a/vdr-vdrmanager/helpers.cpp b/vdr-vdrmanager/helpers.cpp
index 050bdf6..63f2ac9 100644
--- a/vdr-vdrmanager/helpers.cpp
+++ b/vdr-vdrmanager/helpers.cpp
@@ -302,9 +302,24 @@ string cHelpers::ToText(cRecording * recording){
}
string cHelpers::ToText(cTimer * timer) {
-
- const char * channelName = timer->Channel()->Name();
-
+
+ const cChannel * channel = timer->Channel();
+ const char * channelName = channel->Name();
+
+ cSchedulesLock schedulesLock;
+ const cSchedules * schedules = cSchedules::Schedules(schedulesLock);
+
+ const cSchedule * schedule = schedules->GetSchedule(channel->GetChannelID());
+
+ const cList<cEvent> * events = schedule->Events();
+ cEvent * match = NULL;
+ for(cEvent * event = events->First(); event; event = events->Next(event)) {
+ if (IsWantedTime(timer->StartTime(), event)) {
+ match = event;
+ break;
+ }
+ }
+
string result;
char buf[100];
sprintf(buf, "T%d", timer->Index());
@@ -333,6 +348,14 @@ string cHelpers::ToText(cTimer * timer) {
result += MapSpecialChars(timer->File());
result += ":";
result += MapSpecialChars(timer->Aux() ? timer->Aux() : "");
+ if(match){
+ result += ":";
+ result += MapSpecialChars(match->ShortText() ? match->ShortText() : "");
+ result += ":";
+ result += MapSpecialChars(match->Description() ? match->Description() : "");
+ } else {
+ result += "::";
+ }
result += "\r\n";
return result;
@@ -386,7 +409,7 @@ bool cHelpers::IsWantedEvent(cEvent * event, string pattern) {
text += event->Description();
}
- return ToUpper(text).find(ToUpper(pattern)) != string::npos;
+ return ToLower(text).find(ToLower(pattern)) != string::npos;
}
bool cHelpers::IsWantedChannel(cChannel * channel, string wantedChannels) {
@@ -451,6 +474,18 @@ string cHelpers::ToUpper(string text)
return text;
}
+string cHelpers::ToLower(string text)
+{
+ for(unsigned i = 0; i < text.length(); i++)
+ {
+ if (isupper(text[i]))
+ text[i] = tolower(text[i]);
+ }
+
+ return text;
+}
+
+
string cHelpers::Trim(string text) {
const char * start = text.c_str();