mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Do not reset the model when adding a new dive site
This makes insertion faster, and also it doesn't break the current selection in the QComboBox. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									612b068e33
								
							
						
					
					
						commit
						09ca240c3e
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -54,8 +54,11 @@ int32_t LocationInformationModel::addDiveSite(const QString& name, int lon, int | |||
| 	latitude.udeg = lat; | ||||
| 	longitude.udeg = lon; | ||||
| 
 | ||||
| 	beginInsertRows(QModelIndex(), dive_site_table.nr, dive_site_table.nr); | ||||
| 	int32_t uuid = create_dive_site_with_gps(name.toUtf8().data(), latitude, longitude); | ||||
| 	update(); | ||||
| 	std::sort(dive_site_table.dive_sites, dive_site_table.dive_sites + dive_site_table.nr, dive_site_less_than); | ||||
| 	internalRowCount = dive_site_table.nr; | ||||
| 	endInsertRows(); | ||||
| 	return uuid; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue