Re: Fixing gvfs-backend-afc for iPhone/iPod Touch access



On Fri, 2009-07-31 at 01:02 +0100, Bastien Nocera wrote:
> On Thu, 2009-07-30 at 23:39 퍝㐅ꬭ觩춡잫權 Thu, 2009-07-30 at 12:50 -0400, David Zeuthen wrote:
> > > On Thu, 2009-07-30 at 18:43 퍭㐱ꫭ詴낮譞:
> > > > On Thu, 2009-07-30 at 11:32 퍭㐱ꫭ詴낮譞:
> > > > > Thus I ask for help, especially for the volume monitor code.
> > > > > 
> > > > > The backend currently detects a plugged in device however one ends up
> > > > > with:
> > > > > - Volume (is the enclosing volume for the mount)
> > > > >   - Mount (seems to be the mount from afc volume)
> > > > > - Mount (as if mounted using afc://uuid/ directly)
> > > > > 
> > > > 
> > > > Ok, I think I know what happens.
> > > > 
> > > > The volume monitor creates the GProxyShadowMount while at the same time
> > > > due to the afc:// activiation_root, the afc backend is started and
> > > > creates it's own mountpoint.
> > > > 
> > > > Apparently this is the same thing that happens with the gphoto2 backend.
> > > > As seen in the "gvfs-mount -l" output below gphoto2 also creates two
> > > > mounts for the same thing... I wonder if that is the desired.
> > > 
> > > It is intended. The non-proxy mount is shadowed and thus won't appear in
> > > any user interface (such as Nautilus or the GTK file chooser):
> > > 
> > > http://library.gnome.org/devel/gio/unstable/GMount.html#g-mount-is-shadowed
> > 
> > And that fixes the problem.
> 
> Last problem I would have is with parenting the mount to its volume.
> 
> David, any ideas?
> 

Thanks for the help so far!

This seems to be an issue for my GTK file chooser which appears to list
only the volumes or enclosed mounts, the backend mount does not appear
for selection in the sidebar. So we need "parenting".

If we introduce shadowing again and it is the right way (despite I don't
get why the backend mount can't simply parent itself to the volume which
issued the mount event), perhaps the GProxyShadowMount should inherit
everything from the mount it shadows automatically?

Alongside that, there would be code duplication for setting the
display_name/icon in both a volume monitor's volume implementation and
in the backend's mount() callback.

The gphoto2 stuff appears to partly circumvent the issue by letting the
monitor volume simply grab the name/icon from HAL if previously set.

However in some cases it additionally still determines the name with
"similar" code in both monitor volume creation and the backend mount().

This will be an issue once more complex code is added to properly handle
all device variants (e.g.: set correct icon fallback names like
phone-apple-iphone-3gs-white).

So either
a) two mounts, backend mount is shadowed, monitor mount inherits
shadowed mount name/icon and whatever else
b) one volume, backend mount is parented to volume when monitor issues
the mount

Additionally, I tested that the gvfsd-afc backend now exits if the right
device was unplugged with the great "exit(1)" call variant. ;)

This fixes left over icons on unplug. Things appear to work nicely with
multiple devices attached aswell (it's nice to see copying files from
phone to phone).

Still there appears to be some read/write issues when testing sqlite3 db
creation needed for music sync (probably some seek issue).
Investigating...

--- Martin S.



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