Allow FavoriteCollectionsModel to be reset when Akonadi server has stopped
Review Request #119746 - Created Aug. 12, 2014 and submitted
When the Akonadi server stops, calling FavoriteCollectionsModel::setCollections(Collection::List()) removes all collections from the model's collection list, but no collections are removed from the list of referenced collections. This is because the private dereference() function only removes them if their model index is valid. But because the server has stopped, they cannot have valid indexes.
The patch makes dereference() remove the collection from the list of referenced collections regardless of whether the collection's model index is valid. This allows FavoriteCollectionsModel to be reset completely when the server has stopped.
Tested with KAlarm. This now allows alarms to be redisplayed after an Akonadi server restart.