Select the first dive

This works regardless whether the first dive is in a trip or not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-05-03 12:50:11 -07:00
parent 0a19a964e0
commit ce5fc7d0ec

View file

@ -325,6 +325,12 @@ void MainWindow::readSettings()
ui->ListWidget->resizeColumnToContents(i);
}
ui->ListWidget->collapseAll();
ui->ListWidget->expand(sortModel->index(0,0));
QModelIndex firstDiveOrTrip = sortModel->index(0,0);
if (sortModel->index(0,0, firstDiveOrTrip).isValid())
ui->ListWidget->setCurrentIndex(sortModel->index(0,0, firstDiveOrTrip));
else
ui->ListWidget->setCurrentIndex(firstDiveOrTrip);
settings.endGroup();
}