From e9bcca910375f35c63afe8edb4ed0494fe4a4609 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Wed, 6 Dec 2017 18:54:46 +0100 Subject: Mobile: Enable editing multiple buddies While the autocomplete function only works for the first entry adding multiple comma separated buddies can still be done. Fixes #608 Signed-off-by: Joakim Bygdell --- mobile-widgets/qml/DiveDetails.qml | 2 +- mobile-widgets/qmlmanager.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index dc0af53b6..41e7f50be 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -229,7 +229,7 @@ Kirigami.Page { watertemp = currentItem.modelData.dive.waterTemp suitIndex = currentItem.modelData.dive.suitList.indexOf(currentItem.modelData.dive.suit) if (currentItem.modelData.dive.buddy.indexOf(",") > 0) { - buddyIndex = currentItem.modelData.dive.buddyList.indexOf(qsTr("Multiple Buddies")); + buddyText = currentItem.modelData.dive.buddy; } else { buddyIndex = currentItem.modelData.dive.buddyList.indexOf(currentItem.modelData.dive.buddy) } diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 413364a65..21ce76735 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1008,11 +1008,9 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q if (buddy.contains(",")){ buddy = buddy.replace(QRegExp("\\s*,\\s*"), ", "); } - if (!buddy.contains("Multiple Buddies")) { - diveChanged = true; - free(d->buddy); - d->buddy = strdup(qPrintable(buddy)); - } + diveChanged = true; + free(d->buddy); + d->buddy = strdup(qPrintable(buddy)); } if (myDive->divemaster() != diveMaster) { diveChanged = true; -- cgit v1.2.3-70-g09d2