Details
Description
The model does not emit modelChanged() signal when the underlying organizer store returns an empty item list.
Example:
1. initial fetch, model contains > 0 items>
(modelChanged() emitted as expected)
2. change any property that triggers fetchAgain() such that the underlying organizer store returns an empty list>
(modelChanged() NOT emitted)
Reason:
In QDeclarativeOrganizerModel::requestUpdated, the modelChanged signal is only emitted if (!items.isEmpty()). I believe the signal should be moved out of the if statement.
The modelChanged() signal is in fact redundant, because QAbstractListModel should emit signals properly whenever items are inserted, updated or removed. This requires proper use of QAbstractListModel::begin<operation> and QAbstractListMode::end<operation>. For maximum performance, I recommend using beginResetModel() and endResetModel() whenever the whole model is changed (e.g. in fetchAgain() when d->m_updatedItemIds.isEmpty()).