mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Dive computers: turn QMultiMap into sorted vector
The list of known dive computers was stored in a multi-map indexed by the device name. Turn this into a sorted QVector. Thus, no map-to-list conversion is needed in the device editing dialog, which distinctly simplifies the code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									8e8cd7a8d9
								
							
						
					
					
						commit
						1f654050fa
					
				
					 6 changed files with 63 additions and 103 deletions
				
			
		| 
						 | 
				
			
			@ -19,8 +19,7 @@ DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt::
 | 
			
		|||
 | 
			
		||||
void DiveComputerManagementDialog::init()
 | 
			
		||||
{
 | 
			
		||||
	model.reset(new DiveComputerModel(dcList.dcMap));
 | 
			
		||||
	model->update();
 | 
			
		||||
	model.reset(new DiveComputerModel);
 | 
			
		||||
	ui.tableView->setModel(model.data());
 | 
			
		||||
	ui.tableView->resizeColumnsToContents();
 | 
			
		||||
	ui.tableView->setColumnWidth(DiveComputerModel::REMOVE, 22);
 | 
			
		||||
| 
						 | 
				
			
			@ -57,7 +56,6 @@ void DiveComputerManagementDialog::accept()
 | 
			
		|||
 | 
			
		||||
void DiveComputerManagementDialog::reject()
 | 
			
		||||
{
 | 
			
		||||
	model->dropWorkingList();
 | 
			
		||||
	hide();
 | 
			
		||||
	close();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue