summaryrefslogtreecommitdiff
path: root/tasks.cpp
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2008-01-25 01:09:49 +0100
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2008-01-25 01:09:49 +0100
commit5c5da204386e7a63ed4fac1d458dd10a120470e0 (patch)
treedeb3e5f385ddeee6c1746714859fb1de09177299 /tasks.cpp
parente2496312144175ba6fc030eb9f8f9781590f5e6b (diff)
downloadvdr-plugin-live-5c5da204386e7a63ed4fac1d458dd10a120470e0.tar.gz
vdr-plugin-live-5c5da204386e7a63ed4fac1d458dd10a120470e0.tar.bz2
Fixed bug that the recordings items were not deleted when the tree was
rebuild. This was because of the non weak references to the parent items. Deleting of recordings can be triggered now. It still needs some tweaking on the visual feedback. And possibly a 'undelete' option for the last deleted recording.
Diffstat (limited to 'tasks.cpp')
-rw-r--r--tasks.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/tasks.cpp b/tasks.cpp
index d7acaf3..9f20190 100644
--- a/tasks.cpp
+++ b/tasks.cpp
@@ -161,7 +161,7 @@ void BackwardRecordingTask::Action()
RecordingsManagerPtr recordings = LiveRecordingsManager();
cRecording const* recording = recordings->GetByMd5Hash( m_recording );
if ( recording == 0 ) {
- SetError( tr("Couldn't find recording or no recordings available.") );
+ SetError(tr("Couldn't find recording or no recordings available."));
return;
}
@@ -186,6 +186,27 @@ void BackwardRecordingTask::Action()
replayControl->Backward();
}
+
+void RemoveRecordingTask::Action()
+{
+ RecordingsManagerPtr recordings = LiveRecordingsManager();
+ cRecording const * recording = recordings->GetByMd5Hash( m_recording );
+ if ( recording == 0 ) {
+ SetError( tr("Couldn't find recording or no recordings available.") );
+ return;
+ }
+
+ m_recName = recording->Name();
+
+ const char *current = NowReplaying();
+ if (current && (0 == strcmp(current, recording->FileName()))) {
+ SetError(tr("Attempt to delete recording currently in playback."));
+ return;
+ }
+
+ recordings->DeleteRecording(recording);
+}
+
TaskManager::TaskManager()
{
}