← Back to team overview

kicad-developers team mailing list archive

Re: Undo buffer refactor

 

Orson,

I did some limited testing on this and it seems OK.  The only thing I'm
going to ask to wait until your going to be available in case things go
sideways before you commit it.

Thanks,

Wayne

On 9/5/2016 10:06 AM, Maciej Sumiński wrote:
> Recently I was refactoring the undo buffer code [1], as I have mentioned
> sometime ago. The main goal was to make the code simpler and more
> generic, remove some redundant parts.
> 
> Short changelog:
> 
> - BOARD_COMMIT class.
> Wrapper around undo buffer to simplify storing changes. Also performs
> all the necessary updates (ratsnest, view) once anything changes. A good
> entry point to introduce an observer interface.
> 
> - Removed BOARD_ITEM::Copy(), switched to C++ copy constructors and
> operator=.
> 
> - BOARD_ITEM_CONTAINER interface.
> A generic interface for adding & removing items, base class for MODULE
> and BOARD.
> 
> - Removed UR_MODEDIT.
> Module editor now uses the same UR_* flags as the layout editor. Now,
> together with BOARD_COMMIT is the way to unify undo handling code in
> tools (no more ugly 'if(m_editModules) {...} else {...}').
> 
> - Common code for handling undo buffer in the layout & module editor.
> board_undo_redo.cpp and modedit_undo_redo.cpp are merged to
> undo_redo.cpp. A lot of redundant code removed.
> 
> As you may have noticed, there are a lot of changes to the KiCad
> internals. It would be great if there were some brave folks to take the
> branch for a test ride. I have tested the code for some time, including
> a few sessions of valgrind and I had no problems.
> 
> If there are no objections I would like to commit the patches next week.
> 
> Regards,
> Orson
> 
> 1.
> https://code.launchpad.net/~orsonmmz/kicad/+git/kicad/+ref/undobuffer_refactor
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


References