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
|
watertemp = currentItem.modelData.dive.waterTemp
|
||||||
suitIndex = currentItem.modelData.dive.suitList.indexOf(currentItem.modelData.dive.suit)
|
suitIndex = currentItem.modelData.dive.suitList.indexOf(currentItem.modelData.dive.suit)
|
||||||
if (currentItem.modelData.dive.buddy.indexOf(",") > 0) {
|
if (currentItem.modelData.dive.buddy.indexOf(",") > 0) {
|
||||||
buddyIndex = currentItem.modelData.dive.buddyList.indexOf(qsTr("Multiple Buddies"));
|
buddyText = currentItem.modelData.dive.buddy;
|
||||||
} else {
|
} else {
|
||||||
buddyIndex = currentItem.modelData.dive.buddyList.indexOf(currentItem.modelData.dive.buddy)
|
buddyIndex = currentItem.modelData.dive.buddyList.indexOf(currentItem.modelData.dive.buddy)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1008,12 +1008,10 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q
|
||||||
if (buddy.contains(",")){
|
if (buddy.contains(",")){
|
||||||
buddy = buddy.replace(QRegExp("\\s*,\\s*"), ", ");
|
buddy = buddy.replace(QRegExp("\\s*,\\s*"), ", ");
|
||||||
}
|
}
|
||||||
if (!buddy.contains("Multiple Buddies")) {
|
|
||||||
diveChanged = true;
|
diveChanged = true;
|
||||||
free(d->buddy);
|
free(d->buddy);
|
||||||
d->buddy = strdup(qPrintable(buddy));
|
d->buddy = strdup(qPrintable(buddy));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (myDive->divemaster() != diveMaster) {
|
if (myDive->divemaster() != diveMaster) {
|
||||||
diveChanged = true;
|
diveChanged = true;
|
||||||
free(d->divemaster);
|
free(d->divemaster);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue