art with code

2008-12-04

Week 3 roundup

Third week of Filezoo development is now behind us. The current codebase stands at around 2500 lines of code and is starting to turn into a pretty useful little thing. And it has a lens flare. Which is a must for any self-respecting application. What? No? What do you mean no?

So, what happened this week? The week started off with a rewrite, turning the previous messy architecture into a cleaner MVC-style system. However, the new filesystem cache made recursive stats traversal slow and memory-hungry, and I've been procrastrinating on fixing that ever since. The rest of the new system is in need of a good thrashing as well, I've been running into redraw flicker (from drawing before current dir ready to draw) and startup deadlocks. But it's more responsive and easier to understand, so I would say the rewrite was definitely worthwhile.

Context menu and panel
The next new development was the addition of a context menu for files and directories, which turned the file browser into a file manager. I sunk some thought in coming up with a good set of commands for the menus, and the current set is fairly complete, if not very orthodox. Still lacking clipboard integration, though.

After the context menu came thumbnails for images and PDFs. Went with the xdg thumbnail filename spec and 128x128 thumbnails in the end, though the thumbs I generate aren't conforming (would have to set PNG metadata fields and I don't know how.) At first I didn't expire the loaded thumbnails, which ballooned memory usage and filled the video card RAM with textures. Which is bad. Now the thumbnails are in a very simple LRU cache, and ... it still leaks memory. Surf through enough images to load ten thousand thumbs and memory usage will be around 1GB.

Then I moved the color scheme and font family configuration into a config class. Changing them is still an edit & recompile -process, but it's a bit easier than having them scattered around the source tree. The long-term solution is to ... yes, what. GConf? Use colors from the Gtk theme? The Mono Windows Registry cognate? My Very Own Configuration File?

The end of the week was used to bring the panel applet forth in increasingly succulent manifestations. The current panel applet does bring a small amount of joy to my frozen heart, so it might actually be good, or have the potential for good. The DWIM bar in the panel can take the
following succession of commands:

!mkdir test # ! means "Run as a command line"
test # Valid path, navigate there

echo zenity --info --text=Hello > chmod # Create file "chmod."
# Note that this didn't need a ! because it had a valid command
# (= found by `which`) followed by -flags

chmod 755 chmod # Run chmod on "chmod."
# No need for ! because valid command and existing filename.

!./chmod # Run our "chmod" script.

chmod man page # A valid command but no -flag and no existing filename
# -> pass to the URL handler
# -> doesn't look like a URL, let's Google it

?chmod # ? means "Google it"

rm chmod # Valid command, valid filename
~ # Valid path after tilde expansion, navigate there (to home dir)

fhtr.blogspot.com # Not a command,
# not an existing filename,
# looks like a URL,
# open in Firefox.

The major missing features from the DWIM bar are history, autocompletion, tab-completion, filesystem search and terminal handling programs.

And then there were the lens flares.

No comments:

Blog Archive