Gnome-VFS, computer: and mounting



Hi,

As you might have seen already, im experimenting with a generic frontend API for KIO and Gnome-VFS for 3rd party applications. (http://www.scheinwelt.at/~norbertf/dadapt/files/xdg_utils/doc/libxdg-vfs.html)

The interface should be rich enough to run file-choosers on top of it. The basic idea is, that the interface provides a "root" URI (computer:// on Gnome-VFS and system:/ on KIO) and every directory listing is a list of full URIs (which can point to files, folders, network shares, drives...)

Browsing around drives and network shares seems to work quite well, but there is a little problem with mounting drives and Gnome-VFS.

In KIO it's quite easy, because it maps everything into the "system:/" pseudo-protocol with a "auto-mounting" behavior. For instance my cdrom is mapped as "system:/media/hdd". Opening this URI, or an URI below that (like system:/media/hdd/directory/file) will automatically mount the cdrom, because KIO seems to know that system:/media/ contains drives.

On Gnome-VFS i can walk through the desktop-entries listed by computer://, (there is an option in my xdg_vfs_gnome backend to automatically dive into desktop entries). It already works for mounted drives, but for drives which are not mounted, the URL points to "(null)":

xdg_vfs_gnome get computer:///CD-RW%252FDVD%25C2%25B1R%2520Drive.drive
[Desktop Entry]
Encoding=UTF-8
Name=CD-RW/DVD±R Drive
Type=FSDevice
Icon=gnome-dev-removable
URL=(null)

I guess there is a way to look up the appropriate drive and call gnome_vfs_drive_mount (), but i don't know how... Will the name returned by gnome_vfs_drive_get_display_name () exactly match the "Name" attribute of the desktop entry?

regards,
Norbert




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