TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DESIGN 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. kded
  2. ====
  3. kded is responsible for creating the sycoca file, i.e. the binary
  4. cache of servicetypes, mimetypes and services, for a particular user.
  5. It uses KDirWatch to monitor the directories contain the .desktop files.
  6. When a file is added/removed, it waits 5 seconds (in case of series of
  7. updates), and then launches tdebuildsycoca.
  8. tdebuildsycoca recreates the sycoca file by:
  9. * parsing all .desktop files, replacing global ones by local ones (at any
  10. level of the hierarchy)
  11. * creating all objects in memory
  12. * saving everything in the sycoca file (see below for tdesycoca internals)
  13. * clearing all memory
  14. * notifying the applications that use tdesycoca by a DCOP call to the tdesycoca
  15. object (KSycoca::notifyDatabaseChanged()).
  16. Format of the sycoca database file
  17. ==================================
  18. List of factories
  19. | * Factory id, Factory offset
  20. | * Factory id, Factory offset
  21. | * ...
  22. | * 0
  23. Header
  24. | * Offer-list offset
  25. | * Mimetype-patterns index offset (fast patterns)
  26. | * Mimetype-patterns index offset (other)
  27. | * Entry size in the mimetype-patterns index ("fast" part)
  28. For each factory
  29. | * offset of the dict
  30. | KSycocaEntries
  31. | | * entry type
  32. | | Entry
  33. | | | entry-dependent information
  34. | | ...
  35. | |
  36. | Dict
  37. | | * hashtable size
  38. | | Hash list
  39. | | | * list of values used to compute a hash key
  40. | | Hash table
  41. | | | * id (positive = entry offset)
  42. | | | * id (negative = - offset in duplicates list )
  43. | | | * 0 if no entry for that hash value
  44. | | Table of duplicates
  45. | | | * entry offset, key
  46. | | | * entry offset, key
  47. |
  48. Offer list
  49. | * servicetype offset, service offset
  50. | * servicetype offset, service offset
  51. | * servicetype offset, service offset
  52. | * servicetype offset, service offset
  53. | * 0
  54. This allows to quickly find services associated with a servicetype.
  55. It does NOT reflect the user profile, which is stored in profilerc and
  56. implemented in KServiceTypeProfile.
  57. Mimetype patterns
  58. | Fast patterns (fixed size)
  59. | * Extension (padded to 4 chars), mimetype offset
  60. | * Extension (padded to 4 chars), mimetype offset
  61. | * Extension (padded to 4 chars), mimetype offset
  62. | Other patterns (variable size)
  63. | * Pattern (ex : *.*gf), mimetype offset
  64. | * Pattern (ex : Makefile*), mimetype offset
  65. | * ""
  66. The first one is designed for a binary search, since entries have a fixed size
  67. and are sorted by extension.
  68. The second one (10% of the mimetypes usually) is for a linear search.