summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBotond István Horváth <[email protected]>2024-08-15 13:07:19 +0200
committerQt Cherry-pick Bot <[email protected]>2024-12-05 19:26:43 +0000
commit3210c4c69180e214870999b0f24a55359860e734 (patch)
treec1f42550ffb0eb99b905a2b0ce37a8cee40b24a5
parent9399ffd301a3677721146d7741c79b5e24ce1ca9 (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.5 Reviewed-by: Christian Ehrlicher <[email protected]> Reviewed-by: David Faure <[email protected]> (cherry picked from commit 95c55d6f3216bfeb6d802fb70e455849b8c3567f) Reviewed-by: Qt Cherry-pick Bot <[email protected]>
-rw-r--r--src/sql/models/qsqltablemodel.cpp3
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) {