Warning, /frameworks/kded/docs/DESIGN is written in an unsupported language. File is not indexed.

0001 kded
0002 ====
0003 
0004 kded is responsible for creating the sycoca file, i.e. the binary
0005 cache of servicetypes, mimetypes, and services for a particular user.
0006 
0007 It uses KDirWatch to monitor the directories containing .desktop files.
0008 When a file is added/removed, it waits 5 seconds (in case of series of
0009 updates), and then launches kbuildsycoca.
0010 
0011 kbuildsycoca recreates the sycoca file by:
0012 * parsing all .desktop files, replacing global ones by local ones (at any
0013   level of the hierarchy)
0014 * creating all objects in memory
0015 * saving everything in the sycoca file (see below for ksycoca internals)
0016 * clearing all memory
0017 * notifying the applications that use ksycoca by a DBUS signal emitted to
0018 the ksycoca object (KSycoca::notifyDatabaseChanged()).
0019 
0020 Format of the sycoca database file
0021 ==================================
0022 
0023 * Version
0024 
0025 List of factories
0026  | * Factory id, Factory offset
0027  | * Factory id, Factory offset
0028  | * ...
0029  | * 0
0030 
0031 * KDE prefixes
0032 * timestamp
0033 * KDE language
0034 * resource hash
0035 * list of all resource dirs
0036 
0037 For each factory
0038  | Header
0039  | * offset of the dict
0040  | * offset of the beginning of the entries
0041  | * offset of the end of the entries
0042  | Rest of the header (factory-specific), for instance:
0043  | * Offer-list offset
0044  | * Mimetype-patterns index offset (fast patterns)
0045  | * Mimetype-patterns index offset (other)
0046  | * Entry size in the mimetype-patterns index ("fast" part)
0047  |
0048  | KSycocaEntries
0049  | | * entry type
0050  | | Entry
0051  | | | entry-dependent information
0052  | | ...
0053  | |
0054  | Dict
0055  | | * hashtable size
0056  | | Hash list
0057  | | | * list of values used to compute a hash key
0058  | | Hash table
0059  | | | * id (positive = entry offset)
0060  | | | * id (negative = - offset in duplicates list )
0061  | | | * 0 if no entry for that hash value
0062  | | Table of duplicates
0063  | | |  * entry offset, key
0064  | | |  * entry offset, key
0065  | 
0066 
0067 Offer list
0068 | * servicetype offset, service offset
0069 | * servicetype offset, service offset
0070 | * servicetype offset, service offset
0071 | * servicetype offset, service offset
0072 | * mimetype offset, service offset
0073 | * mimetype offset, service offset
0074 | * mimetype offset, service offset
0075 | * mimetype offset, service offset
0076 | * 0
0077 This allows to quickly find services associated with a servicetype.
0078 It does NOT reflect the user profile, which is stored in profilerc and
0079 implemented in KServiceTypeProfile.
0080 
0081 Mimetype patterns
0082 | Fast patterns (fixed size)
0083 | * Extension (padded to 4 chars), mimetype offset
0084 | * Extension (padded to 4 chars), mimetype offset
0085 | * Extension (padded to 4 chars), mimetype offset
0086 | Other patterns (variable size)
0087 | * Pattern (ex : *.*gf), mimetype offset
0088 | * Pattern (ex : Makefile*), mimetype offset
0089 | * ""
0090 
0091 The first one is designed for a binary search, since entries have a fixed size
0092 and are sorted by extension.
0093 The second one (10% of the mimetypes usually) is for a linear search.