Permalink
Browse files

Properly override clone methods in parent class.

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 b914e1c59a2d335185c8d03cf9e9d14e76d8c633
@@ -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)
@@ -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,

0 comments on commit b914e1c

Please sign in to comment.