File: NOTES.damages

package info (click to toggle)
calligra 1%3A2.4.4-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 290,028 kB
  • sloc: cpp: 1,105,019; xml: 24,940; ansic: 11,807; python: 8,457; perl: 2,792; sh: 1,507; yacc: 1,307; ruby: 1,248; sql: 903; lex: 455; makefile: 89
file content (30 lines) | stat: -rw-r--r-- 1,592 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Author: nikolaus
Date: 10.12.2009

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