and log formats simultaneously.
+* removeRows() no longer emits extra beforeDelete signal for out of range row.
+
****************************************************************************
* Database Drivers *
****************************************************************************
if (parent.isValid() || row < 0 || count <= 0)
return false;
- int initialRowCount = rowCount();
-
int i;
for (i = 0; i < count && row + i < rowCount(); ++i) {
int idx = row + i;
if (d->strategy != OnManualSubmit && i > 0)
submit();
- // historical bug: emit beforeDelete for 1st row beyond end
- if (d->strategy != OnManualSubmit) {
- if (row + count > initialRowCount)
- emit beforeDelete(qMax(initialRowCount, row));
- }
-
if (i < count)
return false;
QVERIFY(!model.removeRows(1, 0, model.index(2, 0))); // can't pass a valid modelindex
QVERIFY_SQL(model, removeRows(0, 2));
- QCOMPARE(beforeDeleteSpy.count(), 3);
- QVERIFY(beforeDeleteSpy.at(0).at(0).toInt() == 5);
- QVERIFY(beforeDeleteSpy.at(1).at(0).toInt() == 0);
- QVERIFY(beforeDeleteSpy.at(2).at(0).toInt() == 1);
+ QCOMPARE(beforeDeleteSpy.count(), 2);
+ QVERIFY(beforeDeleteSpy.at(0).at(0).toInt() == 0);
+ QVERIFY(beforeDeleteSpy.at(1).at(0).toInt() == 1);
QCOMPARE(model.rowCount(), 1);
QCOMPARE(model.data(model.index(0, 1)).toString(), QString("vohi"));
model.clear();