Game information update fails with multiple items

Bug #1733212 reported by Jukka Pakarinen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

When first three items are selected from the list of replay view by pressing ctrl+cliks and then unselected two last ones, game information view doesn't show what it should. There is some other clinking combinations when this oddness turning up.

The delete buttons seems to delete the items selected from the list even when game information shows something else.

Related branches

Revision history for this message
Jukka Pakarinen (flegu) wrote :
Revision history for this message
Jukka Pakarinen (flegu) wrote :
Revision history for this message
Jukka Pakarinen (flegu) wrote :

The problem is found from trunk (revno 8486) on Debian 9.1.

Revision history for this message
GunChleoc (gunchleoc) wrote :

We are missing an update of GameData somewhere. That's either a bug in the loading screen, or the Table object isn't sending a selected signal.

tags: added: ui
tags: added: lowhangingfruit
Changed in widelands:
milestone: none → build20-rc1
status: New → Triaged
importance: Undecided → High
Revision history for this message
Jukka Pakarinen (flegu) wrote :

I think the following change fixes the bug but I'm not sure is this the right way to fix it.

=== modified file 'src/ui_basic/table.cc'
--- src/ui_basic/table.cc 2017-11-06 20:19:56 +0000
+++ src/ui_basic/table.cc 2017-12-13 18:22:48 +0000
@@ -426,7 +426,7 @@
  * Args: i the entry to select
  */
 void Table<void*>::select(const uint32_t i) {
- if (empty() || selection_ == i || i == no_selection_index())
+ if (empty() || i == no_selection_index())
                return;

        selection_ = i;

So, what happens if at least 3 items are selected (e.g index values 2 3 4 5) and two of them are unselected, but not the first one (2).

Unselect index 5: input value of i=2 is set to selection_ and selected(selection_) is called.
Unselect index 4: input value of i=2 is not set to selection_ and selected(selection_) is not called because selection_ == i.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I can't review this without having a branch, the code is too complex for that.

Revision history for this message
Jukka Pakarinen (flegu) wrote :

I tried to link the branch to this bug yesterday and also few moments ago but the interface said "Timeout error, please try again in a few minutes".

So this is the branch
https://code.launchpad.net/~widelands-dev/widelands/bug-1733212-game-information-update-fails

Revision history for this message
GunChleoc (gunchleoc) wrote :

Yes, Launchpad sometimes does that. Thanks for the branch :)

Revision history for this message
GunChleoc (gunchleoc) wrote :

Reviewed now and merged.

BTW you can open up merge requests any time, even if you're unsure if the code is correct - it's an easy way to discuss the code. And you've been providing good code anyway :)

Changed in widelands:
status: Triaged → Fix Committed
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.