Re: New GBookmarkFile API in GLib 2.12



On mer, 2006-07-12 at 16:38 +0100, Emmanuele Bassi wrote:
> On Wed, 2006-07-12 at 17:17 +0200, Xavier Claessens wrote:
> > Hi,
> > 
> > I'm interested by porting the nautilus_bookmark_* API to the new
> > g_bookmark_file API from GLib 2.12. But I have some questions:
> > 
> > - Is it ok if nautilus 2.15 depends on glib 2.12 or should it wait for
> > nautilus 2.17 ?
> > 
> > - Where should the bookmark file be saved ? Maybe we should discuss this
> > with Gtk guys because it should be user by GtkFileChooser too. Now the
> > file is ~/.gtk-bookmark
> 
> In order to avoid breakage, and to follow the spec[1], the bookmarks
> file should have the .xbel extension; the spec itself proposes to use
> the $HOME/.shortcuts.xbel file for storing the file selectors shortcuts.
> 
> There should also be a folder for storing user-defined bookmark files:
> $XDG_DATA_DIRS/desktop-bookmarks (which should expand to something like:
> $HOME/.local/share/desktop-bookmarks); each file inside that folder
> should be parsed to build the list of bookmarks.
> 
> > - Is it ok to make the change now or should we wait for GtkFileChooser
> > before to copy how they do ?
> 
> I'll probably be the one working on the FileChooser integration of
> bookmarks and recent files, so a parallel effort might be better. ;-)
> 
> Ciao,
>  Emmanuele.

After reading the spec and the GLib's implementation I have more
questions:

- GBookmarkFile doesn't seems to have change notification. I guess
nautilus has to use gnome_vfs_monitor_add() and reload the file when
modified. Gtk will do the same kind of thing... What about having a
GtkBookmarkFile API specialised for shortcuts used by GtkFileChooser and
nautilus-places-sidebar (and more Gtk applications) ? This API can be
simpler than GBookmarkFile and provide some high-level signals like for
example some thing like:

gboolean
gtk_bookmark_file_new_callback (GtkBookmarkFile *bookmark,
				const gchar *uri,
				const gchar *name,
				const gchar *exec,
				gpointer user_data);

Like that every GTK applications doesn't have to handle file
modification, that's great for programs that doesn't depend on GnomeVFS.

- When adding a new bookmark we have to specify for which application it
is. Nautilus can say "nautilus" but what will GtkFilechooser say ? I
think it's an useless information in the case of shortcuts like in
GtkFileChooser. So if we make a GtkBookmarkFile it can hide all
application related informations ?

- What can be done for porting old ~/.gtk-bookmark to the new file
format ? If nothing is done the user will lose all his bookmarks. And if
GTK is updated before nautilus or gnome-panel we'll have non-consistent
bookmarks ! I think we should plan the migration with all applications
that use it, I see GTK, nautilus and gnome-panel. I guess the change
will come in gtk 2.11, will it be ready for GNOME 2.18 ?

Xavier Claessens.




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