Re: RFC: preview files



On Fri, 2008-10-17 at 19:04 +0200, Alexander Larsson wrote:
> > I think, for gphoto2, it will just point to the URI of the file appended
> > with #gvfs-gphoto2-preview or something. Then I just make lookup_info()
> > and read() handle it in my backend.
> 
> I don't see any reason for it to have a URI at all. Generally we try to
> avoid using uris in the backend, and use mounts and pathnames on that
> mount. We should just have a GVfsIcon type that contains some string
> identifier parsed by the backend and a new separate vfs operation to
> open a stream to said icon identifier. For the gphoto backend it would
> just give the filename as the identifier.

OK, so this turned out to be a gigantic amount of work (~ 12 hours)
compared to the initial patch (< 1 hour). Patches (also for
gnome-desktop) are filed in Bugzilla

 http://bugzilla.gnome.org/show_bug.cgi?id=557182
 http://bugzilla.gnome.org/show_bug.cgi?id=557184

Sure, it's a little bit ugly how GVfsIcon is split into two files; the
current layout requires that since you want to both construct it from
the backend as well as on the client side. We might want to rethink that
at least before going public with the interfaces.

Also, there's a lot of code copied from gdaemonfile.c in
gvfsiconloadable.c to set up the input stream. I wasn't _really_ in the
mood to factor that out since it's getting late here... but I did write
a test program to ensure that it works.

Also, this depends on the GIcon serialization patch

 http://bugzilla.gnome.org/show_bug.cgi?id=555740

that also needed some work (vfuncs, versioning).

Anyway, it all seems to work nicely and it's pretty awesome seeing how
fast it is. Thanks for reviewing these patch.

    David




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