diff --git a/HISTORY b/HISTORY index daa9294..0c9e83c 100644 --- a/HISTORY +++ b/HISTORY @@ -91,3 +91,4 @@ Version 1.1.0 - fixed wrong font for clock in horizontal view - Added feature to jump to a specific channel with number keys - Fixed Bug 1484 +- Added Event Short Text (if available) to RecName (Closes Ticket 1490) diff --git a/recmanager.c b/recmanager.c index 54e05f1..32bff2a 100644 --- a/recmanager.c +++ b/recmanager.c @@ -98,14 +98,14 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { Timers.Add(timer); isyslog("timer %s added (active)", *timer->ToDescr()); } - SetTimerPath(timer, path); + SetTimerPath(timer, event, path); Timers.SetModified(); return timer; } cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) { cTimer *t = new cTimer(event); - SetTimerPath(t, path); + SetTimerPath(t, event, path); RemoteTimers_Timer_v1_0 rt; rt.timer = t; pRemoteTimers->Service("RemoteTimers::GetTimer-v1.0", &rt.timer); @@ -122,12 +122,19 @@ cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) { 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) { std::replace(path.begin(), path.end(), '/', '~'); - cString newFileName = cString::sprintf("%s~%s", path.c_str(), timer->File()); - timer->SetFile(*newFileName); + newFileName = cString::sprintf("%s~%s", path.c_str(), timer->File()); + } else { + newFileName = event->Title(); } + + if(!isempty(event->ShortText())) + newFileName = cString::sprintf("%s~%s", *newFileName, event->ShortText()); + + timer->SetFile(*newFileName); } void cRecManager::DeleteTimer(int timerID) { diff --git a/recmanager.h b/recmanager.h index 158991f..ec18225 100644 --- a/recmanager.h +++ b/recmanager.h @@ -42,7 +42,7 @@ public: cTimer *createTimer(const cEvent *event, std::string path); cTimer *createLocalTimer(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(const cEvent *event); void DeleteLocalTimer(const cEvent *event);