Warning, /office/calligra/sheets/doc/NOTES.damages is written in an unsupported language. File is not indexed.

0001 Author: nikolaus
0002 Date: 10.12.2009
0003 
0004 * Damage system                                                                 3       ----
0005   Currently, the damage system has the following drawbacks:
0006     - Damages are created on the heap.
0007     - Each damage handler gets a list of all damages, irrespective if document
0008       or view related. If an object wants only specific damages it has to
0009       traverse the whole list.
0010   The desired features were/are:
0011     - Collect damages while processing a command and flush them at once.
0012     - Do not block the UI for too long.
0013     - Prevent many public methods (in Map/Sheet), which only purpose is to emit
0014       a signal.
0015   Thoughts/Proposed solution:
0016     - Implement the following methods, that emit different signals depending on
0017         the damage:
0018         void Sheet::addDamage(CellDamage::Changes, const Region&);
0019         void Sheet::addDamage(SheetDamage::Changes);
0020         void Map::addDamage(WorkbookDamage::Changes);
0021       They still collect damages though.
0022     - The enums can be moved into Map/Sheet. Or a DamageHandler object can act
0023       as signal emitter, so no heavy recompilation after changes on the system.
0024     - Principally, provide one signal for each damage. Combine several damages
0025       to one signal only where appropriate.
0026     - Use Qt::QueuedConnections to prevent blocking the UI for too long. This
0027       would create events behind the scenes -> heap.
0028     - To prevent the View from processing damages of all sheets, even if they
0029       are not the active one, connect and disconnect signals/slots on changing
0030       the active sheet.