mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	mapwidgethelper.cpp: call deselectMapLocation() in QML
If a divesite doesn't have a GPS location we want to deselect the currently selected markers and zoom out the map. In the Map QML object the function deselectMapLocation will handle that. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
		
							parent
							
								
									250fc1e03f
								
							
						
					
					
						commit
						11eaea01dd
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -15,8 +15,10 @@ MapWidgetHelper::MapWidgetHelper(QObject *parent) : QObject(parent) | ||||||
| 
 | 
 | ||||||
| void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds) | void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds) | ||||||
| { | { | ||||||
| 	if (!dive_site_has_gps_location(ds)) | 	if (!dive_site_has_gps_location(ds)) { | ||||||
|  | 		QMetaObject::invokeMethod(m_map, "deselectMapLocation"); | ||||||
| 		return; | 		return; | ||||||
|  | 	} | ||||||
| 	MapLocation *location = m_mapLocationModel->getMapLocationForUuid(ds->uuid); | 	MapLocation *location = m_mapLocationModel->getMapLocationForUuid(ds->uuid); | ||||||
| 	QMetaObject::invokeMethod(m_map, "centerOnMapLocation", Q_ARG(QVariant, QVariant::fromValue(location))); | 	QMetaObject::invokeMethod(m_map, "centerOnMapLocation", Q_ARG(QVariant, QVariant::fromValue(location))); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue