QML UI: clear the previous list when downloading

When you start a new session with Download from DC, clear out the table
from the last attempt before adding the page.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-06-16 01:22:44 -07:00
parent 27deb317b0
commit 77a3e6ac70
3 changed files with 3 additions and 1 deletions

View file

@ -16,6 +16,7 @@ Kirigami.Page {
title: qsTr("Dive Computer")
property bool selectAll : false
property alias dcImportModel: importModel
DCDownloadThread {
id: downloadThread

View file

@ -157,6 +157,7 @@ Kirigami.ApplicationWindow {
text: qsTr("Download from DC")
enabled: true
onTriggered: {
downloadFromDc.dcImportModel.clearTable()
stackView.push(downloadFromDc)
}
}

View file

@ -18,7 +18,7 @@ public:
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
void setImportedDivesIndexes(int first, int last);
Qt::ItemFlags flags(const QModelIndex &index) const;
void clearTable();
Q_INVOKABLE void clearTable();
QHash<int, QByteArray> roleNames() const;
Q_INVOKABLE void repopulate();
Q_INVOKABLE void recordDives();