diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2008-01-25 01:09:49 +0100 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2008-01-25 01:09:49 +0100 |
commit | 5c5da204386e7a63ed4fac1d458dd10a120470e0 (patch) | |
tree | deb3e5f385ddeee6c1746714859fb1de09177299 /tasks.cpp | |
parent | e2496312144175ba6fc030eb9f8f9781590f5e6b (diff) | |
download | vdr-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.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -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() { } |