mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Fix for double-rendering, double selection and other annoyances.
This patch fixes a thing that I run into when trying to implement the multi-edition system. Whenever a dive was selected, via mouse or keyboard, it had two stages: first, it would select the previous and the current ( and thus, render the profile of the current) and then whould release the previous and select the current again ( and thus, rerendering the profile again, plus a few other things. ) With the multi-edition system this caused a more severe bug, since the edition of the dives is directly applied as soon as the text fields changes, as soon as we selected any dive on the list, the 'before' dive would be modified by the 'current'. This patch fixes this - but since it's just a 'code removal' patch, this can led to bad things in the future, I tested it quite a bit, but didn't found anything, no regression. *fingers crossed.* Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
		
							parent
							
								
									2fb2918607
								
							
						
					
					
						commit
						cbbc7d99ea
					
				
					 1 changed files with 0 additions and 9 deletions
				
			
		|  | @ -226,16 +226,7 @@ void DiveListView::currentChanged(const QModelIndex& current, const QModelIndex& | |||
| { | ||||
| 	if (!current.isValid()) | ||||
| 		return; | ||||
| 	const QAbstractItemModel *model = current.model(); | ||||
| 	int selectedDive = 0; | ||||
| 	struct dive *dive = (struct dive*) model->data(current, DiveTripModel::DIVE_ROLE).value<void*>(); | ||||
| 	if (!dive)  // it's a trip! select first child.
 | ||||
| 		dive = (struct dive*) model->data(current.child(0,0), DiveTripModel::DIVE_ROLE).value<void*>(); | ||||
| 	selectedDive = get_divenr(dive); | ||||
| 	scrollTo(current); | ||||
| 	if (selectedDive == selected_dive) | ||||
| 		return; | ||||
| 	Q_EMIT currentDiveChanged(selectedDive); | ||||
| } | ||||
| 
 | ||||
| void DiveListView::selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue