mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Cleanup: remove DiveListView::fixMessyQtModelBehaviour()
The function DiveListView::fixMessyQtModelBehaviour() was used to expand the first columns of dive-trips in the dive-list view. This function was called everytime that the dive-list was modified. It is kind of ludicrous that external callers would have to tell the DiveListView, when it has to update its column headers. Instead, place this functionality in the overriden reset() and rowsInserted() functions, as these are the only ways that rows can be added. Change the DiveTripModel to use the proper beginResetModel()/endResetModel() pair instead of the previous full deletion and full repopulation using the beginRemoveRows()/ endRemoveRows() and beginInsertRows()/endInsertRows(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									5e1e6110ce
								
							
						
					
					
						commit
						4bdd811f06
					
				
					 5 changed files with 28 additions and 23 deletions
				
			
		|  | @ -174,7 +174,6 @@ void RenumberDialog::buttonClicked(QAbstractButton *button) | |||
| 		UndoRenumberDives *undoCommand = new UndoRenumberDives(renumberedDives); | ||||
| 		MainWindow::instance()->undoStack->push(undoCommand); | ||||
| 
 | ||||
| 		MainWindow::instance()->dive_list()->fixMessyQtModelBehaviour(); | ||||
| 		mark_divelist_changed(true); | ||||
| 		MainWindow::instance()->dive_list()->restoreSelection(); | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue