maplocationmodel: make setSelectedUuid() accept "fromClick" flag

The idea of this flag is to be able to only to emit the
selectedLocationChanged() signal when the user clicked on the map
(fromClick == true).

MapWidgetHelper::selectedLocationChanged() listens for this signal
and only then it will select nearby dives based on a "small-cicle".

If "fromClick" is false, it's the backend or the dive list that
updated the selection and MapWidgetHelper::selectedLocationChanged()
should no be called.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2017-07-24 17:00:06 +03:00 committed by Dirk Hohndel
parent 747f3d8cab
commit 5ea702199b
3 changed files with 11 additions and 15 deletions

View file

@ -60,7 +60,7 @@ Item {
MouseArea {
anchors.fill: parent
onClicked: {
mapHelper.model.selectedUuid = model.uuid
mapHelper.model.setSelectedUuid(model.uuid, true)
mapItemImageAnimation.restart()
}
}
@ -106,12 +106,12 @@ Item {
}
function centerOnMapLocation(mapLocation) {
mapHelper.model.selectedUuid = mapLocation.uuid
mapHelper.model.setSelectedUuid(mapLocation.uuid, false)
animateMapZoomIn(mapLocation.coordinate)
}
function deselectMapLocation() {
mapHelper.model.selectedUuid = 0
mapHelper.model.setSelectedUuid(0, false)
animateMapZoomOut()
}
}