Re: Changes to GtkFileSystem API



Hi Federico,
just adapted gtkfilesystemwin32.c to the new IFace, which IMO resembles
the win32 drive model much more than the list_roots approach. Some
small comments below.

At 14:38 17.12.03 -0600, Federico Mena Quintero wrote:
>Hi, everyone,
>
>Last night I committed a bunch of changes to the GtkFileSystem API.  The
>intention is to remove the list_roots and get_root_info methods, and to
>add the following:
>
>typedef struct _GtkFileSystemVolume GtkFileSystemVolume;
>
>GSList * (*list_volumes) (GtkFileSystem *file_system);
>
>void (*volume_free) (GtkFileSystem        *file_system,
>		     GtkFileSystemVolume  *volume);
>
The method name makes me shudder, but of course I only need to 
implement and not call it ;-)
But serious : wouldn't it be much cleaner to make GtkFileSystemVolume
a gobject or do you think it's overkill ?

>GtkFilePath * (*volume_get_base_path) (GtkFileSystem       *file_system,
>				       GtkFileSystemVolume *volume);
>
>gboolean (*volume_get_is_mounted) (GtkFileSystem       *file_system,
>				   GtkFileSystemVolume *volume);
>
>gboolean (*volume_mount) (GtkFileSystem        *file_system, 
>			  GtkFileSystemVolume  *volume,
>			  GError              **error);
>
The win32 (as the Unix) imlementation simply return FALSE here. Maybe
with 'Network Volumes' there could be done something useful here.
Dynamic mounts are done automagically on windoze, so I'll probably need
to take a deeper look into the volumes_changed signal, if I unterstand
it's use case correctly ...

For API symmetry shouldn't there be a volume_umount as well. With say an
usb harddisk there could be done something useful on win32, though I'm
not sure it's worth the extra hoops require.


>char * (*volume_get_display_name) (GtkFileSystem       *file_system, 
>				   GtkFileSystemVolume *volume);
>
>GdkPixbuf * (*volume_render_icon) (GtkFileSystem        *file_system,
>				   GtkFileSystemVolume  *volume,
>				   GtkWidget            *widget,
>				   gint                  pixel_size,
>				   GError              **error);
>
>/* Signal */
>void (* volumes_changed) (GtkFileSystem *file_system);
>
> [...]

>Are people comfortable with this change?  GtkFileSystemUnix already
>works, but of course it only exports a "/" volume that is always
>mounted.  I'm finishing the implementation in the gnome-vfs backend.
>
GtkFilesSystemWin32 does work again, too. With one regression :
The currently win32 only (easily shareable in source) ~./gtk-bookmarks
implementation is not working anymore. Appears to be related
to the shortcuts_add_bookmarks/shortcuts_append_bookmarks change
in gtkfilechooserdefault.c

>I have not removed the "list_roots" method and the associated signal
>because I still need to convert GtkFileSystemModel.
>
I'm looking forward to this change to remove some ugly code duplication
in gtkfilesystemwin32.c.

Thanks,
	Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert



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