mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Stop showing the first dive after a preferences change
What is missing is the code to actually show the RIGHT dive... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									ed0f558efb
								
							
						
					
					
						commit
						87decaa798
					
				
					 1 changed files with 11 additions and 6 deletions
				
			
		|  | @ -7,6 +7,7 @@ | |||
| #include "divelistview.h" | ||||
| #include "models.h" | ||||
| #include "modeldelegates.h" | ||||
| #include "../display.h" | ||||
| #include <QApplication> | ||||
| #include <QHeaderView> | ||||
| #include <QDebug> | ||||
|  | @ -136,12 +137,16 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort) | |||
| 		return; | ||||
| 
 | ||||
| 	sortByColumn(0, Qt::DescendingOrder); | ||||
| 	QModelIndex firstDiveOrTrip = m->index(0,0); | ||||
| 	if (firstDiveOrTrip.isValid()) { | ||||
| 		if (m->index(0,0, firstDiveOrTrip).isValid()) | ||||
| 			setCurrentIndex(m->index(0,0, firstDiveOrTrip)); | ||||
| 		else | ||||
| 			setCurrentIndex(firstDiveOrTrip); | ||||
| 	if (amount_selected && selected_dive >= 0) { | ||||
| 		// magic happens and the selected dive is expanded and scrolled to
 | ||||
| 	} else { | ||||
| 		QModelIndex firstDiveOrTrip = m->index(0,0); | ||||
| 		if (firstDiveOrTrip.isValid()) { | ||||
| 			if (m->index(0,0, firstDiveOrTrip).isValid()) | ||||
| 				setCurrentIndex(m->index(0,0, firstDiveOrTrip)); | ||||
| 			else | ||||
| 				setCurrentIndex(firstDiveOrTrip); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue