mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
OP-1122 OP-1123 fixed assertion errors when loading waypoint file in wp editor
This commit is contained in:
parent
aff543561b
commit
87725ded48
@ -469,7 +469,7 @@ bool flightDataModel::insertRows(int row, int count, const QModelIndex & /*paren
|
||||
|
||||
bool flightDataModel::removeRows(int row, int count, const QModelIndex & /*parent*/)
|
||||
{
|
||||
if (row < 0) {
|
||||
if (row < 0 || count <= 0) {
|
||||
return false;
|
||||
}
|
||||
beginRemoveRows(QModelIndex(), row, row + count - 1);
|
||||
|
@ -345,7 +345,10 @@ void modelMapProxy::createWayPoint(internals::PointLatLng coord)
|
||||
index = model->index(model->rowCount() - 1, flightDataModel::ERRORDESTINATION, QModelIndex());
|
||||
model->setData(index, 1, Qt::EditRole);
|
||||
}
|
||||
|
||||
void modelMapProxy::deleteAll()
|
||||
{
|
||||
model->removeRows(0, model->rowCount(), QModelIndex());
|
||||
if (model->rowCount() > 0) {
|
||||
model->removeRows(0, model->rowCount(), QModelIndex());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user