4 kded is responsible for creating the sycoca file, i.e. the binary
5 cache of servicetypes, mimetypes, and services for a particular user.
7 It uses KDirWatch to monitor the directories containing .desktop files.
8 When a file is added/removed, it waits 5 seconds (in case of series of
9 updates), and then launches kbuildsycoca.
11 kbuildsycoca recreates the sycoca file by:
12 * parsing all .desktop files, replacing global ones by local ones (at any
13 level of the hierarchy)
14 * creating all objects in memory
15 * saving everything in the sycoca file (see below for ksycoca internals)
17 * notifying the applications that use ksycoca by a DBUS signal emitted to
18 the ksycoca object (KSycoca::notifyDatabaseChanged()).
20 Format of the sycoca database file
21 ==================================
26 | * Factory id, Factory offset
27 | * Factory id, Factory offset
35 * list of all resource dirs
39 | * offset of the dict
40 | * offset of the beginning of the entries
41 | * offset of the end of the entries
42 | Rest of the header (factory-specific), for instance:
44 | * Mimetype-patterns index offset (fast patterns)
45 | * Mimetype-patterns index offset (other)
46 | * Entry size in the mimetype-patterns index ("fast" part)
51 | | | entry-dependent information
57 | | | * list of values used to compute a hash key
59 | | | * id (positive = entry offset)
60 | | | * id (negative = - offset in duplicates list )
61 | | | * 0 if no entry for that hash value
62 | | Table of duplicates
63 | | | * entry offset, key
64 | | | * entry offset, key
68 | * servicetype offset, service offset
69 | * servicetype offset, service offset
70 | * servicetype offset, service offset
71 | * servicetype offset, service offset
72 | * mimetype offset, service offset
73 | * mimetype offset, service offset
74 | * mimetype offset, service offset
75 | * mimetype offset, service offset
77 This allows to quickly find services associated with a servicetype.
78 It does NOT reflect the user profile, which is stored in profilerc and
79 implemented in KServiceTypeProfile.
82 | Fast patterns (fixed size)
83 | * Extension (padded to 4 chars), mimetype offset
84 | * Extension (padded to 4 chars), mimetype offset
85 | * Extension (padded to 4 chars), mimetype offset
86 | Other patterns (variable size)
87 | * Pattern (ex : *.*gf), mimetype offset
88 | * Pattern (ex : Makefile*), mimetype offset
91 The first one is designed for a binary search, since entries have a fixed size
92 and are sorted by extension.
93 The second one (10% of the mimetypes usually) is for a linear search.