mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									747f3d8cab
								
							
						
					
					
						commit
						5ea702199b
					
				
					 3 changed files with 11 additions and 15 deletions
				
			
		|  | @ -93,15 +93,12 @@ void MapLocationModel::clear() | |||
| 	endRemoveRows(); | ||||
| } | ||||
| 
 | ||||
| quint32 MapLocationModel::selectedUuid() | ||||
| void MapLocationModel::setSelectedUuid(QVariant uuid, QVariant fromClick) | ||||
| { | ||||
| 	return m_selectedUuid; | ||||
| } | ||||
| 
 | ||||
| void MapLocationModel::setSelectedUuid(quint32 uuid) | ||||
| { | ||||
| 	m_selectedUuid = uuid; | ||||
| 	emit selectedLocationChanged(getMapLocationForUuid(uuid)); | ||||
| 	m_selectedUuid = qvariant_cast<quint32>(uuid); | ||||
| 	const bool fromClickBool = qvariant_cast<bool>(fromClick); | ||||
| 	if (fromClickBool) | ||||
| 		emit selectedLocationChanged(getMapLocationForUuid(m_selectedUuid)); | ||||
| } | ||||
| 
 | ||||
| MapLocation *MapLocationModel::getMapLocationForUuid(quint32 uuid) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue