AnnotationModel: don't emit layoutChanged from inside reset

rebuildTree's only caller is notifySetup() which does a reset,
don't emit layoutChanged() between beginResetModel and endResetModel.

Caught by QAbstractItemModelTester (after instanciating one
in the AnnotationModel constructor to debug something else)
This commit is contained in:
David Faure 2024-05-05 13:32:25 +02:00
parent 8733e544e3
commit 2592879c4a

View file

@ -256,7 +256,6 @@ void AnnotationModelPrivate::rebuildTree(const QVector<Okular::Page *> &pages)
return;
}
Q_EMIT q->layoutAboutToBeChanged();
for (int i = 0; i < pages.count(); ++i) {
const QList<Okular::Annotation *> annots = filterOutWidgetAnnotations(pages.at(i)->annotations());
if (annots.isEmpty()) {
@ -268,7 +267,6 @@ void AnnotationModelPrivate::rebuildTree(const QVector<Okular::Page *> &pages)
new AnnItem(annItem, annot);
}
}
Q_EMIT q->layoutChanged();
}
AnnItem *AnnotationModelPrivate::findItem(int page, int *index) const