Use submit() instead of calling updatRowInTable(). The effect is
exactly the same. Submit() invokes submitAll() which invokes
updateRowInTable(). The cache is purged and select() is called only
on success.
Change-Id: I3de9a3d6acf802ee6594d034a9e261e53637995d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
row.setValue(index.column(), value);
emit dataChanged(index, index);
- bool isOk = true;
- if (d->strategy == OnFieldChange && row.op() != QSqlTableModelPrivate::Insert) {
- // historical bug: bad style to call updateRowInTable.
- // Should call submit(), but maybe the author wanted to avoid
- // clearing the cache on failure.
- isOk = updateRowInTable(index.row(), row.rec());
- if (isOk)
- select();
- }
+ if (d->strategy == OnFieldChange && row.op() != QSqlTableModelPrivate::Insert)
+ return submit();
- return isOk;
+ return true;
}
/*!