mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 18:13:24 +00:00
Dive site: remove implicit deletion of empty dive sites
There was a way of deleting dive sites by clearing all fields. This is not necessary anymore, as now the user can delete a dive site in the dive site list. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f022a4a4d0
commit
0fd85832b7
3 changed files with 0 additions and 19 deletions
|
@ -212,11 +212,6 @@ void LocationInformationWidget::acceptChanges()
|
|||
|
||||
if (!ui.diveSiteCoordinates->text().isEmpty())
|
||||
parseGpsText(ui.diveSiteCoordinates->text(), diveSite->location);
|
||||
if (dive_site_is_empty(diveSite)) {
|
||||
LocationInformationModel::instance()->removeRow(get_divesite_idx(diveSite, &dive_site_table));
|
||||
displayed_dive.dive_site = nullptr;
|
||||
diveSite = nullptr;
|
||||
}
|
||||
mark_divelist_changed(true);
|
||||
resetState();
|
||||
}
|
||||
|
|
|
@ -136,19 +136,6 @@ void LocationInformationModel::update()
|
|||
endResetModel();
|
||||
}
|
||||
|
||||
bool LocationInformationModel::removeRows(int row, int, const QModelIndex&)
|
||||
{
|
||||
if(row >= rowCount())
|
||||
return false;
|
||||
|
||||
beginRemoveRows(QModelIndex(), row, row);
|
||||
struct dive_site *ds = get_dive_site(row, &dive_site_table);
|
||||
if (ds)
|
||||
delete_dive_site(ds, &dive_site_table);
|
||||
endRemoveRows();
|
||||
return true;
|
||||
}
|
||||
|
||||
void LocationInformationModel::diveSiteDiveCountChanged(dive_site *ds)
|
||||
{
|
||||
int idx = get_divesite_idx(ds, &dive_site_table);
|
||||
|
|
|
@ -26,7 +26,6 @@ public:
|
|||
int columnCount(const QModelIndex &parent) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const;
|
||||
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue