summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/modeldelegates.cpp4
-rw-r--r--qt-ui/models.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 8b70b48b3..7079173c4 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -271,7 +271,7 @@ QWidget *TankInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
QWidget *delegate = ComboBoxDelegate::createEditor(parent, option, index);
CylindersModel *mymodel = qobject_cast<CylindersModel *>(currCombo.model);
cylinder_t *cyl = mymodel->cylinderAt(index);
- currCylinderData.type = cyl->type.description;
+ currCylinderData.type = copy_string(cyl->type.description);
currCylinderData.pressure = cyl->type.workingpressure.mbar;
currCylinderData.size = cyl->type.size.mliter;
return delegate;
@@ -323,7 +323,7 @@ QWidget *WSInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewIte
QWidget *editor = ComboBoxDelegate::createEditor(parent, option, index);
WeightModel *mymodel = qobject_cast<WeightModel *>(currCombo.model);
weightsystem_t *ws = mymodel->weightSystemAt(index);
- currWeight.type = ws->description;
+ currWeight.type = copy_string(ws->description);
currWeight.weight = ws->weight.grams;
return editor;
}
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index e62598479..f73b1dc94 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -632,7 +632,7 @@ bool WeightModel::setData(const QModelIndex &index, const QVariant &value, int r
int i = -1;
while (ws_info[++i].name) {
if (gettextFromC::instance()->tr(ws_info[i].name) == vString) {
- ws->description = ws_info[i].name;
+ ws->description = copy_string(ws_info[i].name);
break;
}
}