Revert "Add getFingerprint method to detect all changes in UserMetricSettings"

This reverts commit c726325af6.
This commit is contained in:
Ale Martinez
2021-03-07 10:48:07 -03:00
parent e1b8293f01
commit e6b302dd6c
2 changed files with 19 additions and 18 deletions

View File

@@ -179,11 +179,11 @@ quint16
RideMetric::userMetricFingerprint(QList<UserMetricSettings> these)
{
// run through loaded metrics and compute a fingerprint CRC
quint16 fingerprint = 0;
QByteArray fingers;
foreach(UserMetricSettings x, these)
fingerprint += x.getFingerprint();
fingers += x.fingerprint.toLocal8Bit();
return fingerprint;
return qChecksum(fingers.constData(), fingers.size());
}
QHash<QString,RideMetricPtr>

View File

@@ -45,23 +45,24 @@ class UserMetricSettings {
public:
qint16 getFingerprint() const {
bool operator!= (UserMetricSettings right) const {
// mostly used to see if it changed when editing
QByteArray ba = QString(this->symbol +
this->name +
this->description +
this->unitsMetric +
this->unitsImperial +
this->type +
this->precision +
this->aggzero +
this->istime +
this->conversion +
this->conversionSum +
this->program).toUtf8();
return qChecksum(ba, ba.length());
if (this->symbol != right.symbol ||
this->name != right.name ||
this->description != right.description ||
this->unitsMetric != right.unitsMetric ||
this->unitsImperial != right.unitsImperial ||
this->conversion != right.conversion ||
this->conversionSum != right.conversionSum ||
this->program != right.program ||
this->precision != right.precision ||
this->istime != right.istime ||
this->aggzero != right.aggzero ||
this->fingerprint != right.fingerprint)
return true;
else
return false;
}
QString symbol,