diff options
author | Jocke <j.bygdell@gmail.com> | 2018-11-13 21:28:18 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-11-15 18:10:13 +0800 |
commit | 03143f1ef1a3b290c7e721ee5109e0ef275f6cec (patch) | |
tree | ccad6a459bf11cda119704f38d0ed8e288576914 /mobile-widgets/qmlmanager.cpp | |
parent | 15c7ee5db0d61bd12f66cea942b89cc1ef6bad6f (diff) | |
download | subsurface-03143f1ef1a3b290c7e721ee5109e0ef275f6cec.tar.gz |
Mobile: Allow multiple divemasters
While not something that many will use, editing a dive on
Subsurface-mobile should not result in data loss.
This makes the divemaster field behave in the same way as the buddy
field with regards to multiple entries.
Fixes #1853
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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); |