Marking several parking lots as Favorite at the same time is misbehaving
Opened this issue · 2 comments
Steps to reproduce:
- Mark the nth available parking lot as Favorite.
- While the remorse is running, mark the nth-1 available parking lot as Favorite.
Result: The nth parking lot is marked as Favorite and moved at the top of the SilicaListView, in the Favorites section. The remorse for the nth-1 one is moved to the nth-2 parking lot. At the end of the 2nd remorse, the nth-2 parking lot is marked as Favorite.
This doesn't happen when you:
- Mark the nth parking lot as Favorite.
- While the remorse is running, mark the nth+1 as Favorite.
But it also happens when:
- Unmark the nth Favorite.
- Unmark the nth+1 Favorite while the remorse is running.
Result: None of the 2 are unmarked !
Examples
- Mark Gutenberg as Favorite.
- While the remorse for Gutenberg is running, mark Gare Wodli as Favorite.
Result: Gutenberg is marked as Favorite, Gare Courte Duree is marked as Favorite. Gare Wodli isn't marked as Favorite.
- Mark Centre Opera Broglie, Gare Courte Duree and Gutenberg as Favorites.
- Unmark Gare Courte Duree.
- While the remorse for Gare Courte Duree is running, also unmark Gutenberg.
Result (after the 2 remorses are done): Gare Courte Duree and Gutenberg are still in the Favorites.
After discussing this with @SfietKonstantin, it seems that this might be due to remorse + QSortFilterProxyModel re-sorting causing some indexes mess.
I still don't know how to fix this :-/
Some more testing :
I tried to remove the index from the process, and use an identifier instead (i.e. call parkingModel.toggleSelected(identifier)
instead of parkingModel.toggleSelected(index)
).
Sadly it doesn't work either... (result is the same).
Sounds like the issue is definitely caused by the Remorse implementation.