This repository has been archived by the owner on Sep 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
DESIGN
33 lines (20 loc) · 1.41 KB
/
DESIGN
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
31
32
Resource:
=========
Uses SOAP to talk to the Sugar web service.
Loads the data into value classes provided by the lib kdcrmdata (SugarAccount, SugarOpportunity), and KABC::Addressee for contacts.
This is then serialized into XML, and stored it in Akonadi items.
Each collection has an attribute which stores
- the timestamp of the last sync, so that the resource can fetch only new/modified items each time
- the contents version of the items (this allows the resource to re-download everything when supporting more fields)
- the list of fields that it supports (for the client to use, see below)
Sugar Client:
=============
Fetches the right collection for each type of object.
Lists the collection (via the ETM).
For each Akonadi item, extracts the SugarAccount, SugarOpportunity etc. by deserializing the XML.
The GUI uses a generic QMap<QString, QString> to get/set data in these objects.
The key used in the XML and in the QMap is the same, and comes from KDCRMFields methods.
The "details" widgets contain named widgets, where the name of each widget also matches this KDCRMFields key name.
Upon saving, the details widget iterates over all child widgets, and for those that have a name in the list
of supported fields (from the resource), adds them to the map. This is because there are uninteresting
child widgets, like the QLineEdit inside a QSpinBox or a QComboBox, with an internal Qt name, we have to skip that.