mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Map: don't recalculate selected dive sites
In MapWidgetHelper::centerOnSelectedDiveSite() the selected dive sites were recalculated. Simply use the ones we already know are selected. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									83926213ea
								
							
						
					
					
						commit
						15cb7e4e92
					
				
					 1 changed files with 1 additions and 15 deletions
				
			
		|  | @ -47,23 +47,9 @@ void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds) | |||
| 
 | ||||
| void MapWidgetHelper::centerOnSelectedDiveSite() | ||||
| { | ||||
| 	QVector<struct dive_site *> selDS; | ||||
| 	QVector<struct dive_site *> selDS = m_mapLocationModel->selectedDs(); | ||||
| 	QVector<QGeoCoordinate> selGC; | ||||
| 
 | ||||
| 	int idx; | ||||
| 	struct dive *dive; | ||||
| 	for_each_dive (idx, dive) { | ||||
| 		if (!dive->selected) | ||||
| 			continue; | ||||
| 		struct dive_site *dss = get_dive_site_for_dive(dive); | ||||
| 		if (!dive_site_has_gps_location(dss)) | ||||
| 			continue; | ||||
| 		// only store dive sites with GPS
 | ||||
| 		selDS.append(dss); | ||||
| 		selGC.append(QGeoCoordinate(dss->location.lat.udeg * 0.000001, | ||||
| 		                            dss->location.lon.udeg * 0.000001)); | ||||
| 	} | ||||
| 
 | ||||
| 	if (selDS.isEmpty()) { | ||||
| 		// no selected dives with GPS coordinates
 | ||||
| 		QMetaObject::invokeMethod(m_map, "deselectMapLocation"); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue