Frzk / StrasbourgParking

(SailfishOS) View the status of the parking lots in Strasbourg, France.
GNU General Public License v3.0
0 stars 0 forks source link

Marking several parking lots as Favorite at the same time is misbehaving #1

Open Frzk opened 9 years ago

Frzk commented 9 years ago

Steps to reproduce:

  1. Mark the nth available parking lot as Favorite.
  2. 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:

  1. Mark the nth parking lot as Favorite.
  2. While the remorse is running, mark the nth+1 as Favorite.

But it also happens when:

  1. Unmark the nth Favorite.
  2. Unmark the nth+1 Favorite while the remorse is running.

Result: None of the 2 are unmarked !

Examples

  1. Mark Gutenberg as Favorite.
  2. 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.

  1. Mark Centre Opera Broglie, Gare Courte Duree and Gutenberg as Favorites.
  2. Unmark Gare Courte Duree.
  3. 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.

Frzk commented 8 years ago

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 :-/

Frzk commented 8 years ago

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.