mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Import: don't add to new trip while downloading
Since process_imported_dives() can add dives to a newly generated trip, this need not be done in the downloading code. This makes data flow distinctly simpler, as no trip table and no add-new-trip flag has to be passed down to the libdivecomputer glue code. Moreover, since now the trip creation is done at the import step rather than the download step, the latest status of the "add to new trip" checkbox will be considered. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
1cd0863cca
commit
ff9506b21b
12 changed files with 18 additions and 74 deletions
|
@ -127,12 +127,11 @@ void DiveImportedModel::clearTable()
|
|||
endRemoveRows();
|
||||
}
|
||||
|
||||
void DiveImportedModel::repopulate(dive_table_t *table, trip_table_t *trips)
|
||||
void DiveImportedModel::repopulate(dive_table_t *table)
|
||||
{
|
||||
beginResetModel();
|
||||
|
||||
diveTable = table;
|
||||
tripTable = trips;
|
||||
firstIndex = 0;
|
||||
lastIndex = diveTable->nr - 1;
|
||||
checkStates.resize(diveTable->nr);
|
||||
|
@ -159,7 +158,7 @@ void DiveImportedModel::recordDives()
|
|||
}
|
||||
|
||||
// TODO: Might want to let the user select "add_to_new_trip"
|
||||
add_imported_dives(diveTable, tripTable, true, true, false, false);
|
||||
add_imported_dives(diveTable, nullptr, true, true, false, false);
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> DiveImportedModel::roleNames() const {
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
Q_INVOKABLE void clearTable();
|
||||
QHash<int, QByteArray> roleNames() const;
|
||||
Q_INVOKABLE void repopulate(dive_table_t *table, trip_table_t *trips);
|
||||
Q_INVOKABLE void repopulate(dive_table_t *table);
|
||||
Q_INVOKABLE void recordDives();
|
||||
public
|
||||
slots:
|
||||
|
@ -34,7 +34,6 @@ private:
|
|||
int lastIndex;
|
||||
std::vector<char> checkStates; // char instead of bool to avoid silly pessimization of std::vector.
|
||||
struct dive_table *diveTable;
|
||||
struct trip_table *tripTable;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue