mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 02:13:24 +00:00
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>
This commit is contained in:
parent
3987eb57fb
commit
803f5f9fbf
1 changed files with 4 additions and 4 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue