mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Import: get tables from DiveImportedModel not DownloadThread
When importing dives, consume the tables from DiveImportedModel and not the DownloadThread. This appears more logical and avoids an inconsistent state of the DiveImportedModel: On import the tables would be reset, but the DiveImportedModel wasn't informed of that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
10d4ba82a2
commit
8f3c85f58d
3 changed files with 31 additions and 4 deletions
|
@ -155,6 +155,26 @@ void DiveImportedModel::repopulate(dive_table_t *table, struct dive_site_table *
|
|||
endResetModel();
|
||||
}
|
||||
|
||||
std::pair<struct dive_table, struct dive_site_table> DiveImportedModel::consumeTables()
|
||||
{
|
||||
beginResetModel();
|
||||
|
||||
// Move tables to result
|
||||
struct dive_table dives;
|
||||
struct dive_site_table sites;
|
||||
move_dive_table(diveTable, &dives);
|
||||
move_dive_site_table(sitesTable, &sites);
|
||||
|
||||
// Reset indexes
|
||||
firstIndex = 0;
|
||||
lastIndex = -1;
|
||||
checkStates.clear();
|
||||
|
||||
endResetModel();
|
||||
|
||||
return std::make_pair(dives, sites);
|
||||
}
|
||||
|
||||
// Delete non-selected dives
|
||||
void DiveImportedModel::deleteDeselected()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue