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 "divelistview.h" | ||||||
| #include "models.h" | #include "models.h" | ||||||
| #include "modeldelegates.h" | #include "modeldelegates.h" | ||||||
|  | #include "../display.h" | ||||||
| #include <QApplication> | #include <QApplication> | ||||||
| #include <QHeaderView> | #include <QHeaderView> | ||||||
| #include <QDebug> | #include <QDebug> | ||||||
|  | @ -136,12 +137,16 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort) | ||||||
| 		return; | 		return; | ||||||
| 
 | 
 | ||||||
| 	sortByColumn(0, Qt::DescendingOrder); | 	sortByColumn(0, Qt::DescendingOrder); | ||||||
| 	QModelIndex firstDiveOrTrip = m->index(0,0); | 	if (amount_selected && selected_dive >= 0) { | ||||||
| 	if (firstDiveOrTrip.isValid()) { | 		// magic happens and the selected dive is expanded and scrolled to
 | ||||||
| 		if (m->index(0,0, firstDiveOrTrip).isValid()) | 	} else { | ||||||
| 			setCurrentIndex(m->index(0,0, firstDiveOrTrip)); | 		QModelIndex firstDiveOrTrip = m->index(0,0); | ||||||
| 		else | 		if (firstDiveOrTrip.isValid()) { | ||||||
| 			setCurrentIndex(firstDiveOrTrip); | 			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