From ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kded/DESIGN | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 kded/DESIGN (limited to 'kded/DESIGN') diff --git a/kded/DESIGN b/kded/DESIGN new file mode 100644 index 000000000..702fca853 --- /dev/null +++ b/kded/DESIGN @@ -0,0 +1,78 @@ +kded +==== + +kded is responsible for creating the sycoca file, i.e. the binary +cache of servicetypes, mimetypes and services, for a particular user. + +It uses KDirWatch to monitor the directories contain the .desktop files. +When a file is added/removed, it waits 5 seconds (in case of series of +updates), and then launches kbuildsycoca. + +kbuildsycoca recreates the sycoca file by: +* parsing all .desktop files, replacing global ones by local ones (at any + level of the hierarchy) +* creating all objects in memory +* saving everything in the sycoca file (see below for ksycoca internals) +* clearing all memory +* notifying the applications that use ksycoca by a DCOP call to the ksycoca +object (KSycoca::notifyDatabaseChanged()). + +Format of the sycoca database file +================================== + +List of factories + | * Factory id, Factory offset + | * Factory id, Factory offset + | * ... + | * 0 + +Header + | * Offer-list offset + | * Mimetype-patterns index offset (fast patterns) + | * Mimetype-patterns index offset (other) + | * Entry size in the mimetype-patterns index ("fast" part) + +For each factory + | * offset of the dict + | KSycocaEntries + | | * entry type + | | Entry + | | | entry-dependent information + | | ... + | | + | Dict + | | * hashtable size + | | Hash list + | | | * list of values used to compute a hash key + | | Hash table + | | | * id (positive = entry offset) + | | | * id (negative = - offset in duplicates list ) + | | | * 0 if no entry for that hash value + | | Table of duplicates + | | | * entry offset, key + | | | * entry offset, key + | + +Offer list +| * servicetype offset, service offset +| * servicetype offset, service offset +| * servicetype offset, service offset +| * servicetype offset, service offset +| * 0 +This allows to quickly find services associated with a servicetype. +It does NOT reflect the user profile, which is stored in profilerc and +implemented in KServiceTypeProfile. + +Mimetype patterns +| Fast patterns (fixed size) +| * Extension (padded to 4 chars), mimetype offset +| * Extension (padded to 4 chars), mimetype offset +| * Extension (padded to 4 chars), mimetype offset +| Other patterns (variable size) +| * Pattern (ex : *.*gf), mimetype offset +| * Pattern (ex : Makefile*), mimetype offset +| * "" + +The first one is designed for a binary search, since entries have a fixed size +and are sorted by extension. +The second one (10% of the mimetypes usually) is for a linear search. -- cgit v1.2.3