kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #26045
Undo buffer refactor
-
To:
KiCad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Maciej Sumiński <maciej.suminski@xxxxxxx>
-
Date:
Mon, 5 Sep 2016 16:06:50 +0200
-
Authentication-results:
spf=pass (sender IP is 188.184.36.48) smtp.mailfrom=cern.ch; lists.launchpad.net; dkim=none (message not signed) header.d=none;lists.launchpad.net; dmarc=bestguesspass action=none header.from=cern.ch;
-
Spamdiagnosticmetadata:
NSPM
-
Spamdiagnosticoutput:
1:99
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
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
Attachment:
signature.asc
Description: OpenPGP digital signature
Follow ups