mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Merge branch 'add_assignment_operator' of https://github.com/andreasbuhr/GoldenCheetah into andreasbuhr-add_assignment_operator
This commit is contained in:
@@ -49,6 +49,16 @@ public:
|
||||
: position(OnlyOneSegment), selectedPosition(NotAdjacent) { }
|
||||
QtStyleOptionSegmentControlSegment(const QtStyleOptionSegmentControlSegment &other)
|
||||
: QStyleOption(Version, Type) { *this = other; }
|
||||
QtStyleOptionSegmentControlSegment& operator=(const QtStyleOptionSegmentControlSegment &other)
|
||||
{
|
||||
QStyleOption::operator=(other);
|
||||
text = other.text;
|
||||
icon = other.icon;
|
||||
iconSize = other.iconSize;
|
||||
position = other.position;
|
||||
selectedPosition = other.selectedPosition;
|
||||
return *this;
|
||||
}
|
||||
|
||||
protected:
|
||||
QtStyleOptionSegmentControlSegment(int version);
|
||||
|
||||
@@ -41,11 +41,15 @@ public:
|
||||
for (int i = 0; i<MAX_MEASURES; i++) values[i] = 0.0;
|
||||
}
|
||||
Measure(const Measure &other) {
|
||||
*this = other;
|
||||
}
|
||||
Measure& operator=(const Measure &other) {
|
||||
this->when = other.when;
|
||||
this->comment = other.comment;
|
||||
this->source = other.source;
|
||||
this->originalSource = other.originalSource;
|
||||
for (int i = 0; i<MAX_MEASURES; i++) this->values[i] = other.values[i];
|
||||
return *this;
|
||||
}
|
||||
~Measure() {}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
v3(double a, double b, double c) : m_t(a, b, c) {};
|
||||
|
||||
v3(const v3& o) : m_t(o.m_t) {}
|
||||
v3& operator=(const v3& o) { m_t = o.m_t; return *this; }
|
||||
|
||||
double x() const { return std::get<0>(m_t); }
|
||||
double y() const { return std::get<1>(m_t); }
|
||||
|
||||
@@ -572,13 +572,17 @@ public:
|
||||
string[i]="";
|
||||
}
|
||||
}
|
||||
XDataPoint (const XDataPoint &other) {
|
||||
XDataPoint(const XDataPoint &other) {
|
||||
*this = other;
|
||||
}
|
||||
XDataPoint& operator=(const XDataPoint &other) {
|
||||
this->secs=other.secs;
|
||||
this->km=other.km;
|
||||
for(int i=0; i<XDATA_MAXVALUES; i++) {
|
||||
this->number[i]= other.number[i];
|
||||
this->string[i]= other.string[i];
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
double secs, km;
|
||||
@@ -589,7 +593,8 @@ public:
|
||||
class XDataSeries {
|
||||
public:
|
||||
XDataSeries() {}
|
||||
XDataSeries(XDataSeries &other) {
|
||||
XDataSeries(const XDataSeries& other) { *this = other; }
|
||||
XDataSeries& operator=(const XDataSeries &other) {
|
||||
name = other.name;
|
||||
valuename = other.valuename;
|
||||
unitname = other.unitname;
|
||||
@@ -599,6 +604,7 @@ public:
|
||||
foreach (XDataPoint *p, other.datapoints) {
|
||||
datapoints.push_back(new XDataPoint(*p));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
~XDataSeries() { foreach(XDataPoint *p, datapoints) delete p; }
|
||||
|
||||
Reference in New Issue
Block a user