Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----- Contents-<ARCH>.gz -----
- /bin/afio /main/afio/
- /usr/share/icons/exaile.png /universe/exaile/
- /usr/share/icons/hicolor/64x64x/exaile.png /universe/exaile/
- ----- Search Directories -----
- SEARCH_DIRS = {"usr/share/icons/hicolor/64x64",
- "usr/share/icons/hicolor/48x48",
- .............................
- "usr/share"}
- SIMPLIFIED PROCESS
- 1. IconFinder instantiation.
- 2. For each SEARCH_DIR, create a cache file containing only Contents.gz
- lines beginning with SEARCH_DIR.
- 3. Load maximum cache data possible into memory.
- 4. [Desktop data extraction begins]
- 5a. Desktop data extraction calls for icon "foo.png"
- 6a. IconFinder searches all cache files (or cache memory, if loaded) in
- order of SEARCH_DIRS. Returns first result.
- 5b. Desktop data extraction calls for icon "/abs/path/to/foo.png"
- 6b. IconFinder binary searches Contents.gz (or cache memory, if loaded)
- for that exact path. Returns any result.
- BENEFITS
- a) Complete. Any icon in /usr/share will be found, full stop.
- b) Fast. Manual deb searches (the current approach) require many
- random disk accesses. In this approach, most icons will be located
- through caches in RAM.
- DRAWBACKS
- a) Will require rewriting some unit tests
- b) More memory use for fast searches
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement