Skip to content

Commit

Permalink
Properly override clone methods in parent class.
Browse files Browse the repository at this point in the history
The signature of RecordingInfo::clone() changed a while back
without the corresponding change being made to the ProgramRecPriorityInfo
class that inherits from RecordingInfo.
  • Loading branch information
daniel-kristjansson committed Dec 4, 2012
1 parent 6b6fd87 commit b914e1c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 42 deletions.
76 changes: 39 additions & 37 deletions mythtv/programs/mythfrontend/programrecpriority.cpp
Expand Up @@ -57,53 +57,55 @@ ProgramRecPriorityInfo::ProgramRecPriorityInfo(
{
}

ProgramRecPriorityInfo &ProgramRecPriorityInfo::operator=(
const ProgramInfo &other)
void ProgramRecPriorityInfo::clone(
const ProgramRecPriorityInfo &other, bool ignore_non_serialized_data)
{
return clone(other);
}
RecordingInfo::clone(other, ignore_non_serialized_data);

ProgramRecPriorityInfo &ProgramRecPriorityInfo::operator=(
const ProgramRecPriorityInfo &other)
{
return clone(other);
}

ProgramRecPriorityInfo &ProgramRecPriorityInfo::operator=(
const RecordingInfo &other)
{
return clone((ProgramInfo&)other);
if (!ignore_non_serialized_data)
{
recType = other.recType;
matchCount = other.matchCount;
recCount = other.recCount;
last_record = other.last_record;
avg_delay = other.avg_delay;
autoRecPriority = other.autoRecPriority;
profile = other.profile;
}
}

ProgramRecPriorityInfo &ProgramRecPriorityInfo::clone(
const ProgramRecPriorityInfo &other)
void ProgramRecPriorityInfo::clone(
const RecordingInfo &other, bool ignore_non_serialized_data)
{
RecordingInfo::clone(other);

recType = other.recType;
matchCount = other.matchCount;
recCount = other.recCount;
last_record = other.last_record;
avg_delay = other.avg_delay;
autoRecPriority = other.autoRecPriority;
profile = other.profile;
RecordingInfo::clone(other, ignore_non_serialized_data);

return *this;
if (!ignore_non_serialized_data)
{
recType = kNotRecording;
matchCount = 0;
recCount = 0;
last_record = QDateTime();
avg_delay = 0;
autoRecPriority = 0;
profile.clear();
}
}

ProgramRecPriorityInfo &ProgramRecPriorityInfo::clone(const ProgramInfo &other)
void ProgramRecPriorityInfo::clone(
const ProgramInfo &other, bool ignore_non_serialized_data)
{
RecordingInfo::clone(other);
RecordingInfo::clone(other, ignore_non_serialized_data);

recType = kNotRecording;
matchCount = 0;
recCount = 0;
last_record = QDateTime();
avg_delay = 0;
autoRecPriority = 0;
profile.clear();

return *this;
if (!ignore_non_serialized_data)
{
recType = kNotRecording;
matchCount = 0;
recCount = 0;
last_record = QDateTime();
avg_delay = 0;
autoRecPriority = 0;
profile.clear();
}
}

void ProgramRecPriorityInfo::clear(void)
Expand Down
17 changes: 12 additions & 5 deletions mythtv/programs/mythfrontend/programrecpriority.h
Expand Up @@ -26,12 +26,19 @@ class ProgramRecPriorityInfo : public RecordingInfo
public:
ProgramRecPriorityInfo();
ProgramRecPriorityInfo(const ProgramRecPriorityInfo &other);
ProgramRecPriorityInfo &operator=(const ProgramRecPriorityInfo&);
ProgramRecPriorityInfo &operator=(const RecordingInfo&);
ProgramRecPriorityInfo &operator=(const ProgramInfo&);
ProgramRecPriorityInfo &operator=(const ProgramRecPriorityInfo &other)
{ clone(other); return *this; }
ProgramRecPriorityInfo &operator=(const RecordingInfo &other)
{ clone(other); return *this; }
ProgramRecPriorityInfo &operator=(const ProgramInfo &other)
{ clone(other); return *this; }
virtual void clone(const ProgramRecPriorityInfo &other,
bool ignore_non_serialized_data = false);
virtual void clone(const RecordingInfo &other,
bool ignore_non_serialized_data = false);
virtual void clone(const ProgramInfo &other,
bool ignore_non_serialized_data = false);

virtual ProgramRecPriorityInfo &clone(const ProgramRecPriorityInfo &other);
virtual ProgramRecPriorityInfo &clone(const ProgramInfo &other);
virtual void clear(void);

virtual void ToMap(QHash<QString, QString> &progMap,
Expand Down

0 comments on commit b914e1c

Please sign in to comment.