Re: automatic method chaining the "right" way



> Man, this is a real bitch of a problem. I've been thinking about this
> for over two years. Like you pointed out in reply to my "capabilities"
> rant GnomeVFS should expose to an application that a tarball supports
> directory operations and should "magically" handle invoking the tar
> method. Well, I think so anyway. I made chained methods work while I was
> at Eazel but nobody ever came up with a decent UI. The problem was this,
> when a user opens an image file they can use the "Open with..." menu to
> switch between EOG, Nautilus' internal viewer and other future
> components designed to show images. With chained methods the way they
> work currently, the act of "activating" a chained URI will change the
> URI from file:///path/to/file.tar to file:///path/to/file.tar#tar:/ -
> And then they won't be able to switch to another view (such as a guitar
> component or something like that) because as far as the application is
> concerned this isn't a tar file, its a directory.

I've been trying to work out how to get this working and that small,
semi-proof-of-concept program that I posted a little bit ago was one
direction; after sitting down and coding a bit, I realized that
"has_directory_ops" really isn't (necessarily) the right thing to
expose.  A better, and more general, flag would be "has_vfs_method" or
something.  The reason for this is that MIME-types while
application/x-compressed-tar supports directory operations (through two
chained methods) if you get the "real" type of a .tar.gz file, it will
be application/gzip, which DOESN'T support directory operations, but
DOES have a gnome-vfs method which exposes a tar file, which does
support directory operations AND has a gvfs method that exposes a
directory.

By specifying the "has_vfs_method" (and possibly an API to get at the
requisite string to append to the URI) an application can support "View
As Text" for a sometextfile.txt.gz through one more level of
introspection.  Additionally, the app. can keep the URI the same, query
the capabilities of the file and use that information to switch between
views.  The main missing piece in this equation is a way to register VFS
methods to handle specific MIME types.  However, that's another area
I've been thinking about, and will probably post a RFC sometime soon wrt
that.

--Shahms 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]