summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-01-09 10:47:28 +0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-09 15:48:33 +0800
commit0646f3e9ff3e5289b65d24d5f41408ee5be4a845 (patch)
treed9c7aff4b8c8b20f8c381b2954862673c2673949
parent3734bb9068d4b66fa76b0e13a027b1a8497ae27f (diff)
downloadsubsurface-0646f3e9ff3e5289b65d24d5f41408ee5be4a845.tar.gz
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>
-rw-r--r--qt-ui/models.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 323086196..b981793fb 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -182,9 +182,9 @@ void CylindersModel::passInData(const QModelIndex& index, const QVariant& value)
}
}
-#define CHANGED(_t,_u1,_u2) \
- (vString = value.toString().remove(_u1).remove(_u2))._t() != \
- data(index, role).toString().remove(_u1).remove(_u2)._t()
+/* Has the string value changed */
+#define CHANGED() \
+ (vString = value.toString()) != data(index, role).toString()
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;
case SIZE:
- if (CHANGED(data, "", "")) {
+ if (CHANGED()) {
TankInfoModel *tanks = TankInfoModel::instance();
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;
case WORKINGPRESS:
- if (CHANGED(data, "", "")) {
+ if (CHANGED()) {
TankInfoModel *tanks = TankInfoModel::instance();
QModelIndexList matches = tanks->match(tanks->index(0,0), Qt::DisplayRole, cyl->type.description);
cyl->type.workingpressure = string_to_pressure(vString.toUtf8().data());
@@ -228,31 +228,31 @@ bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, in
}
break;
case START:
- if (CHANGED(data, "", "")) {
+ if (CHANGED()) {
cyl->start = string_to_pressure(vString.toUtf8().data());
changed = true;
}
break;
case END:
- if (CHANGED(data, "", "")) {
+ if (CHANGED()) {
cyl->end = string_to_pressure(vString.toUtf8().data());
changed = true;
}
break;
case O2:
- if (CHANGED(data, "", "")) {
+ if (CHANGED()) {
cyl->gasmix.o2 = string_to_fraction(vString.toUtf8().data());
changed = true;
}
break;
case HE:
- if (CHANGED(data, "", "")) {
+ if (CHANGED()) {
cyl->gasmix.he = string_to_fraction(vString.toUtf8().data());
changed = true;
}
break;
case DEPTH:
- if (CHANGED(data, "", ""))
+ if (CHANGED())
cyl->depth = string_to_depth(vString.toUtf8().data());
}
dataChanged(index, index);
@@ -558,7 +558,7 @@ bool WeightModel::setData(const QModelIndex& index, const QVariant& value, int r
}
break;
case WEIGHT:
- if (CHANGED(data, "", "")) {
+ if (CHANGED()) {
ws->weight = string_to_weight(vString.toUtf8().data());
// now update the ws_info
changed = true;