mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
e99c4c9059
The LocationInformationModel used to sort its entries and was completely rebuilt after every change. This makes it rather complex to support incremental changes. Instead, keep LocationInformationModel sorted by UUID so that indexes are consistent with indices in the core dive site table. Implement sorting by other columns than name and enable sorting in the dive site view. Finally, don't cache the list of dive site names for the mobile app, since that would also need some rather convoluted methods of keeping the list up to date. Calculate it on the fly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
27 lines
722 B
C++
27 lines
722 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#include "TabDiveSite.h"
|
|
#include "qt-models/divelocationmodel.h"
|
|
|
|
#include <qt-models/divecomputerextradatamodel.h>
|
|
|
|
TabDiveSite::TabDiveSite(QWidget *parent) : TabBase(parent)
|
|
{
|
|
ui.setupUi(this);
|
|
ui.diveSites->setTitle(tr("Dive sites"));
|
|
ui.diveSites->setModel(&model);
|
|
// Default: sort by name
|
|
ui.diveSites->view()->sortByColumn(LocationInformationModel::NAME, Qt::AscendingOrder);
|
|
ui.diveSites->view()->setSortingEnabled(true);
|
|
|
|
// Show only the first few columns
|
|
for (int i = LocationInformationModel::COORDS; i < LocationInformationModel::COLUMNS; ++i)
|
|
ui.diveSites->view()->setColumnHidden(i, true);
|
|
}
|
|
|
|
void TabDiveSite::updateData()
|
|
{
|
|
}
|
|
|
|
void TabDiveSite::clear()
|
|
{
|
|
}
|