1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed setting timer's summary for recording

This commit is contained in:
Klaus Schmidinger 2005-05-22 09:13:26 +02:00
parent a8b3516607
commit a0e6585304
2 changed files with 14 additions and 4 deletions

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 1.100 2005/05/16 15:17:22 kls Exp $ * $Id: recording.c 1.101 2005/05/22 09:13:26 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -230,6 +230,14 @@ cRecordingInfo::~cRecordingInfo()
delete ownEvent; delete ownEvent;
} }
void cRecordingInfo::SetTitleAndDescription(const char *Title, const char *Description)
{
if (isempty(event->Title()) && !isempty(Title))
((cEvent *)event)->SetTitle(Title);
if (!isempty(Description))
((cEvent *)event)->SetDescription(Description);
}
bool cRecordingInfo::Read(FILE *f) bool cRecordingInfo::Read(FILE *f)
{ {
if (ownEvent) { if (ownEvent) {
@ -414,7 +422,7 @@ cRecording::cRecording(cTimer *Timer, const cEvent *Event)
// timer into the recording info, but it saves us from having to actually // timer into the recording info, but it saves us from having to actually
// copy the entire event data: // copy the entire event data:
if (!isempty(Timer->Summary())) if (!isempty(Timer->Summary()))
((cEvent *)Event)->SetDescription(Timer->Summary()); info->SetTitleAndDescription(Timer->File(), Timer->Summary());
} }
cRecording::cRecording(const char *FileName) cRecording::cRecording(const char *FileName)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.h 1.35 2005/05/16 14:18:43 kls Exp $ * $Id: recording.h 1.36 2005/05/22 09:08:40 kls Exp $
*/ */
#ifndef __RECORDING_H #ifndef __RECORDING_H
@ -34,11 +34,13 @@ public:
}; };
class cRecordingInfo { class cRecordingInfo {
friend class cRecording;
private: private:
const cEvent *event; const cEvent *event;
cEvent *ownEvent; cEvent *ownEvent;
public:
cRecordingInfo(const cEvent *Event = NULL); cRecordingInfo(const cEvent *Event = NULL);
void SetTitleAndDescription(const char *Title, const char *Description);
public:
~cRecordingInfo(); ~cRecordingInfo();
const char *Title(void) const { return event->Title(); } const char *Title(void) const { return event->Title(); }
const char *ShortText(void) const { return event->ShortText(); } const char *ShortText(void) const { return event->ShortText(); }