summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-gui.cpp4
-rw-r--r--qt-ui/models.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp
index caacdb1df..2b9f97d82 100644
--- a/qt-gui.cpp
+++ b/qt-gui.cpp
@@ -74,11 +74,9 @@ void init_qt_ui(int *argcp, char ***argvp, char *errormessage)
const char *getSetting(QSettings &s, QString name)
{
QVariant v;
- QString text;
v = s.value(name);
if (v.isValid()) {
- text = v.toString();
- return strdup(text.toUtf8());
+ return strdup(v.toString().toUtf8().constData());
}
return NULL;
}
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 2bc21df42..6c6d0b133 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -139,7 +139,8 @@ bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, in
switch(index.column()) {
case TYPE:
if (!value.isNull()) {
- char *text = value.toByteArray().data();
+ QByteArray ba = value.toByteArray();
+ const char *text = ba.constData();
if (!cyl->type.description || strcmp(cyl->type.description, text)) {
cyl->type.description = strdup(text);
mark_divelist_changed(TRUE);
@@ -373,7 +374,8 @@ bool WeightModel::setData(const QModelIndex& index, const QVariant& value, int r
switch(index.column()) {
case TYPE:
if (!value.isNull()) {
- char *text = strdup(value.toString().toUtf8().data());
+ QByteArray ba = value.toString().toUtf8();
+ const char *text = ba.constData();
if (!ws->description || strcmp(ws->description, text)) {
ws->description = strdup(text);
mark_divelist_changed(TRUE);