diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2012-02-16 12:20:46 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2012-02-16 12:20:46 +0100 |
commit | 26d2fe51d139362a99d76a90de490138dea7477e (patch) | |
tree | b8296cdd1cdeca748b5d4be7fc72ddbc4093415a /recording.c | |
parent | 3432b2638c97ec1ac8afa9aa08246d221e2f89a5 (diff) | |
download | vdr-26d2fe51d139362a99d76a90de490138dea7477e.tar.gz vdr-26d2fe51d139362a99d76a90de490138dea7477e.tar.bz2 |
An ongoing editing process is now canceled if either the original or the edited version of the recording is deleted from the Recordings menu
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/recording.c b/recording.c index 4a856bb8..6f7d8850 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 2.47 2012/02/13 11:49:43 kls Exp $ + * $Id: recording.c 2.48 2012/02/16 11:53:13 kls Exp $ */ #include "recording.h" @@ -1217,12 +1217,14 @@ void cRecordings::DelByName(const char *FileName) char *ext = strrchr(recording->fileName, '.'); if (ext) { strncpy(ext, DELEXT, strlen(ext)); - recording->fileSizeMB = DirSizeMB(recording->FileName()); - recording->deleted = time(NULL); - DeletedRecordings.Add(recording); + if (access(recording->FileName(), F_OK) == 0) { + recording->fileSizeMB = DirSizeMB(recording->FileName()); + recording->deleted = time(NULL); + DeletedRecordings.Add(recording); + recording = NULL; // to prevent it from being deleted below + } } - else - delete recording; + delete recording; ChangeState(); TouchUpdate(); } |