After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 103562 - The Final Solution for Undo/Redo Bugs
The Final Solution for Undo/Redo Bugs
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: general
2.1.x
Other Linux
: Normal normal
: ---
Assigned To: Rosanna Yuen
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2003-01-15 10:51 UTC by Callum McKenzie
Modified: 2012-01-31 23:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A revamped undo/redo system for aisleriot (12.35 KB, patch)
2003-01-15 10:53 UTC, Callum McKenzie
none Details | Review

Description Callum McKenzie 2003-01-15 10:51:49 UTC
I have created a patch to fix all the recurring undo/redo bugs in the
various solitaire games. The problem is that the main sol.scm code provides
no standard way for individual game modules to save the state of the game
for when the user hits the undo button. For example: seahaven needs to keep
track of how many free reserves are present at any one time. As noted in
bug #65242: if an undo action changed the number of cards on the reserve
then the program gets very confused. The traditional fix (and the original
one for #65242) is to redefine the undo and redo routines, which duplicates
code with only minor modifications.

In the new code the individual games are no longer responsible for saving
any state variables. Instead they are registered using a modified "define"
routine (called "def-save-var") and the main sol.scm code takes care of
saving and restoring them. 

This supercedes the fixes applied for bugs #65242 and #91101, it provides a
probable fix for #83517 and fixes two similar bugs not previously detected
in glenwood and eight_off (both of these are hard to trigger. I have not
seen them misbehave, although the code clearly has the potential).

I have given this the GNOMEVER2.3 keyword because the code is largely
untested and while it is a bug-fix is probably not appropriate for 2.2 even
though it fixes known bugs. Although it should in fact apply to almost any
aisleriot version.

I have tested it briefly to verify that all the games are still playable
and in the case of some (seahaven, bakers_game and plait) I have verified
that undo and redo work properly. In the other cases I have merely verified
that nothing unexpected occured.
Comment 1 Callum McKenzie 2003-01-15 10:53:17 UTC
Created attachment 13575 [details] [review]
A revamped undo/redo system for aisleriot
Comment 2 Callum McKenzie 2003-01-15 10:59:54 UTC
One additional comment: I have systematically gone through all the all
the aisleriot games looking for probable bugs of this nature. Unless
someone has used an unusual idiom in their code I should have found
all the problem areas. The only other possible remaining problem of
this type are the cases where I decided that the variable was "local"
to a small cluster of routines and wouldn't need saving. I may not
have got these cases correct.

Of course these sorts of claims are just asking for me to be proven wrong.

Comment 3 Ross Burton 2003-01-15 11:17:09 UTC
Dude, you rock. Thanks!
Comment 4 Ross Burton 2003-03-25 12:30:51 UTC
Right, committed to HEAD. Lets see how well it works!
Comment 5 Robert Ancell 2012-01-31 23:22:27 UTC
This bug is being reassigned to the "general" component so we can close the aisleriot bugzilla component.  Apologies for the mass email!