summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-models/cylindermodel.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index 554d81cc7..641fe3f18 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -8,6 +8,7 @@
#include "qt-models/diveplannermodel.h"
#include "core/gettextfromc.h"
#include "core/subsurface-qt/divelistnotifier.h"
+#include "core/subsurface-string.h"
CylindersModel::CylindersModel(QObject *parent) :
CleanerTableModel(parent),
@@ -317,13 +318,11 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
}
switch (index.column()) {
- case TYPE:
- if (!value.isNull()) {
- QByteArray ba = value.toByteArray();
- const char *text = ba.constData();
- if (!cyl->type.description || strcmp(cyl->type.description, text)) {
+ case TYPE: {
+ QString type = value.toString();
+ if (!same_string(qPrintable(type), cyl->type.description)) {
free((void *)cyl->type.description);
- cyl->type.description = strdup(text);
+ cyl->type.description = strdup(qPrintable(type));
changed = true;
}
}