Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. ----- Contents-<ARCH>.gz -----
  2. /bin/afio /main/afio/
  3. /usr/share/icons/exaile.png /universe/exaile/
  4. /usr/share/icons/hicolor/64x64x/exaile.png /universe/exaile/
  5.  
  6. ----- Search Directories -----
  7. SEARCH_DIRS = {"usr/share/icons/hicolor/64x64",
  8. "usr/share/icons/hicolor/48x48",
  9. .............................
  10. "usr/share"}
  11.  
  12.  
  13. SIMPLIFIED PROCESS
  14.  
  15. 1. IconFinder instantiation.
  16. 2. For each SEARCH_DIR, create a cache file containing only Contents.gz
  17. lines beginning with SEARCH_DIR.
  18. 3. Load maximum cache data possible into memory.
  19. 4. [Desktop data extraction begins]
  20. 5a. Desktop data extraction calls for icon "foo.png"
  21. 6a. IconFinder searches all cache files (or cache memory, if loaded) in
  22. order of SEARCH_DIRS. Returns first result.
  23. 5b. Desktop data extraction calls for icon "/abs/path/to/foo.png"
  24. 6b. IconFinder binary searches Contents.gz (or cache memory, if loaded)
  25. for that exact path. Returns any result.
  26.  
  27. BENEFITS
  28.  
  29. a) Complete. Any icon in /usr/share will be found, full stop.
  30. b) Fast. Manual deb searches (the current approach) require many
  31. random disk accesses. In this approach, most icons will be located
  32. through caches in RAM.
  33.  
  34. DRAWBACKS
  35.  
  36. a) Will require rewriting some unit tests
  37. b) More memory use for fast searches
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement