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,6 +137,9 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sortByColumn(0, Qt::DescendingOrder);
|
sortByColumn(0, Qt::DescendingOrder);
|
||||||
|
if (amount_selected && selected_dive >= 0) {
|
||||||
|
// magic happens and the selected dive is expanded and scrolled to
|
||||||
|
} else {
|
||||||
QModelIndex firstDiveOrTrip = m->index(0,0);
|
QModelIndex firstDiveOrTrip = m->index(0,0);
|
||||||
if (firstDiveOrTrip.isValid()) {
|
if (firstDiveOrTrip.isValid()) {
|
||||||
if (m->index(0,0, firstDiveOrTrip).isValid())
|
if (m->index(0,0, firstDiveOrTrip).isValid())
|
||||||
|
@ -143,6 +147,7 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
|
||||||
else
|
else
|
||||||
setCurrentIndex(firstDiveOrTrip);
|
setCurrentIndex(firstDiveOrTrip);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveListView::reloadHeaderActions()
|
void DiveListView::reloadHeaderActions()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue