summaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-07 22:22:07 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-07 22:22:07 -0800
commit803f5f9fbf710279ced115e480427e8159e552b0 (patch)
tree46e509de9de3067c124abea8f13faeae9f7ac727 /qt-mobile
parent3987eb57fb9f4ff109f191d6cb0c13569fd7948e (diff)
downloadsubsurface-803f5f9fbf710279ced115e480427e8159e552b0.tar.gz
QML-UI: that's not how you compare char pointers...
Well, at least it doesn't what you think it does. Let's use our little helper to actually compare the strings. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r--qt-mobile/qmlmanager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index 9f9bdc772..0fbdac286 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -230,22 +230,22 @@ void QMLManager::commitChanges(QString diveId, QString suit, QString buddy, QStr
struct dive *d = get_dive_by_uniq_id(diveId.toInt());
bool diveChanged = false;
- if (d->suit != suit.toUtf8().data()) {
+ if (!same_string(d->suit, suit.toUtf8().data())) {
diveChanged = true;
free(d->suit);
d->suit = strdup(suit.toUtf8().data());
}
- if (d->buddy != buddy.toUtf8().data()) {
+ if (!same_string(d->buddy, buddy.toUtf8().data())) {
diveChanged = true;
free(d->buddy);
d->buddy = strdup(buddy.toUtf8().data());
}
- if (d->divemaster != diveMaster.toUtf8().data()) {
+ if (!same_string(d->divemaster, diveMaster.toUtf8().data())) {
diveChanged = true;
free(d->divemaster);
d->divemaster = strdup(diveMaster.toUtf8().data());
}
- if (d->notes != notes.toUtf8().data()) {
+ if (!same_string(d->notes, notes.toUtf8().data())) {
diveChanged = true;
free(d->notes);
d->notes = strdup(notes.toUtf8().data());