mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Desktop: Fix Inconsistencies in Handling of Salinity.
- add correct setting of the water type drop down for the dive shown initially after program start; - change salinity to have 3 decimals in planner, to make it consistency with the log. Fixes #4240. Reported-by: @ccsieh Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
		
							parent
							
								
									10fc3bfd47
								
							
						
					
					
						commit
						b126fccb1b
					
				
					 3 changed files with 9 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -185,13 +185,12 @@ void DivePlannerWidget::heightChanged(const int height)
 | 
			
		|||
 | 
			
		||||
void DivePlannerWidget::waterTypeUpdateTexts()
 | 
			
		||||
{
 | 
			
		||||
	double density;
 | 
			
		||||
	/* Do not set text in last/custom element */
 | 
			
		||||
	for (int i = 0; i < ui.waterType->count()-1; i++) {
 | 
			
		||||
		if (ui.waterType->itemData(i) != QVariant::Invalid) {
 | 
			
		||||
			QString densityText = ui.waterType->itemText(i).split("(")[0].trimmed();
 | 
			
		||||
			density = ui.waterType->itemData(i).toInt() / 10000.0;
 | 
			
		||||
			densityText.append(QString(" (%L1%2)").arg(density, 0, 'f', 2).arg(tr("kg/ℓ")));
 | 
			
		||||
			double density = ui.waterType->itemData(i).toInt() / 10000.0;
 | 
			
		||||
			densityText.append(QStringLiteral(" (%L1%2)").arg(density, 0, 'f', 3).arg(tr("kg/ℓ")));
 | 
			
		||||
			ui.waterType->setItemText(i, densityText);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue