mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	UI restructure: when adding a dive via displayed_dive it needs valid id
Otherwise we have one (or - yikes - more) dives with id 0. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									947d7b77df
								
							
						
					
					
						commit
						5fca5f421d
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -491,6 +491,8 @@ void MainWindow::on_actionAddDive_triggered() | ||||||
| 	DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD); | 	DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD); | ||||||
| 
 | 
 | ||||||
| 	clear_dive(&displayed_dive); | 	clear_dive(&displayed_dive); | ||||||
|  | 	// but wait - we need a valid id... and a start time and an appropriatae dc model
 | ||||||
|  | 	displayed_dive.id = dive_getUniqID(&displayed_dive); | ||||||
| 	displayed_dive.when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset() + 3600; | 	displayed_dive.when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset() + 3600; | ||||||
| 	displayed_dive.dc.model = "manually added dive"; // don't translate! this is stored in the XML file
 | 	displayed_dive.dc.model = "manually added dive"; // don't translate! this is stored in the XML file
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue