aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/cleanertablemodel.h4
-rw-r--r--qt-models/cylindermodel.cpp5
2 files changed, 3 insertions, 6 deletions
diff --git a/qt-models/cleanertablemodel.h b/qt-models/cleanertablemodel.h
index 4299e9002..d54deb248 100644
--- a/qt-models/cleanertablemodel.h
+++ b/qt-models/cleanertablemodel.h
@@ -31,8 +31,4 @@ private:
QStringList headers;
};
-/* Has the string value changed */
-#define CHANGED() \
- (vString = value.toString()) != data(index, role).toString()
-
#endif
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index df8bd179d..62f9118f1 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -291,7 +291,6 @@ cylinder_t *CylindersModel::cylinderAt(const QModelIndex &index)
bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
- QString vString;
if (!d)
return false;
@@ -321,7 +320,9 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
return false;
}
- bool changed = CHANGED();
+ QString vString = value.toString();
+ bool changed = vString != data(index, role).toString();
+
if (index.column() != TYPE && !changed)
return false;