summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Engel <dengel@mythtv.org>2012-01-23 17:52:32 (GMT)
committer David Engel <dengel@mythtv.org>2012-01-23 17:59:58 (GMT)
commite4660d6e67ec20ba5f6774738601d9ab992fb9e4 (patch)
tree69cd660c6406f30922216978ff5cef7925bf8f72
parent54c4d39b369b87449da9a30436b79516b519df5c (diff)
Fix "Clear Override" to not create invalid rules.
Cherry-picked from master commit 6c2276fe. Fix RecordingInfo::ApplyRecordStateChange() to delete the underlying rule instead of saving it when the new type is kNotRecording. Previously, this would result in an invalid rule with type 0.
-rw-r--r--mythtv/libs/libmythtv/recordinginfo.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/mythtv/libs/libmythtv/recordinginfo.cpp b/mythtv/libs/libmythtv/recordinginfo.cpp
index 3e2e7a9..9f90d97 100644
--- a/mythtv/libs/libmythtv/recordinginfo.cpp
+++ b/mythtv/libs/libmythtv/recordinginfo.cpp
@@ -518,7 +518,12 @@ void RecordingInfo::ApplyRecordStateChange(RecordingType newstate, bool save)
record->m_type = newstate;
if (save)
- record->Save();
+ {
+ if (newstate == kNotRecording)
+ record->Delete();
+ else
+ record->Save();
+ }
}
/** \fn RecordingInfo::ApplyRecordRecPriorityChange(int)