File: Architecture.txt

package info (click to toggle)
kdevelop 4%3A24.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 71,888 kB
  • sloc: cpp: 290,869; python: 3,626; javascript: 3,518; sh: 1,316; ansic: 703; xml: 401; php: 95; lisp: 66; makefile: 31; sed: 12
file content (44 lines) | stat: -rw-r--r-- 2,006 bytes parent folder | download | duplicates (2)
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
33
34
35
36
37
38
39
40
41
42
43
44
The code length of subversion plugin seems to be very long, but it's just because
there are many kind of actions in subversion. If we separate and investigate
one action, the architecture is simple.

1. The GUI part

For each context menu item a slot is called and creates a SvnBlameJob. This
job is then started and will do the actual work on its own. Depending on the type
of action it fetches the results and displays them in a GUI

1a. Directly using the IBasicVersionControl Interface

this is no different that 1., except that there's no slot. The caller of the IBVC
interface is responsible for starting the job, connecting to its signals, delete
it and fetch any results to display or work with them.

2. The Jobs
Each job has an SvnInternalJob subclass that does carries out the actual action
in a separate thread. Both are connected in various ways, using queued connections,
to fetch additional information (like ssl certificate trust, login/password) and
to provide the result of the job.

The Job classes use VcsJob and thus KJob as parent so their progress can be monitored
with KJob Monitors in KDE.

3. InternalJob subclass

Executes the action requested usually by converting the parameters into
types that are understood by the svn C++ client API and then just executing
a call to svn::Client::XXX. Depending on the type of action a result is converted
back to Qt types and send via a signal to the parent job (which is the KJob subclass)

The threading is done via ThreadWeaver so queueing of jobs is done instead of
spawning a new Thread for each and every action.

4. Finishing

When the internaljob's run() method is exited ThreadWeaver emits an appropriate signal
which is connected to the Job subclass. This in turn changes its state and emits
the appropriate KJob signals by calling the KJob methods for that.

If the Job class received a result it will immediately emit a resultsReady signal and
as soon as the result is fetched via fetchResults will remove the fetched results.