Remove now stale arguments to "CHANGED()" macro

We now never remove units or percentage signs, and always just compare
the string data, so we should remove the hacky arguments that are no
longer used.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2014-01-09 10:47:28 +08:00 committed by Dirk Hohndel
parent 1d2238b110
commit 7ba167e1b3

View file

@ -182,9 +182,9 @@ void CylindersModel::passInData(const QModelIndex& index, const QVariant& value)
} }
} }
#define CHANGED(_t,_u1,_u2) \ /* Has the string value changed */
(vString = value.toString().remove(_u1).remove(_u2))._t() != \ #define CHANGED() \
data(index, role).toString().remove(_u1).remove(_u2)._t() (vString = value.toString()) != data(index, role).toString()
bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, int role) bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, int role)
{ {
@ -206,7 +206,7 @@ bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, in
} }
break; break;
case SIZE: case SIZE:
if (CHANGED(data, "", "")) { if (CHANGED()) {
TankInfoModel *tanks = TankInfoModel::instance(); TankInfoModel *tanks = TankInfoModel::instance();
QModelIndexList matches = tanks->match(tanks->index(0,0), Qt::DisplayRole, cyl->type.description); QModelIndexList matches = tanks->match(tanks->index(0,0), Qt::DisplayRole, cyl->type.description);
@ -218,7 +218,7 @@ bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, in
} }
break; break;
case WORKINGPRESS: case WORKINGPRESS:
if (CHANGED(data, "", "")) { if (CHANGED()) {
TankInfoModel *tanks = TankInfoModel::instance(); TankInfoModel *tanks = TankInfoModel::instance();
QModelIndexList matches = tanks->match(tanks->index(0,0), Qt::DisplayRole, cyl->type.description); QModelIndexList matches = tanks->match(tanks->index(0,0), Qt::DisplayRole, cyl->type.description);
cyl->type.workingpressure = string_to_pressure(vString.toUtf8().data()); cyl->type.workingpressure = string_to_pressure(vString.toUtf8().data());
@ -228,31 +228,31 @@ bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, in
} }
break; break;
case START: case START:
if (CHANGED(data, "", "")) { if (CHANGED()) {
cyl->start = string_to_pressure(vString.toUtf8().data()); cyl->start = string_to_pressure(vString.toUtf8().data());
changed = true; changed = true;
} }
break; break;
case END: case END:
if (CHANGED(data, "", "")) { if (CHANGED()) {
cyl->end = string_to_pressure(vString.toUtf8().data()); cyl->end = string_to_pressure(vString.toUtf8().data());
changed = true; changed = true;
} }
break; break;
case O2: case O2:
if (CHANGED(data, "", "")) { if (CHANGED()) {
cyl->gasmix.o2 = string_to_fraction(vString.toUtf8().data()); cyl->gasmix.o2 = string_to_fraction(vString.toUtf8().data());
changed = true; changed = true;
} }
break; break;
case HE: case HE:
if (CHANGED(data, "", "")) { if (CHANGED()) {
cyl->gasmix.he = string_to_fraction(vString.toUtf8().data()); cyl->gasmix.he = string_to_fraction(vString.toUtf8().data());
changed = true; changed = true;
} }
break; break;
case DEPTH: case DEPTH:
if (CHANGED(data, "", "")) if (CHANGED())
cyl->depth = string_to_depth(vString.toUtf8().data()); cyl->depth = string_to_depth(vString.toUtf8().data());
} }
dataChanged(index, index); dataChanged(index, index);
@ -558,7 +558,7 @@ bool WeightModel::setData(const QModelIndex& index, const QVariant& value, int r
} }
break; break;
case WEIGHT: case WEIGHT:
if (CHANGED(data, "", "")) { if (CHANGED()) {
ws->weight = string_to_weight(vString.toUtf8().data()); ws->weight = string_to_weight(vString.toUtf8().data());
// now update the ws_info // now update the ws_info
changed = true; changed = true;