summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/DiveDetails.qml7
-rw-r--r--mobile-widgets/qmlmanager.cpp3
2 files changed, 9 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml
index fbffa5303..3b2fd2c1c 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -258,7 +258,12 @@ Kirigami.Page {
buddyIndex = manager.buddyList.indexOf(currentItem.modelData.dive.buddy)
}
buddyText = currentItem.modelData.dive.buddy;
- divemasterIndex = manager.divemasterList.indexOf(currentItem.modelData.dive.divemaster)
+ if (currentItem.modelData.dive.divemaster.indexOf(",") > 0) {
+ divemasterIndex = manager.divemasterList.indexOf(currentItem.modelData.dive.divemaster.split(",", 1).toString())
+ } else {
+ divemasterIndex = manager.divemasterList.indexOf(currentItem.modelData.dive.divemaster)
+ }
+ divemasterText = currentItem.modelData.dive.divemaster
notes = currentItem.modelData.dive.notes
if (currentItem.modelData.dive.singleWeight) {
// we have only one weight, go ahead, have fun and edit it
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 81c8f324f..8ce1a4616 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1093,6 +1093,9 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q
d->buddy = copy_qstring(buddy);
}
if (myDive->divemaster() != diveMaster) {
+ if (diveMaster.contains(",")){
+ diveMaster = diveMaster.replace(QRegExp("\\s*,\\s*"), ", ");
+ }
diveChanged = true;
free(d->divemaster);
d->divemaster = copy_qstring(diveMaster);