Import: keep model state consistent when deleting unselected dives

In DiveImportedModel::deleteDeselected(), unselected dives were
deleted from the dive-table. But this left the model in an
inconsistent state and the frontend was not informed of the
missing dives.

Fix this by invoking the appropriate beginRemoveRows()/
endRemoveRows() pairs. Move the functionality into its
own function so that it can be reused by the desktop version.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-09-22 18:50:10 +02:00 committed by Dirk Hohndel
parent ad7ffa0af0
commit 30b384cebd
2 changed files with 20 additions and 9 deletions

View file

@ -21,6 +21,7 @@ public:
Qt::ItemFlags flags(const QModelIndex &index) const;
Q_INVOKABLE void clearTable();
QHash<int, QByteArray> roleNames() const;
void deleteDeselected();
Q_INVOKABLE void recordDives();
Q_INVOKABLE void startDownload();