mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile: remove dive argument from DiveListModel::insertDive()
Since DiveListModel does not keep its own list of dives anymore, insertDive() doesn't use the DiveObjectHelper argument. Remove it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
feb11f6f5f
commit
a4f3580e10
3 changed files with 6 additions and 6 deletions
|
@ -1212,7 +1212,7 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q
|
|||
if (newIdx != oldIdx) {
|
||||
DiveListModel::instance()->removeDive(modelIdx);
|
||||
modelIdx += (newIdx - oldIdx);
|
||||
DiveListModel::instance()->insertDive(modelIdx, &myDive);
|
||||
DiveListModel::instance()->insertDive(modelIdx);
|
||||
diveChanged = true; // because we already modified things
|
||||
}
|
||||
}
|
||||
|
@ -1363,7 +1363,7 @@ bool QMLManager::undoDelete(int id)
|
|||
add_dive_to_trip(deletedDive, trip);
|
||||
}
|
||||
record_dive(deletedDive);
|
||||
DiveListModel::instance()->insertDive(get_idx_by_uniq_id(deletedDive->id), nullptr);
|
||||
DiveListModel::instance()->insertDive(get_idx_by_uniq_id(deletedDive->id));
|
||||
changesNeedSaving();
|
||||
deletedDive = NULL;
|
||||
deletedTrip = NULL;
|
||||
|
|
|
@ -136,7 +136,7 @@ DiveListModel::DiveListModel(QObject *parent) : QAbstractListModel(parent)
|
|||
m_instance = this;
|
||||
}
|
||||
|
||||
void DiveListModel::insertDive(int i, DiveObjectHelper *)
|
||||
void DiveListModel::insertDive(int i)
|
||||
{
|
||||
beginInsertRows(QModelIndex(), i, i);
|
||||
endInsertRows();
|
||||
|
@ -163,7 +163,7 @@ void DiveListModel::updateDive(int i, dive *d)
|
|||
// we need to make sure that QML knows that this dive has changed -
|
||||
// the only reliable way I've found is to remove and re-insert it
|
||||
removeDive(i);
|
||||
insertDive(i, nullptr); // TODO: DiveObjectHelper not needed anymore - remove second argument
|
||||
insertDive(i);
|
||||
}
|
||||
|
||||
void DiveListModel::reload()
|
||||
|
@ -254,7 +254,7 @@ QString DiveListModel::startAddDive()
|
|||
d->number = nr;
|
||||
d->dc.model = strdup("manually added dive");
|
||||
append_dive(d);
|
||||
insertDive(get_idx_by_uniq_id(d->id), new DiveObjectHelper(d));
|
||||
insertDive(get_idx_by_uniq_id(d->id));
|
||||
return QString::number(d->id);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
DiveListModel(QObject *parent = 0);
|
||||
void addDive(const QList<dive *> &listOfDives);
|
||||
void addAllDives();
|
||||
void insertDive(int i, DiveObjectHelper *newDive);
|
||||
void insertDive(int i);
|
||||
void removeDive(int i);
|
||||
void removeDiveById(int id);
|
||||
void updateDive(int i, dive *d);
|
||||
|
|
Loading…
Add table
Reference in a new issue