diff options
author | Botond István Horváth <[email protected]> | 2024-08-15 13:07:19 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <[email protected]> | 2024-12-05 14:42:56 +0100 |
commit | 95c55d6f3216bfeb6d802fb70e455849b8c3567f (patch) | |
tree | 4bb0caa80e1dfd722d4d1f81ab6f0e13b7a82751 | |
parent | cabdea9665772f9f4148f4ce60fb128db2737c6e (diff) |
QSqlTableModel: remove a call to `cache.empty()`
The call to the const `empty()` didn't do anything, because its results
were unused. Since this code has not been touched for some ~13 years,
just drop the call. (Probably clear() was intended, however doing that
change makes the corresponding autotest fail.)
Aggressively cherry-picking because I want to also cherry pick
[[nodiscard]] on empty() (which would've found this bug N years ago.)
Change-Id: I801d0c364a7122bb26d407c23ae99278939c50ff
Pick-to: 6.8 6.5
Reviewed-by: Christian Ehrlicher <[email protected]>
Reviewed-by: David Faure <[email protected]>
-rw-r--r-- | src/sql/models/qsqltablemodel.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 0d171942877..5a6c239ee6a 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -1108,9 +1108,6 @@ bool QSqlTableModel::insertRows(int row, int count, const QModelIndex &parent) d->busyInsertingRows = true; beginInsertRows(parent, row, row + count - 1); - if (d->strategy != OnManualSubmit) - d->cache.empty(); - if (!d->cache.isEmpty()) { QMap<int, QSqlTableModelPrivate::ModifiedRow>::Iterator it = d->cache.end(); while (it != d->cache.begin() && (--it).key() >= row) { |