Added Event Short Text (if available) to RecName

This commit is contained in:
louis 2013-12-24 11:30:47 +01:00
parent 5fa365b68c
commit 53fa2c70ca
3 changed files with 14 additions and 6 deletions

View File

@ -91,3 +91,4 @@ Version 1.1.0
- fixed wrong font for clock in horizontal view - fixed wrong font for clock in horizontal view
- Added feature to jump to a specific channel with number keys - Added feature to jump to a specific channel with number keys
- Fixed Bug 1484 - Fixed Bug 1484
- Added Event Short Text (if available) to RecName (Closes Ticket 1490)

View File

@ -98,14 +98,14 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) {
Timers.Add(timer); Timers.Add(timer);
isyslog("timer %s added (active)", *timer->ToDescr()); isyslog("timer %s added (active)", *timer->ToDescr());
} }
SetTimerPath(timer, path); SetTimerPath(timer, event, path);
Timers.SetModified(); Timers.SetModified();
return timer; return timer;
} }
cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) { cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) {
cTimer *t = new cTimer(event); cTimer *t = new cTimer(event);
SetTimerPath(t, path); SetTimerPath(t, event, path);
RemoteTimers_Timer_v1_0 rt; RemoteTimers_Timer_v1_0 rt;
rt.timer = t; rt.timer = t;
pRemoteTimers->Service("RemoteTimers::GetTimer-v1.0", &rt.timer); pRemoteTimers->Service("RemoteTimers::GetTimer-v1.0", &rt.timer);
@ -122,12 +122,19 @@ cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) {
return rt.timer; return rt.timer;
} }
void cRecManager::SetTimerPath(cTimer *timer, std::string path) { void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string path) {
cString newFileName;
if (path.size() > 0) { if (path.size() > 0) {
std::replace(path.begin(), path.end(), '/', '~'); std::replace(path.begin(), path.end(), '/', '~');
cString newFileName = cString::sprintf("%s~%s", path.c_str(), timer->File()); newFileName = cString::sprintf("%s~%s", path.c_str(), timer->File());
timer->SetFile(*newFileName); } else {
newFileName = event->Title();
} }
if(!isempty(event->ShortText()))
newFileName = cString::sprintf("%s~%s", *newFileName, event->ShortText());
timer->SetFile(*newFileName);
} }
void cRecManager::DeleteTimer(int timerID) { void cRecManager::DeleteTimer(int timerID) {

View File

@ -42,7 +42,7 @@ public:
cTimer *createTimer(const cEvent *event, std::string path); cTimer *createTimer(const cEvent *event, std::string path);
cTimer *createLocalTimer(const cEvent *event, std::string path); cTimer *createLocalTimer(const cEvent *event, std::string path);
cTimer *createRemoteTimer(const cEvent *event, std::string path); cTimer *createRemoteTimer(const cEvent *event, std::string path);
void SetTimerPath(cTimer *timer, std::string path); void SetTimerPath(cTimer *timer, const cEvent *event, std::string path);
void DeleteTimer(int timerID); void DeleteTimer(int timerID);
void DeleteTimer(const cEvent *event); void DeleteTimer(const cEvent *event);
void DeleteLocalTimer(const cEvent *event); void DeleteLocalTimer(const cEvent *event);