mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <j.bygdell@gmail.com>
This commit is contained in:
parent
a2a2aec9f0
commit
e9bcca9103
2 changed files with 4 additions and 6 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue