diff --git a/configure.in b/configure.in
index 49a5cee..b767ff5 100644
--- a/configure.in
+++ b/configure.in
@@ -42,7 +42,10 @@ dnl Check that we meet the dependencies
 dnl ==============================================
 AM_PATH_GLIB_2_0(2.8.0,,,gobject)
 
-COMMON_MODULES="glib-2.0 gobject-2.0 gtk+-2.0 gdk-2.0"
+COMMON_MODULES="glib-2.0 >= 2.12.0 \
+		gobject-2.0 \
+		gtk+-2.0 >= 2.13.3 \
+		gdk-2.0 gio-2.0"
 
 PKG_CHECK_MODULES(GLADE, libglade-2.0)
 AC_SUBST(GLADE_CFLAGS)
@@ -152,9 +155,8 @@ AC_ARG_ENABLE(nautilus-extension,
 if test "x$ENABLE_NAUTILUS_EXTENSION" = "x1"
 then
 	NAUTILUS_REQUIRED=2.6.0
-	GNOME_VFS_REQUIRED=2.12.0
 
-	PKG_CHECK_MODULES(NAUTILUS, [libnautilus-extension >= $NAUTILUS_REQUIRED glib-2.0 gobject-2.0 gconf-2.0 gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED])
+	PKG_CHECK_MODULES(NAUTILUS, [libnautilus-extension >= $NAUTILUS_REQUIRED glib-2.0 gobject-2.0 gconf-2.0])
 
 	AC_SUBST(NAUTILUS_CFLAGS)
 	AC_SUBST(NAUTILUS_LIBS)
diff --git a/libslab/Makefile.am b/libslab/Makefile.am
index 2661748..dc182c6 100644
--- a/libslab/Makefile.am
+++ b/libslab/Makefile.am
@@ -37,18 +37,11 @@ libslab_la_SOURCES =				\
 	app-shell-startup.c			\
 	application-tile.c			\
 	bookmark-agent.h			\
-	bookmark-agent-libslab.h		\
 	bookmark-agent.c			\
 	directory-tile.c			\
 	document-tile.c				\
 	double-click-detector.c			\
 	double-click-detector.h			\
-	libslab-bookmarkfile.c			\
-	libslab-bookmarkfile.h			\
-	egg-recent-item.c			\
-	egg-recent-item.h			\
-	egg-recent-model.c			\
-	egg-recent-model.h			\
 	gnome-utils.c				\
 	libslab-utils.c				\
 	libslab-utils.h				\
diff --git a/libslab/bookmark-agent-libslab.h b/libslab/bookmark-agent-libslab.h
deleted file mode 100644
index 0a61a33..0000000
--- a/libslab/bookmark-agent-libslab.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is part of the Main Menu.
- *
- * Copyright (c) 2007 Novell, Inc.
- *
- * The Main Menu is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * The Main Menu is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * the Main Menu; if not, write to the Free Software Foundation, Inc., 51
- * Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef __BOOKMARK_AGENT_LIBSLAB_H__
-#define __BOOKMARK_AGENT_LIBSLAB_H__
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-#include "libslab-bookmarkfile.h"
-
-#define GBookmarkFile                    LibSlabBookmarkFile
-                                                                            
-#define g_bookmark_file_new              libslab_bookmark_file_new
-#define g_bookmark_file_free             libslab_bookmark_file_free
-
-#define g_bookmark_file_load_from_file   libslab_bookmark_file_load_from_file
-#define g_bookmark_file_to_file          libslab_bookmark_file_to_file
-
-#define g_bookmark_file_has_item         libslab_bookmark_file_has_item
-#define g_bookmark_file_remove_item      libslab_bookmark_file_remove_item
-#define g_bookmark_file_get_uris         libslab_bookmark_file_get_uris
-#define g_bookmark_file_get_size         libslab_bookmark_file_get_size
-#define g_bookmark_file_get_title        libslab_bookmark_file_get_title
-#define g_bookmark_file_set_title        libslab_bookmark_file_set_title
-#define g_bookmark_file_get_mime_type    libslab_bookmark_file_get_mime_type
-#define g_bookmark_file_set_mime_type    libslab_bookmark_file_set_mime_type
-#define g_bookmark_file_get_modified     libslab_bookmark_file_get_modified
-#define g_bookmark_file_set_modified     libslab_bookmark_file_set_modified
-#define g_bookmark_file_get_icon         libslab_bookmark_file_get_icon
-#define g_bookmark_file_set_icon         libslab_bookmark_file_set_icon
-#define g_bookmark_file_get_applications libslab_bookmark_file_get_applications
-#define g_bookmark_file_add_application  libslab_bookmark_file_add_application
-#define g_bookmark_file_get_app_info     libslab_bookmark_file_get_app_info
-#define g_bookmark_file_get_groups       libslab_bookmark_file_get_groups
-#define g_bookmark_file_add_group        libslab_bookmark_file_add_group
-#define g_bookmark_file_remove_group     libslab_bookmark_file_remove_group
-#define g_bookmark_file_move_item        libslab_bookmark_file_move_item
-
-G_END_DECLS
-
-#endif
diff --git a/libslab/bookmark-agent.c b/libslab/bookmark-agent.c
index 9f121bb..d44889c 100644
--- a/libslab/bookmark-agent.c
+++ b/libslab/bookmark-agent.c
@@ -26,18 +26,7 @@
 #	define PACKAGE "gnome-main-menu"
 #endif
 
-#if ! GLIB_CHECK_VERSION (2, 12, 0)
-#	include "bookmark-agent-libslab.h"
-#endif
-
-#include <gtk/gtkversion.h>
-#if GTK_CHECK_VERSION (2, 10, 0)
-#	define USE_GTK_RECENT_MANAGER
-#	include <gtk/gtkrecentmanager.h>
-#else
-#	define EGG_ENABLE_RECENT_FILES
-#	include "egg-recent-model.h"
-#endif
+#include <gtk/gtk.h>
 
 #include <string.h>
 #include <stdlib.h>
@@ -133,9 +122,7 @@ static void store_monitor_cb (GFileMonitor *, GFile *, GFile *,
 static void gconf_notify_cb  (GConfClient *, guint, GConfEntry *, gpointer);
 static void weak_destroy_cb  (gpointer, GObject *);
 
-#ifdef USE_GTK_RECENT_MANAGER
 static gint recent_item_mru_comp_func (gconstpointer a, gconstpointer b);
-#endif
 
 static gchar *find_package_data_file (const gchar *filename);
 
@@ -218,17 +205,11 @@ bookmark_agent_move_item (BookmarkAgent *this, const gchar *uri, const gchar *ur
 {
 	BookmarkAgentPrivate *priv = PRIVATE (this);
 
-#ifdef USE_GTK_RECENT_MANAGER
 	GError *error = NULL;
-#else
-	EggRecentModel *model;
-#endif
-
 
 	if (! TYPE_IS_RECENT (priv->type))
 		return;
 
-#ifdef USE_GTK_RECENT_MANAGER
 	gtk_recent_manager_move_item (
 		gtk_recent_manager_get_default (), uri, uri_new, & error);
 
@@ -236,14 +217,6 @@ bookmark_agent_move_item (BookmarkAgent *this, const gchar *uri, const gchar *ur
 		libslab_handle_g_error (
 			& error, "%s: unable to update %s with renamed file, [%s] -> [%s].",
 			G_STRFUNC, priv->store_path, uri, uri_new);
-#else
-	model = egg_recent_model_new (EGG_RECENT_MODEL_SORT_NONE);
-
-	egg_recent_model_delete (model, uri);
-	egg_recent_model_add    (model, uri_new);
-
-	g_object_unref (model);
-#endif
 }
 
 void
@@ -253,11 +226,7 @@ bookmark_agent_remove_item (BookmarkAgent *this, const gchar *uri)
 
 	gint rank;
 
-#ifdef USE_GTK_RECENT_MANAGER
 	GError *error = NULL;
-#else
-	EggRecentModel *model;
-#endif
 
 	gchar **uris = NULL;
 	gint    rank_i;
@@ -270,7 +239,6 @@ bookmark_agent_remove_item (BookmarkAgent *this, const gchar *uri)
 		return;
 
 	if (TYPE_IS_RECENT (priv->type)) {
-#ifdef USE_GTK_RECENT_MANAGER
 		gtk_recent_manager_remove_item (
 			gtk_recent_manager_get_default (), uri, & error);
 
@@ -278,11 +246,6 @@ bookmark_agent_remove_item (BookmarkAgent *this, const gchar *uri)
 			libslab_handle_g_error (
 				& error, "%s: unable to remove [%s] from %s.",
 				G_STRFUNC, priv->store_path, uri);
-#else
-		model = egg_recent_model_new (EGG_RECENT_MODEL_SORT_NONE);
-		egg_recent_model_delete (model, uri);
-		g_object_unref (model);
-#endif
 	}
 	else {
 		rank = get_rank (this, uri);
@@ -546,11 +509,7 @@ bookmark_agent_new (BookmarkStoreType type)
 			priv->user_modifiable = TRUE;
 			priv->reorderable     = FALSE;
 
-#ifdef USE_GTK_RECENT_MANAGER
 			priv->store_path = g_build_filename (g_get_home_dir (), ".recently-used.xbel", NULL);
-#else
-			priv->store_path = g_build_filename (g_get_home_dir (), ".recently-used", NULL);
-#endif
 
 			break;
 
@@ -1274,10 +1233,8 @@ weak_destroy_cb (gpointer data, GObject *g_obj)
 	instances [GPOINTER_TO_INT (data)] = NULL;
 }
 
-#ifdef USE_GTK_RECENT_MANAGER
 static gint
 recent_item_mru_comp_func (gconstpointer a, gconstpointer b)
 {
 	return ((BookmarkItem *) b)->mtime - ((BookmarkItem *) a)->mtime;
 }
-#endif
diff --git a/libslab/egg-recent-item.c b/libslab/egg-recent-item.c
deleted file mode 100644
index ce4b64e..0000000
--- a/libslab/egg-recent-item.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- *
- * Authors:
- *   James Willcox <jwillcox@cs.indiana.edu>
- */
-
-
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <libgnomevfs/gnome-vfs-mime-utils.h>
-#include "egg-recent-item.h"
-
-
-
-EggRecentItem *
-egg_recent_item_new (void)
-{
-	EggRecentItem *item;
-
-	item = g_new (EggRecentItem, 1);
-
-	item->groups = NULL;
-	item->private_data = FALSE;
-	item->uri = NULL;
-	item->mime_type = NULL;
-	item->mime_type_is_explicit = FALSE;
-
-	item->refcount = 1;
-
-	return item;
-}
-
-static void
-egg_recent_item_free (EggRecentItem *item)
-{
-	if (item->uri)
-		g_free (item->uri);
-
-	if (item->mime_type)
-		g_free (item->mime_type);
-
-	if (item->groups) {
-		g_list_foreach (item->groups, (GFunc)g_free, NULL);
-		g_list_free (item->groups);
-		item->groups = NULL;
-	}
-
-	g_free (item);
-}
-
-EggRecentItem *
-egg_recent_item_ref (EggRecentItem *item)
-{
-	item->refcount++;
-	return item;
-}
-
-EggRecentItem *
-egg_recent_item_unref (EggRecentItem *item)
-{
-	item->refcount--;
-
-	if (item->refcount == 0) {
-		egg_recent_item_free (item);
-	}
-
-	return item;
-}
-
-
-EggRecentItem * 
-egg_recent_item_new_from_uri (const gchar *uri)
-{
-	EggRecentItem *item;
-
-	g_return_val_if_fail (uri != NULL, NULL);
-
-	item = egg_recent_item_new ();
-
-	if (!egg_recent_item_set_uri (item ,uri)) {
-		egg_recent_item_free (item);
-		return NULL;
-	}
-	
-	return item;
-}
-
-static void
-egg_recent_item_update_mime_type (EggRecentItem *item)
-{
-	if (!item->mime_type_is_explicit) {
-		g_free (item->mime_type);
-		item->mime_type = NULL;
-
-		if (item->uri)
-			item->mime_type = gnome_vfs_get_mime_type (item->uri);
-
-		if (!item->mime_type)
-			item->mime_type = g_strdup (GNOME_VFS_MIME_TYPE_UNKNOWN);
-	}
-}
-
-gboolean
-egg_recent_item_set_uri (EggRecentItem *item, const gchar *uri)
-{
-	gchar *utf8_uri;
-
-	/* if G_BROKEN_FILENAMES is not set, this should succede */
-	if (g_utf8_validate (uri, -1, NULL)) {
-		item->uri = gnome_vfs_make_uri_from_input (uri);
-	} else {
-		utf8_uri = g_filename_to_utf8 (uri, -1, NULL, NULL, NULL);
-
-		if (utf8_uri == NULL) {
-			g_warning ("Couldn't convert URI to UTF-8");
-			return FALSE;
-		}
-
-		if (g_utf8_validate (utf8_uri, -1, NULL)) {
-			item->uri = gnome_vfs_make_uri_from_input (utf8_uri);
-		} else {
-			g_free (utf8_uri);
-			return FALSE;
-		}
-
-		g_free (utf8_uri);
-	}
-
-	return TRUE;
-}
-
-gchar * 
-egg_recent_item_get_uri (const EggRecentItem *item)
-{
-	return g_strdup (item->uri);
-}
-
-G_CONST_RETURN gchar * 
-egg_recent_item_peek_uri (const EggRecentItem *item)
-{
-	return item->uri;
-}
-
-gchar * 
-egg_recent_item_get_uri_utf8 (const EggRecentItem *item)
-{
-	/* this could fail, but it's not likely, since we've already done it
-	 * once in set_uri()
-	 */
-	return g_filename_to_utf8 (item->uri, -1, NULL, NULL, NULL);
-}
-
-gchar *
-egg_recent_item_get_uri_for_display (const EggRecentItem *item)
-{
-	return gnome_vfs_format_uri_for_display (item->uri);
-}
-
-/* Stolen from gnome_vfs_make_valid_utf8() */
-static char *
-make_valid_utf8 (const char *name)
-{
-	GString *string;
-	const char *remainder, *invalid;
-	int remaining_bytes, valid_bytes;
-
-	string = NULL;
-	remainder = name;
-	remaining_bytes = name ? strlen (name) : 0;
-
-	while (remaining_bytes != 0) {
-		if (g_utf8_validate (remainder, remaining_bytes, &invalid))
-			break;
-
-		valid_bytes = invalid - remainder;
-
-		if (string == NULL)
-			string = g_string_sized_new (remaining_bytes);
-
-		g_string_append_len (string, remainder, valid_bytes);
-		g_string_append_c (string, '?');
-
-		remaining_bytes -= valid_bytes + 1;
-		remainder = invalid + 1;
-	}
-
-	if (string == NULL)
-		return g_strdup (name);
-
-	g_string_append (string, remainder);
-/* 	g_string_append (string, _(" (invalid file name)")); */
-	g_assert (g_utf8_validate (string->str, -1, NULL));
-
-	return g_string_free (string, FALSE);
-}
-
-static gchar *
-get_uri_shortname_for_display (GnomeVFSURI *uri)
-{
-	gchar    *name;	
-	gboolean  validated;
-
-	validated = FALSE;
-	name = gnome_vfs_uri_extract_short_name (uri);
-	
-	if (name == NULL)
-	{
-		name = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
-	}
-	else if (g_ascii_strcasecmp (uri->method_string, "file") == 0)
-	{
-		gchar *text_uri;
-		gchar *local_file;
-		text_uri = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
-		local_file = gnome_vfs_get_local_path_from_uri (text_uri);
-		
-		if (local_file != NULL)
-		{
-			g_free (name);
-			name = g_filename_display_basename (local_file);
-			validated = TRUE;
-		}
-		
-		g_free (local_file);
-		g_free (text_uri);
-	} 
-	else if (!gnome_vfs_uri_has_parent (uri)) 
-	{
-		const gchar *method;
-		
-		method = uri->method_string;
-		
-		if (name == NULL ||
-		    strcmp (name, GNOME_VFS_URI_PATH_STR) == 0) 
-		{
-			g_free (name);
-			name = g_strdup (method);
-		} 
-		else 
-		{
-			gchar *tmp;
-			
-			tmp = name;
-			name = g_strdup_printf ("%s: %s", method, name);
-			g_free (tmp);
-		}
-	}
-
-	if (!validated && !g_utf8_validate (name, -1, NULL)) 
-	{
-		gchar *utf8_name;
-		
-		utf8_name = make_valid_utf8 (name);
-		g_free (name);
-		name = utf8_name;
-	}
-
-	return name;
-}
-
-/**
- * egg_recent_item_get_short_name:
- * @item: an #EggRecentItem
- *
- * Computes a valid UTF-8 string that can be used as the name of the item in a
- * menu or list.  For example, calling this function on an item that refers to
- * "file:///foo/bar.txt" will yield "bar.txt".
- *
- * Return value: A newly-allocated string in UTF-8 encoding; free it with
- * g_free().
- **/
-gchar *
-egg_recent_item_get_short_name (const EggRecentItem *item)
-{
-	GnomeVFSURI *uri;
-	gchar *short_name;
-
-	g_return_val_if_fail (item != NULL, NULL);
-
-	if (item->uri == NULL)
-		return NULL;
-
-	uri = gnome_vfs_uri_new (item->uri);
-	if (uri == NULL)
-		return NULL;
-
-	short_name = get_uri_shortname_for_display (uri);
-
-	gnome_vfs_uri_unref (uri);
-
-	return short_name;
-}
-
-void 
-egg_recent_item_set_mime_type (EggRecentItem *item, const gchar *mime)
-{
-	g_free (item->mime_type);
-	item->mime_type = NULL;
-
-	if (mime && mime[0]) {
-		item->mime_type_is_explicit = TRUE;
-		item->mime_type             = g_strdup (mime);
-	} else {
-		item->mime_type_is_explicit = FALSE;
-	}
-}
-
-gchar * 
-egg_recent_item_get_mime_type (EggRecentItem *item)
-{
-	egg_recent_item_update_mime_type (item);
-
-	return g_strdup (item->mime_type);
-}
-
-void 
-egg_recent_item_set_timestamp (EggRecentItem *item, time_t timestamp)
-{
-	if (timestamp == (time_t) -1)
-		time (&timestamp);
-
-	item->timestamp = timestamp;
-}
-
-time_t 
-egg_recent_item_get_timestamp (const EggRecentItem *item)
-{
-	return item->timestamp;
-}
-
-G_CONST_RETURN GList *
-egg_recent_item_get_groups (const EggRecentItem *item)
-{
-	return item->groups;
-}
-
-gboolean
-egg_recent_item_in_group (const EggRecentItem *item, const gchar *group_name)
-{
-	GList *tmp;
-
-	tmp = item->groups;
-	while (tmp != NULL) {
-		gchar *val = (gchar *)tmp->data;
-		
-		if (strcmp (group_name, val) == 0)
-			return TRUE;
-
-		tmp = tmp->next;
-	}
-	
-	return FALSE;
-}
-
-void
-egg_recent_item_add_group (EggRecentItem *item, const gchar *group_name)
-{
-	g_return_if_fail (group_name != NULL);
-
-	if (!egg_recent_item_in_group (item, group_name))
-		item->groups = g_list_append (item->groups, g_strdup (group_name));
-}
-
-void
-egg_recent_item_remove_group (EggRecentItem *item, const gchar *group_name)
-{
-	GList *tmp;
-
-	g_return_if_fail (group_name != NULL);
-
-	tmp = item->groups;
-	while (tmp != NULL) {
-		gchar *val = (gchar *)tmp->data;
-		
-		if (strcmp (group_name, val) == 0) {
-			item->groups = g_list_remove (item->groups,
-						      val);
-			g_free (val);
-			break;
-		}
-
-		tmp = tmp->next;
-	}
-}
-
-void
-egg_recent_item_set_private (EggRecentItem *item, gboolean priv)
-{
-	item->private_data = priv;
-}
-
-gboolean
-egg_recent_item_get_private (const EggRecentItem *item)
-{
-	return item->private_data;
-}
-
-GType
-egg_recent_item_get_type (void)
-{
-	static GType boxed_type = 0;
-	
-	if (!boxed_type) {
-		boxed_type = g_boxed_type_register_static ("EggRecentItem",
-					(GBoxedCopyFunc)egg_recent_item_ref,
-					(GBoxedFreeFunc)egg_recent_item_unref);
-	}
-	
-	return boxed_type;
-}
diff --git a/libslab/egg-recent-item.h b/libslab/egg-recent-item.h
deleted file mode 100644
index 00f8fb8..0000000
--- a/libslab/egg-recent-item.h
+++ /dev/null
@@ -1,80 +0,0 @@
-
-#ifndef __EGG_RECENT_ITEM_H__
-#define __EGG_RECENT_ITEM_H__
-
-#include <time.h>
-#include <glib.h>
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define EGG_TYPE_RECENT_ITEM       (egg_recent_item_get_type ())
-
-#define EGG_RECENT_ITEM_LIST_UNREF(list) \
-	g_list_foreach (list, (GFunc)egg_recent_item_unref, NULL); \
-	g_list_free (list);
-
-typedef struct _EggRecentItem EggRecentItem;
-
-struct _EggRecentItem {
-	/* do not access any of these directly */
-	gchar *uri;
-	gchar *mime_type;
-	time_t timestamp;
-
-	gboolean private_data;
-
-	GList *groups;
-	
-	int refcount;
-
-	guint mime_type_is_explicit : 1;
-};
-
-GType		egg_recent_item_get_type (void) G_GNUC_CONST;
-
-/* constructors */
-EggRecentItem * egg_recent_item_new (void);
-
-EggRecentItem *	egg_recent_item_ref (EggRecentItem *item);
-EggRecentItem *	egg_recent_item_unref (EggRecentItem *item);
-
-/* automatically fetches the mime type, etc */
-EggRecentItem * egg_recent_item_new_from_uri (const gchar *uri);
-
-gboolean egg_recent_item_set_uri (EggRecentItem *item, const gchar *uri);
-gchar * egg_recent_item_get_uri (const EggRecentItem *item);
-gchar * egg_recent_item_get_uri_utf8 (const EggRecentItem *item);
-gchar * egg_recent_item_get_uri_for_display (const EggRecentItem *item);
-gchar * egg_recent_item_get_short_name (const EggRecentItem *item);
-
-void egg_recent_item_set_mime_type (EggRecentItem *item, const gchar *mime);
-gchar * egg_recent_item_get_mime_type (EggRecentItem *item);
-
-void egg_recent_item_set_timestamp (EggRecentItem *item, time_t timestamp);
-time_t egg_recent_item_get_timestamp (const EggRecentItem *item);
-
-G_CONST_RETURN gchar *egg_recent_item_peek_uri (const EggRecentItem *item);
-
-
-/* groups */
-G_CONST_RETURN GList *  egg_recent_item_get_groups (const EggRecentItem *item);
-
-gboolean       egg_recent_item_in_group (const EggRecentItem *item,
-					   const gchar *group_name);
-
-void           egg_recent_item_add_group (EggRecentItem *item,
-					    const gchar *group_name);
-
-void           egg_recent_item_remove_group (EggRecentItem *item,
-					       const gchar *group_name);
-
-void           egg_recent_item_set_private (EggRecentItem *item,
-					      gboolean priv);
-
-gboolean       egg_recent_item_get_private (const EggRecentItem *item);
-
-
-G_END_DECLS
-
-#endif /* __EGG_RECENT_ITEM_H__ */
diff --git a/libslab/egg-recent-model.c b/libslab/egg-recent-model.c
deleted file mode 100644
index 0570272..0000000
--- a/libslab/egg-recent-model.c
+++ /dev/null
@@ -1,1965 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- *
- * Authors:
- *   James Willcox <jwillcox@cs.indiana.edu>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <gtk/gtk.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <libgnomevfs/gnome-vfs-mime-utils.h>
-#include <gconf/gconf-client.h>
-
-#define EGG_ENABLE_RECENT_FILES
-#include "egg-recent-model.h"
-#include "egg-recent-item.h"
-
-#define EGG_RECENT_MODEL_FILE_PATH "/.recently-used"
-#define EGG_RECENT_MODEL_BUFFER_SIZE 8192
-
-#define EGG_RECENT_MODEL_MAX_ITEMS 500
-#define EGG_RECENT_MODEL_DEFAULT_LIMIT 10
-#define EGG_RECENT_MODEL_TIMEOUT_LENGTH 200
-#define EGG_RECENT_MODEL_POLL_TIME 3
-
-/* needed for Darwin */
-#if !HAVE_DECL_LOCKF
-int lockf (int filedes, int function, off_t size);
-#endif
-
-#define EGG_RECENT_MODEL_KEY_DIR "/desktop/gnome/recent_files"
-#define EGG_RECENT_MODEL_DEFAULT_LIMIT_KEY EGG_RECENT_MODEL_KEY_DIR "/default_limit"
-#define EGG_RECENT_MODEL_EXPIRE_KEY EGG_RECENT_MODEL_KEY_DIR "/expire"
-
-struct _EggRecentModelPrivate {
-	GSList *mime_filter_values;	/* list of mime types we allow */
-	GSList *group_filter_values;	/* list of groups we allow */
-	GSList *scheme_filter_values;	/* list of URI schemes we allow */
-
-	EggRecentModelSort sort_type; /* type of sorting to be done */
-
-	int limit;			/* soft limit for length of the list */
-	int expire_days;		/* number of days to hold an item */
-
-	char *path;			/* path to the file we store stuff in */
-
-	GHashTable *monitors;
-
-	GnomeVFSMonitorHandle *monitor;
-
-	GConfClient *client;
-	gboolean use_default_limit;
-
-	guint limit_change_notify_id;
-	guint expiration_change_notify_id;
-
-	guint changed_timeout;
-	guint poll_timeout;
-	time_t last_mtime;
-};
-
-/* signals */
-enum {
-	CHANGED,
-	LAST_SIGNAL
-};
-
-static GType model_signals[LAST_SIGNAL] = { 0 };
-
-/* properties */
-enum {
-	PROP_BOGUS,
-	PROP_MIME_FILTERS,
-	PROP_GROUP_FILTERS,
-	PROP_SCHEME_FILTERS,
-	PROP_SORT_TYPE,
-	PROP_LIMIT
-};
-
-typedef struct {
-	GSList *states;
-	GList *items;
-	EggRecentItem *current_item;
-} ParseInfo;
-
-typedef enum {
-	STATE_START,
-	STATE_RECENT_FILES,
-	STATE_RECENT_ITEM,
-	STATE_URI,
-	STATE_MIME_TYPE,
-	STATE_TIMESTAMP,
-	STATE_PRIVATE,
-	STATE_GROUPS,
-	STATE_GROUP
-} ParseState;
-
-typedef struct {
-	EggRecentModel *model;
-	GList *list;
-} ChangedData;
-
-#define TAG_RECENT_FILES "RecentFiles"
-#define TAG_RECENT_ITEM "RecentItem"
-#define TAG_URI "URI"
-#define TAG_MIME_TYPE "Mime-Type"
-#define TAG_TIMESTAMP "Timestamp"
-#define TAG_PRIVATE "Private"
-#define TAG_GROUPS "Groups"
-#define TAG_GROUP "Group"
-
-static void start_element_handler (GMarkupParseContext *context,
-			      const gchar *element_name,
-			      const gchar **attribute_names,
-			      const gchar **attribute_values,
-			      gpointer user_data,
-			      GError **error);
-
-static void end_element_handler (GMarkupParseContext *context,
-			    const gchar *element_name,
-			    gpointer user_data,
-			    GError **error);
-
-static void text_handler (GMarkupParseContext *context,
-		     const gchar *text,
-		     gsize text_len,
-		     gpointer user_data,
-		     GError **error);
-
-static void error_handler (GMarkupParseContext *context,
-		      GError *error,
-		      gpointer user_data);
-
-static GMarkupParser parser = {start_element_handler, end_element_handler,
-			text_handler,
-			NULL,
-			error_handler};
-
-static GObjectClass *parent_class;
-
-static void egg_recent_model_clear_mime_filter (EggRecentModel *model);
-static void egg_recent_model_clear_group_filter (EggRecentModel *model);
-static void egg_recent_model_clear_scheme_filter (EggRecentModel *model);
-
-static GObjectClass *parent_class;
-
-static gboolean
-egg_recent_model_string_match (const GSList *list, const gchar *str)
-{
-	const GSList *tmp;
-
-	if (list == NULL || str == NULL)
-		return TRUE;
-
-	tmp = list;
-	
-	while (tmp) {
-		if (g_pattern_match_string (tmp->data, str))
-			return TRUE;
-		
-		tmp = tmp->next;
-	}
-
-	return FALSE;
-}
-
-static gboolean
-egg_recent_model_write_raw (EggRecentModel *model, FILE *file,
-			      const gchar *content)
-{
-	int len;
-	int fd;
-	struct stat sbuf;
-
-	rewind (file);
-
-	len = strlen (content);
-	fd = fileno (file);
-
-	if (fstat (fd, &sbuf) < 0)
-		g_warning ("Couldn't stat XML document.");
-
-	if ((off_t)len < sbuf.st_size) {
-		ftruncate (fd, len);
-	}
-
-	if (fputs (content, file) == EOF)
-		return FALSE;
-
-#ifndef G_OS_WIN32
-	fsync (fd);
-#endif
-	rewind (file);
-
-	return TRUE;
-}
-
-static GList *
-egg_recent_model_delete_from_list (GList *list,
-				       const gchar *uri)
-{
-	GList *tmp;
-
-	if (!uri)
-		return list;
-
-	tmp = list;
-
-	while (tmp) {
-		EggRecentItem *item = tmp->data;
-		GList         *next;
-
-		next = tmp->next;
-
-		if (!strcmp (egg_recent_item_peek_uri (item), uri)) {
-			egg_recent_item_unref (item);
-
-			list = g_list_remove_link (list, tmp);
-			g_list_free_1 (tmp);
-		}
-
-		tmp = next;
-	}
-
-	return list;
-}
-
-static void
-egg_recent_model_add_new_groups (EggRecentItem *item,
-				 EggRecentItem *upd_item)
-{
-	const GList *tmp;
-
-	tmp = egg_recent_item_get_groups (upd_item);
-
-	while (tmp) {
-		char *group = tmp->data;
-
-		if (!egg_recent_item_in_group (item, group))
-			egg_recent_item_add_group (item, group);
-
-		tmp = tmp->next;
-	}
-}
-
-static gboolean
-egg_recent_model_update_item (GList *items, EggRecentItem *upd_item)
-{
-	GList      *tmp;
-	const char *uri;
-
-	uri = egg_recent_item_peek_uri (upd_item);
-
-	tmp = items;
-
-	while (tmp) {
-		EggRecentItem *item = tmp->data;
-
-		if (gnome_vfs_uris_match (egg_recent_item_peek_uri (item), uri)) {
-			egg_recent_item_set_timestamp (item, (time_t) -1);
-
-			egg_recent_model_add_new_groups (item, upd_item);
-
-			return TRUE;
-		}
-
-		tmp = tmp->next;
-	}
-
-	return FALSE;
-}
-
-static gchar *
-egg_recent_model_read_raw (EggRecentModel *model, FILE *file)
-{
-	GString *string;
-	char buf[EGG_RECENT_MODEL_BUFFER_SIZE];
-
-	rewind (file);
-
-	string = g_string_new (NULL);
-	while (fgets (buf, EGG_RECENT_MODEL_BUFFER_SIZE, file)) {
-		string = g_string_append (string, buf);
-	}
-
-	rewind (file);
-
-	return g_string_free (string, FALSE);
-}
-
-
-
-static ParseInfo *
-parse_info_init (void)
-{
-	ParseInfo *retval;
-	
-	retval = g_new0 (ParseInfo, 1);
-	retval->states = g_slist_prepend (NULL, STATE_START);
-	retval->items = NULL;
-	
-	return retval;
-}
-
-static void
-parse_info_free (ParseInfo *info)
-{
-	g_slist_free (info->states);
-	g_free (info);
-}
-
-static void
-push_state (ParseInfo  *info,
-            ParseState  state)
-{
-  info->states = g_slist_prepend (info->states, GINT_TO_POINTER (state));
-}
-
-static void
-pop_state (ParseInfo *info)
-{
-  g_return_if_fail (info->states != NULL);
-
-  info->states = g_slist_remove (info->states, info->states->data);
-}
-
-static ParseState
-peek_state (ParseInfo *info)
-{
-  g_return_val_if_fail (info->states != NULL, STATE_START);
-
-  return GPOINTER_TO_INT (info->states->data);
-}
-
-#define ELEMENT_IS(name) (strcmp (element_name, (name)) == 0)
-
-static gboolean
-valid_element (ParseInfo    *info,
-	       int           valid_parent_state,
-	       const gchar  *element_name,
-	       const gchar  *valid_element,
-	       GError      **error)
-{
-	if (peek_state (info) != valid_parent_state) {
-	      g_set_error (error,
-			   G_MARKUP_ERROR,
-			   G_MARKUP_ERROR_INVALID_CONTENT,
-			   "Unexpected tag '%s', tag '%s' expected",
-			   element_name, valid_element);
-	      return FALSE;
-	}
-
-	return TRUE;
-}
-
-static void
-start_element_handler (GMarkupParseContext *context,
-			      const gchar *element_name,
-			      const gchar **attribute_names,
-			      const gchar **attribute_values,
-			      gpointer user_data,
-			      GError **error)
-{
-	ParseInfo *info = (ParseInfo *)user_data;
-
-	if (ELEMENT_IS (TAG_RECENT_FILES))
-		push_state (info, STATE_RECENT_FILES);
-	else if (ELEMENT_IS (TAG_RECENT_ITEM)) {
-		if (valid_element (info, STATE_RECENT_FILES,
-				   TAG_RECENT_ITEM, TAG_RECENT_FILES, error)) {
-			info->current_item = egg_recent_item_new ();
-			push_state (info, STATE_RECENT_ITEM);
-		}
-	} else if (ELEMENT_IS (TAG_URI)) {
-		if (valid_element (info, STATE_RECENT_ITEM,
-				   TAG_URI, TAG_RECENT_ITEM, error)) {
-			push_state (info, STATE_URI);
-		}
-	} else if (ELEMENT_IS (TAG_MIME_TYPE)) {
-		if (valid_element (info, STATE_RECENT_ITEM,
-				   TAG_MIME_TYPE, TAG_RECENT_ITEM, error)) {
-			push_state (info, STATE_MIME_TYPE);
-		}
-	} else if (ELEMENT_IS (TAG_TIMESTAMP)) {
-		if (valid_element (info, STATE_RECENT_ITEM,
-				   TAG_TIMESTAMP, TAG_RECENT_ITEM, error)) {
-			push_state (info, STATE_TIMESTAMP);
-		}
-	} else if (ELEMENT_IS (TAG_PRIVATE)) {
-		if (valid_element (info, STATE_RECENT_ITEM,
-				   TAG_PRIVATE, TAG_RECENT_ITEM, error)) {
-			push_state (info, STATE_PRIVATE);
-			egg_recent_item_set_private (info->current_item, TRUE);
-		}
-	} else if (ELEMENT_IS (TAG_GROUPS)) {
-		if (valid_element (info, STATE_RECENT_ITEM,
-				   TAG_GROUPS, TAG_RECENT_ITEM, error)) {
-			push_state (info, STATE_GROUPS);
-		}
-	} else if (ELEMENT_IS (TAG_GROUP)) {
-		if (valid_element (info, STATE_GROUPS,
-				   TAG_GROUP, TAG_GROUPS, error)) {
-			push_state (info, STATE_GROUP);
-		}
-	}
-}
-
-static gint
-list_compare_func_mru (gpointer a, gpointer b)
-{
-	EggRecentItem *item_a = (EggRecentItem *)a;
-	EggRecentItem *item_b = (EggRecentItem *)b;
-
-	return item_a->timestamp < item_b->timestamp;
-}
-
-static gint
-list_compare_func_lru (gpointer a, gpointer b)
-{
-	EggRecentItem *item_a = (EggRecentItem *)a;
-	EggRecentItem *item_b = (EggRecentItem *)b;
-
-	return item_a->timestamp > item_b->timestamp;
-}
-
-
-
-static void
-end_element_handler (GMarkupParseContext *context,
-			    const gchar *element_name,
-			    gpointer user_data,
-			    GError **error)
-{
-	ParseInfo *info = (ParseInfo *)user_data;
-
-	switch (peek_state (info)) {
-		case STATE_RECENT_ITEM:
-			if (!info->current_item) {
-				g_warning ("No recent item found\n");
-				break;
-			}
-
-			if (!info->current_item->uri) {
-				g_warning ("Invalid item found\n");
-				break;
-			}
-				
-			info->items = g_list_prepend (info->items,
-			                              info->current_item);
-			info->current_item = NULL;
-			break;
-		default:
-			break;
-	}
-
-	pop_state (info);
-}
-
-static void
-text_handler (GMarkupParseContext *context,
-		     const gchar *text,
-		     gsize text_len,
-		     gpointer user_data,
-		     GError **error)
-{
-	ParseInfo *info = (ParseInfo *)user_data;
-	gchar *value;
-
-	value = g_strndup (text, text_len);
-
-	switch (peek_state (info)) {
-		case STATE_START:
-		case STATE_RECENT_FILES:
-		case STATE_RECENT_ITEM:
-		case STATE_PRIVATE:
-		case STATE_GROUPS:
-		break;
-		case STATE_URI:
-			egg_recent_item_set_uri (info->current_item, value);
-		break;
-		case STATE_MIME_TYPE:
-			egg_recent_item_set_mime_type (info->current_item, value);
-		break;
-		case STATE_TIMESTAMP:
-			egg_recent_item_set_timestamp (info->current_item,
-							 (time_t)atoi (value));
-		break;
-		case STATE_GROUP:
-			egg_recent_item_add_group (info->current_item,
-						     text);
-		break;
-	}
-
-	g_free (value);
-}
-
-static void
-error_handler (GMarkupParseContext *context,
-		      GError *error,
-		      gpointer user_data)
-{
-	g_warning ("Error in parse: %s", error->message);
-}
-
-static void
-egg_recent_model_enforce_limit (GList *list, int limit)
-{
-	int len;
-	GList *end;
-
-	/* limit < 0 means unlimited */
-	if (limit <= 0)
-		return;
-
-	len = g_list_length (list);
-
-	if (len > limit) {
-		GList *next;
-
-		end = g_list_nth (list, limit-1);
-		next = end->next;
-
-		end->next = NULL;
-
-		EGG_RECENT_ITEM_LIST_UNREF (next);
-	}
-}
-
-static GList *
-egg_recent_model_sort (EggRecentModel *model, GList *list)
-{
-	switch (model->priv->sort_type) {
-		case EGG_RECENT_MODEL_SORT_MRU:
-			list = g_list_sort (list,
-					(GCompareFunc)list_compare_func_mru);	
-		break;
-		case EGG_RECENT_MODEL_SORT_LRU:
-			list = g_list_sort (list,
-					(GCompareFunc)list_compare_func_lru);
-		break;
-		case EGG_RECENT_MODEL_SORT_NONE:
-		break;
-	}
-
-	return list;
-}
-
-static gboolean
-egg_recent_model_group_match (EggRecentItem *item, GSList *groups)
-{
-	GSList *tmp;
-
-	tmp = groups;
-
-	while (tmp != NULL) {
-		const gchar * group = (const gchar *)tmp->data;
-
-		if (egg_recent_item_in_group (item, group))
-			return TRUE;
-
-		tmp = tmp->next;
-	}
-
-	return FALSE;
-}
-
-static GList *
-egg_recent_model_filter (EggRecentModel *model, GList *list)
-{
-	GList *newlist = NULL;
-	GList *l;
-	gchar *mime_type;
-	gchar *uri;
-
-	g_return_val_if_fail (list != NULL, NULL);
-
-	for (l = list; l != NULL ; l = l->next) {
-		EggRecentItem *item = (EggRecentItem *) l->data;
-		gboolean pass_mime_test = FALSE;
-		gboolean pass_group_test = FALSE;
-		gboolean pass_scheme_test = FALSE;
-
-		g_assert (item != NULL);
-		
-		uri = egg_recent_item_get_uri (item);
-
-		/* filter by mime type */
-		if (model->priv->mime_filter_values != NULL) {
-			mime_type = egg_recent_item_get_mime_type (item);
-
-			if (egg_recent_model_string_match
-					(model->priv->mime_filter_values,
-					 mime_type))
-				pass_mime_test = TRUE;
-
-			g_free (mime_type);
-		} else
-			pass_mime_test = TRUE;
-
-		/* filter by group */
-		if (pass_mime_test && model->priv->group_filter_values != NULL) {
-			if (egg_recent_model_group_match
-					(item, model->priv->group_filter_values))
-				pass_group_test = TRUE;
-		} else if (egg_recent_item_get_private (item)) {
-			pass_group_test = FALSE;
-		} else
-			pass_group_test = TRUE;
-
-		/* filter by URI scheme */
-		if (pass_mime_test && pass_group_test &&
-		    model->priv->scheme_filter_values != NULL) {
-			gchar *scheme;
-			
-			scheme = gnome_vfs_get_uri_scheme (uri);
-
-			if (egg_recent_model_string_match
-				(model->priv->scheme_filter_values, scheme))
-				pass_scheme_test = TRUE;
-
-			g_free (scheme);
-		} else
-			pass_scheme_test = TRUE;
-
-		if (pass_mime_test && pass_group_test && pass_scheme_test)
-			newlist = g_list_prepend (newlist, item);
-		else
-			egg_recent_item_unref (item);
-
-		g_free (uri);
-	}
-
-	g_list_free (list);
-
-	return g_list_reverse (newlist);
-}
-
-
-
-#if 0
-static void
-egg_recent_model_monitor_list_cb (GnomeVFSMonitorHandle *handle,
-			       const gchar *monitor_uri,
-			       const gchar *info_uri,
-			       GnomeVFSMonitorEventType event_type,
-			       gpointer user_data)
-{
-	EggRecentModel *model;
-
-	model = EGG_RECENT_MODEL (user_data);
-
-	if (event_type == GNOME_VFS_MONITOR_EVENT_DELETED) {
-		egg_recent_model_delete (model, monitor_uri);
-		g_hash_table_remove (model->priv->monitors, monitor_uri);
-	}
-}
-
-
-
-static void
-egg_recent_model_monitor_list (EggRecentModel *model, GList *list)
-{
-	GList *tmp;
-
-	tmp = list;
-	while (tmp) {
-		EggRecentItem *item = (EggRecentItem *)tmp->data;
-		GnomeVFSMonitorHandle *handle;
-		GnomeVFSResult res;
-		gchar *uri;
-
-		tmp = tmp->next;
-		
-		uri = egg_recent_item_get_uri (item);
-		if (g_hash_table_lookup (model->priv->monitors, uri)) {
-			/* already monitoring this one */
-			g_free (uri);
-			continue;
-		}
-
-		res = gnome_vfs_monitor_add (&handle, uri,
-					     GNOME_VFS_MONITOR_FILE,
-					     egg_recent_model_monitor_list_cb,
-					     model);
-		
-		if (res == GNOME_VFS_OK)
-			g_hash_table_insert (model->priv->monitors, uri, handle);
-		else
-			g_free (uri);
-	}
-}
-#endif
-
-
-static gboolean
-egg_recent_model_changed_timeout (EggRecentModel *model)
-{
-	model->priv->changed_timeout = 0;
-
-	egg_recent_model_changed (model);
-
-	return FALSE;
-}
-
-static void
-egg_recent_model_monitor_cb (GnomeVFSMonitorHandle *handle,
-			       const gchar *monitor_uri,
-			       const gchar *info_uri,
-			       GnomeVFSMonitorEventType event_type,
-			       gpointer user_data)
-{
-	EggRecentModel *model;
-
-	g_return_if_fail (user_data != NULL);
-	g_return_if_fail (EGG_IS_RECENT_MODEL (user_data));
-	model = EGG_RECENT_MODEL (user_data);
-
-	if (event_type == GNOME_VFS_MONITOR_EVENT_CHANGED ||
-	    event_type == GNOME_VFS_MONITOR_EVENT_CREATED ||
-	    event_type == GNOME_VFS_MONITOR_EVENT_DELETED) {
-		if (model->priv->changed_timeout > 0) {
-			g_source_remove (model->priv->changed_timeout);
-		}
-
-		model->priv->changed_timeout = g_timeout_add (
-			EGG_RECENT_MODEL_TIMEOUT_LENGTH,
-			(GSourceFunc)egg_recent_model_changed_timeout,
-			model);
-	}
-}
-
-static gboolean
-egg_recent_model_poll_timeout (gpointer user_data)
-{
-	EggRecentModel *model;
-	struct stat stat_buf;
-	int stat_res;
-
-	model = EGG_RECENT_MODEL (user_data);
-	stat_res = stat (model->priv->path, &stat_buf);
-
-	if (!stat_res && stat_buf.st_mtime &&  
-	    stat_buf.st_mtime != model->priv->last_mtime) {
-		model->priv->last_mtime = stat_buf.st_mtime;
-		
-		if (model->priv->changed_timeout > 0)
-			g_source_remove (model->priv->changed_timeout);
-		
-		model->priv->changed_timeout = g_timeout_add (
-			EGG_RECENT_MODEL_TIMEOUT_LENGTH,
-			(GSourceFunc)egg_recent_model_changed_timeout,
-			model);
-	}
-	return TRUE;
-}
-
-static void
-egg_recent_model_monitor (EggRecentModel *model, gboolean should_monitor)
-{
-	if (should_monitor && model->priv->monitor == NULL) {
-		char *uri;
-		GnomeVFSResult result;
-
-		uri = gnome_vfs_get_uri_from_local_path (model->priv->path);
-
-		result = gnome_vfs_monitor_add (&model->priv->monitor,
-				       		uri,
-				       		GNOME_VFS_MONITOR_FILE,
-				       		egg_recent_model_monitor_cb,
-				       		model);
-
-		g_free (uri);
-
-		/* if the above fails, don't worry about it.
-		 * local notifications will still happen
-		 */
-		if (result == GNOME_VFS_ERROR_NOT_SUPPORTED) {
-			if (model->priv->poll_timeout > 0)
-				g_source_remove (model->priv->poll_timeout);
-			
-			model->priv->poll_timeout = g_timeout_add (
-				EGG_RECENT_MODEL_POLL_TIME * 1000,
-				egg_recent_model_poll_timeout,
-				model);
-		}
-
-	} else if (!should_monitor && model->priv->monitor != NULL) {
-		gnome_vfs_monitor_cancel (model->priv->monitor);
-		model->priv->monitor = NULL;
-	}
-}
-
-static void
-egg_recent_model_set_limit_internal (EggRecentModel *model, int limit)
-{
-	model->priv->limit = limit;
-
-	if (limit <= 0)
-		egg_recent_model_monitor (model, FALSE);
-	else {
-		egg_recent_model_monitor (model, TRUE);
-		egg_recent_model_changed (model);
-	}
-}
-
-static GList *
-egg_recent_model_read (EggRecentModel *model, FILE *file)
-{
-	GList *list=NULL;
-	gchar *content;
-	GMarkupParseContext *ctx;
-	ParseInfo *info;
-	GError *error;
-
-	content = egg_recent_model_read_raw (model, file);
-
-	if (strlen (content) <= 0) {
-		g_free (content);
-		return NULL;
-	}
-
-	info = parse_info_init ();
-	
-	ctx = g_markup_parse_context_new (&parser, 0, info, NULL);
-	
-	error = NULL;
-	if (!g_markup_parse_context_parse (ctx, content, strlen (content), &error)) {
-		g_warning ("Error while parsing the .recently-used file: %s\n",
-			   error->message);
-		
-		g_error_free (error);
-		parse_info_free (info);
-
-		return NULL;
-	}
-
-	error = NULL;
-	if (!g_markup_parse_context_end_parse (ctx, &error)) {
-		g_warning ("Unable to complete parsing of the .recently-used file: %s\n",
-			   error->message);
-		
-		g_error_free (error);
-		g_markup_parse_context_free (ctx);
-		parse_info_free (info);
-
-		return NULL;
-	}
-	
-	list = g_list_reverse (info->items);
-
-	g_markup_parse_context_free (ctx);
-	parse_info_free (info);
-	g_free (content);
-
-	return list;
-}
-
-
-static gboolean
-egg_recent_model_write (EggRecentModel *model, FILE *file, GList *list)
-{
-	GString *string;
-	gchar *data;
-	EggRecentItem *item;
-	const GList *groups;
-	int i;
-	int ret;
-	
-	string = g_string_new ("<?xml version=\"1.0\"?>\n");
-	string = g_string_append (string, "<" TAG_RECENT_FILES ">\n");
-
-	i=0;
-	while (list) {
-		gchar *uri;
-		gchar *mime_type;
-		gchar *escaped_uri;
-		time_t timestamp;
-		item = (EggRecentItem *)list->data;
-
-
-		uri = egg_recent_item_get_uri_utf8 (item);
-		escaped_uri = g_markup_escape_text (uri,
-						    strlen (uri));
-		g_free (uri);
-
-		mime_type = egg_recent_item_get_mime_type (item);
-		timestamp = egg_recent_item_get_timestamp (item);
-		
-		string = g_string_append (string, "  <" TAG_RECENT_ITEM ">\n");
-
-		g_string_append_printf (string,
-				"    <" TAG_URI ">%s</" TAG_URI ">\n", escaped_uri);
-
-		if (mime_type)
-			g_string_append_printf (string,
-				"    <" TAG_MIME_TYPE ">%s</" TAG_MIME_TYPE ">\n", mime_type);
-		else
-			g_string_append_printf (string,
-				"    <" TAG_MIME_TYPE "></" TAG_MIME_TYPE ">\n");
-
-		
-		g_string_append_printf (string,
-				"    <" TAG_TIMESTAMP ">%d</" TAG_TIMESTAMP ">\n", (int)timestamp);
-
-		if (egg_recent_item_get_private (item))
-			string = g_string_append (string,
-					"    <" TAG_PRIVATE "/>\n");
-
-		/* write the groups */
-		string = g_string_append (string,
-				"    <" TAG_GROUPS ">\n");
-		groups = egg_recent_item_get_groups (item);
-
-		if (groups == NULL && egg_recent_item_get_private (item))
-			g_warning ("Item with URI \"%s\" marked as private, but"
-				   " does not belong to any groups.\n", uri);
-		
-		while (groups) {
-			const gchar *group = (const gchar *)groups->data;
-			gchar *escaped_group;
-
-			escaped_group = g_markup_escape_text (group, strlen(group));
-
-			g_string_append_printf (string,
-					"      <" TAG_GROUP ">%s</" TAG_GROUP ">\n",
-					escaped_group);
-
-			g_free (escaped_group);
-
-			groups = groups->next;
-		}
-		
-		string = g_string_append (string, "    </" TAG_GROUPS ">\n");
-
-		string = g_string_append (string,
-				"  </" TAG_RECENT_ITEM ">\n");
-
-		g_free (mime_type);
-		g_free (escaped_uri);
-
-		list = list->next;
-		i++;
-	}
-
-	string = g_string_append (string, "</" TAG_RECENT_FILES ">");
-
-	data = g_string_free (string, FALSE);
-
-	ret = egg_recent_model_write_raw (model, file, data);
-
-	g_free (data);
-
-	return ret;
-}
-
-static FILE *
-egg_recent_model_open_file (EggRecentModel *model,
-			    gboolean        for_writing)
-{
-	FILE *file;
-	mode_t prev_umask;
-	
-	file = fopen (model->priv->path, "r+");
-	if (file == NULL && for_writing) {
-		/* be paranoid */
-		prev_umask = umask (077);
-
-		file = fopen (model->priv->path, "w+");
-
-		umask (prev_umask);
-
-		g_return_val_if_fail (file != NULL, NULL);
-	}
-
-	return file;
-}
-
-static gboolean
-egg_recent_model_lock_file (FILE *file)
-{
-#ifdef HAVE_LOCKF
-	int fd;
-	gint	try = 5;
-
-	rewind (file);
-	fd = fileno (file);
-
-	/* Attempt to lock the file 5 times,
-	 * waiting a random interval (< 1 second) 
-	 * in between attempts.
-	 * We should really be doing asynchronous
-	 * locking, but requires substantially larger
-	 * changes.
-	 */
-	
-	while (try > 0)
-	{
-		int rand_interval;
-
-		if (lockf (fd, F_TLOCK, 0) == 0)
-			return TRUE;
-
-		rand_interval = 1 + (int) (10.0 * rand()/(RAND_MAX + 1.0));
-			 
-           	g_usleep (100000 * rand_interval);
-
-		--try;
-	}
-
-	return FALSE;
-#else
-	return TRUE;
-#endif /* HAVE_LOCKF */
-}
-
-static gboolean
-egg_recent_model_unlock_file (FILE *file)
-{
-#ifdef HAVE_LOCKF
-	int fd;
-
-	rewind (file);
-	fd = fileno (file);
-
-	return (lockf (fd, F_ULOCK, 0) == 0) ? TRUE : FALSE;
-#else
-	return TRUE;
-#endif /* HAVE_LOCKF */
-}
-
-static void
-egg_recent_model_finalize (GObject *object)
-{
-	EggRecentModel *model = EGG_RECENT_MODEL (object);
-
-	if (model->priv->changed_timeout > 0) {
-		g_source_remove (model->priv->changed_timeout);
-	}
-
-	egg_recent_model_monitor (model, FALSE);
-
-
-	g_slist_foreach (model->priv->mime_filter_values,
-			 (GFunc) g_pattern_spec_free, NULL);
-	g_slist_free (model->priv->mime_filter_values);
-	model->priv->mime_filter_values = NULL;
-
-	g_slist_foreach (model->priv->scheme_filter_values,
-			 (GFunc) g_pattern_spec_free, NULL);
-	g_slist_free (model->priv->scheme_filter_values);
-	model->priv->scheme_filter_values = NULL;
-
-	g_slist_foreach (model->priv->group_filter_values,
-			 (GFunc) g_free, NULL);
-	g_slist_free (model->priv->group_filter_values);
-	model->priv->group_filter_values = NULL;
-
-
-	if (model->priv->limit_change_notify_id)
-		gconf_client_notify_remove (model->priv->client,
-					    model->priv->limit_change_notify_id);
-	model->priv->expiration_change_notify_id = 0;
-
-	if (model->priv->expiration_change_notify_id)
-		gconf_client_notify_remove (model->priv->client,
-					    model->priv->expiration_change_notify_id);
-	model->priv->expiration_change_notify_id = 0;
-
-	g_object_unref (model->priv->client);
-	model->priv->client = NULL;
-
-
-	g_free (model->priv->path);
-	model->priv->path = NULL;
-	
-	g_hash_table_destroy (model->priv->monitors);
-	model->priv->monitors = NULL;
-
-	if (model->priv->poll_timeout > 0)
-		g_source_remove (model->priv->poll_timeout);
-	model->priv->poll_timeout =0;
-
-	g_free (model->priv);
-
-	parent_class->finalize (object);
-}
-
-static void
-egg_recent_model_set_property (GObject *object,
-			       guint prop_id,
-			       const GValue *value,
-			       GParamSpec *pspec)
-{
-	EggRecentModel *model = EGG_RECENT_MODEL (object);
-
-	switch (prop_id)
-	{
-		case PROP_MIME_FILTERS:
-			if (model->priv->mime_filter_values != NULL)
-				egg_recent_model_clear_mime_filter (model);
-			
-			model->priv->mime_filter_values =
-				(GSList *)g_value_get_pointer (value);
-		break;
-
-		case PROP_GROUP_FILTERS:
-			if (model->priv->group_filter_values != NULL)
-				egg_recent_model_clear_group_filter (model);
-			
-			model->priv->group_filter_values =
-				(GSList *)g_value_get_pointer (value);
-		break;
-
-		case PROP_SCHEME_FILTERS:
-			if (model->priv->scheme_filter_values != NULL)
-				egg_recent_model_clear_scheme_filter (model);
-			
-			model->priv->scheme_filter_values =
-				(GSList *)g_value_get_pointer (value);
-		break;
-
-		case PROP_SORT_TYPE:
-			model->priv->sort_type = g_value_get_int (value);
-		break;
-
-		case PROP_LIMIT:
-			egg_recent_model_set_limit (model,
-						g_value_get_int (value));
-		break;
-
-		default:
-			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-		break;
-	}
-}
-
-static void
-egg_recent_model_get_property (GObject *object,
-			       guint prop_id,
-			       GValue *value,
-			       GParamSpec *pspec)
-{
-	EggRecentModel *model = EGG_RECENT_MODEL (object);
-
-	switch (prop_id)
-	{
-		case PROP_MIME_FILTERS:
-			g_value_set_pointer (value, model->priv->mime_filter_values);
-		break;
-
-		case PROP_GROUP_FILTERS:
-			g_value_set_pointer (value, model->priv->group_filter_values);
-		break;
-
-		case PROP_SCHEME_FILTERS:
-			g_value_set_pointer (value, model->priv->scheme_filter_values);
-		break;
-
-		case PROP_SORT_TYPE:
-			g_value_set_int (value, model->priv->sort_type);
-		break;
-
-		case PROP_LIMIT:
-			g_value_set_int (value, model->priv->limit);
-		break;
-
-		default:
-			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-		break;
-	}
-}
-
-static void
-egg_recent_model_class_init (EggRecentModelClass * klass)
-{
-	GObjectClass *object_class;
-
-	parent_class = g_type_class_peek_parent (klass);
-
-	parent_class = g_type_class_peek_parent (klass);
-
-	object_class = G_OBJECT_CLASS (klass);
-	object_class->set_property = egg_recent_model_set_property;
-	object_class->get_property = egg_recent_model_get_property;
-	object_class->finalize     = egg_recent_model_finalize;
-
-	model_signals[CHANGED] = g_signal_new ("changed",
-			G_OBJECT_CLASS_TYPE (object_class),
-			G_SIGNAL_RUN_LAST,
-			G_STRUCT_OFFSET (EggRecentModelClass, changed),
-			NULL, NULL,
-			g_cclosure_marshal_VOID__POINTER,
-			G_TYPE_NONE, 1,
-			G_TYPE_POINTER);
-
-	
-	g_object_class_install_property (object_class,
-					 PROP_MIME_FILTERS,
-					 g_param_spec_pointer ("mime-filters",
-					 "Mime Filters",
-					 "List of mime types to be allowed.",
-					 G_PARAM_READWRITE));
-	
-	g_object_class_install_property (object_class,
-					 PROP_GROUP_FILTERS,
-					 g_param_spec_pointer ("group-filters",
-					 "Group Filters",
-					 "List of groups to be allowed.",
-					 G_PARAM_READWRITE));
-
-	g_object_class_install_property (object_class,
-					 PROP_SCHEME_FILTERS,
-					 g_param_spec_pointer ("scheme-filters",
-					 "Scheme Filters",
-					 "List of URI schemes to be allowed.",
-					 G_PARAM_READWRITE));
-
-	g_object_class_install_property (object_class,
-					 PROP_SORT_TYPE,
-					 g_param_spec_int ("sort-type",
-					 "Sort Type",
-					 "Type of sorting to be done.",
-					 0, EGG_RECENT_MODEL_SORT_NONE,
-					 EGG_RECENT_MODEL_SORT_MRU,
-					 G_PARAM_READWRITE));
-
-	g_object_class_install_property (object_class,
-					 PROP_LIMIT,
-					 g_param_spec_int ("limit",
-					 "Limit",
-					 "Max number of items allowed.",
-					 -1, EGG_RECENT_MODEL_MAX_ITEMS,
-					 EGG_RECENT_MODEL_DEFAULT_LIMIT,
-					 G_PARAM_READWRITE));
-
-	klass->changed = NULL;
-}
-
-
-
-static void
-egg_recent_model_limit_changed (GConfClient *client, guint cnxn_id,
-				GConfEntry *entry, gpointer user_data)
-{
-	EggRecentModel *model;
-	GConfValue *value;
-
-	model = EGG_RECENT_MODEL (user_data);
-
-	g_return_if_fail (model != NULL);
-
-	if (model->priv->use_default_limit == FALSE)
-		return; /* ignore this key */
-
-	/* the key was unset, and the schema has apparently failed */
-	if (entry == NULL)
-		return;
-
-	value = gconf_entry_get_value (entry);
-
-	if (value->type != GCONF_VALUE_INT) {
-		g_warning ("Expected GConfValue of type integer, "
-			   "got something else");
-	}
-
-
-	egg_recent_model_set_limit_internal (model, gconf_value_get_int (value));
-}
-
-static void
-egg_recent_model_expiration_changed (GConfClient *client, guint cnxn_id,
-				     GConfEntry *entry, gpointer user_data)
-{
-
-}
-
-static void
-egg_recent_model_init (EggRecentModel * model)
-{
-	if (!gnome_vfs_init ()) {
-		g_warning ("gnome-vfs initialization failed.");
-		return;
-	}
-	
-
-	model->priv = g_new0 (EggRecentModelPrivate, 1);
-
-	model->priv->path = g_strdup_printf ("%s" EGG_RECENT_MODEL_FILE_PATH,
-					     g_get_home_dir ());
-
-	model->priv->mime_filter_values   = NULL;
-	model->priv->group_filter_values  = NULL;
-	model->priv->scheme_filter_values = NULL;
-	
-	model->priv->client = gconf_client_get_default ();
-	gconf_client_add_dir (model->priv->client, EGG_RECENT_MODEL_KEY_DIR,
-			      GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-
-	model->priv->limit_change_notify_id =
-			gconf_client_notify_add (model->priv->client,
-						 EGG_RECENT_MODEL_DEFAULT_LIMIT_KEY,
-						 egg_recent_model_limit_changed,
-						 model, NULL, NULL);
-
-	model->priv->expiration_change_notify_id =
-			gconf_client_notify_add (model->priv->client,
-						 EGG_RECENT_MODEL_EXPIRE_KEY,
-						 egg_recent_model_expiration_changed,
-						 model, NULL, NULL);
-
-	model->priv->expire_days = gconf_client_get_int (
-					model->priv->client,
-					EGG_RECENT_MODEL_EXPIRE_KEY,
-					NULL);
-					
-#if 0
-	/* keep this out, for now */
-	model->priv->limit = gconf_client_get_int (
-					model->priv->client,
-					EGG_RECENT_MODEL_DEFAULT_LIMIT_KEY, NULL);
-	model->priv->use_default_limit = TRUE;
-#endif
-	model->priv->limit = EGG_RECENT_MODEL_DEFAULT_LIMIT;
-	model->priv->use_default_limit = FALSE;
-
-	model->priv->monitors = g_hash_table_new_full (
-					g_str_hash, g_str_equal,
-					(GDestroyNotify) g_free,
-					(GDestroyNotify) gnome_vfs_monitor_cancel);
-
-	model->priv->monitor = NULL;
-	model->priv->poll_timeout = 0;
-	model->priv->last_mtime = 0;
-	egg_recent_model_monitor (model, TRUE);
-}
-
-
-/**
- * egg_recent_model_new:
- * @sort:  the type of sorting to use
- * @limit:  maximum number of items in the list
- *
- * This creates a new EggRecentModel object.
- *
- * Returns: a EggRecentModel object
- */
-EggRecentModel *
-egg_recent_model_new (EggRecentModelSort sort)
-{
-	EggRecentModel *model;
-
-	model = EGG_RECENT_MODEL (g_object_new (egg_recent_model_get_type (),
-				  "sort-type", sort, NULL));
-
-	g_return_val_if_fail (model, NULL);
-
-	return model;
-}
-
-/**
- * egg_recent_model_add_full:
- * @model:  A EggRecentModel object.
- * @item:  A EggRecentItem
- *
- * This function adds an item to the list of recently used URIs.
- *
- * Returns: gboolean
- */
-gboolean
-egg_recent_model_add_full (EggRecentModel * model, EggRecentItem *item)
-{
-	FILE *file;
-	GList *list = NULL;
-	gboolean ret = FALSE;
-	gboolean updated = FALSE;
-	char *uri;
-	time_t t;
-	
-	g_return_val_if_fail (model != NULL, FALSE);
-	g_return_val_if_fail (EGG_IS_RECENT_MODEL (model), FALSE);
-
-	uri = egg_recent_item_get_uri (item);
-	if (strncmp (uri, "recent-files://", strlen ("recent-files://")) == 0) {
-		g_free (uri);
-		return FALSE;
-	} else {
-		g_free (uri);
-	}
-
-	file = egg_recent_model_open_file (model, TRUE);
-	g_return_val_if_fail (file != NULL, FALSE);
-
-	time (&t);
-	egg_recent_item_set_timestamp (item, t);
-
-	if (egg_recent_model_lock_file (file)) {
-
-		/* read existing stuff */
-		list = egg_recent_model_read (model, file);
-
-		/* if it's already there, we just update it */
-		updated = egg_recent_model_update_item (list, item);
-
-		if (!updated) {
-			list = g_list_prepend (list, item);
-
-			egg_recent_model_enforce_limit (list,
-						EGG_RECENT_MODEL_MAX_ITEMS);
-		}
-
-		/* write new stuff */
-		if (!egg_recent_model_write (model, file, list))
-			g_warning ("Write failed: %s", strerror (errno));
-
-		if (!updated)
-			list = g_list_remove (list, item);
-
-		EGG_RECENT_ITEM_LIST_UNREF (list);
-		ret = TRUE;
-	} else {
-		g_warning ("Failed to lock:  %s", strerror (errno));
-		fclose (file);
-		return FALSE;
-	}
-
-	if (!egg_recent_model_unlock_file (file))
-		g_warning ("Failed to unlock: %s", strerror (errno));
-
-	fclose (file);
-
-	if (model->priv->monitor == NULL) {
-		/* since monitoring isn't working, at least give a
-		 * local notification
-		 */
-		egg_recent_model_changed (model);
-	}
-
-	return ret;
-}
-
-/**
- * egg_recent_model_add:
- * @model:  A EggRecentModel object.
- * @uri:  A string URI
- *
- * This function adds an item to the list of recently used URIs.
- *
- * Returns: gboolean
- */
-gboolean
-egg_recent_model_add (EggRecentModel *model, const gchar *uri)
-{
-	EggRecentItem *item;
-	gboolean ret = FALSE;
-
-	g_return_val_if_fail (model != NULL, FALSE);
-	g_return_val_if_fail (uri != NULL, FALSE);
-
-	item = egg_recent_item_new_from_uri (uri);
-
-	g_return_val_if_fail (item != NULL, FALSE);
-
-	ret = egg_recent_model_add_full (model, item);
-
-	egg_recent_item_unref (item);
-
-	return ret;
-}
-
-
-
-/**
- * egg_recent_model_delete:
- * @model:  A EggRecentModel object.
- * @uri: The URI you want to delete.
- *
- * This function deletes a URI from the file of recently used URIs.
- *
- * Returns: gboolean
- */
-gboolean
-egg_recent_model_delete (EggRecentModel * model, const gchar * uri)
-{
-	FILE *file;
-	GList *list;
-	unsigned int length;
-	gboolean ret = FALSE;
-
-	g_return_val_if_fail (model != NULL, FALSE);
-	g_return_val_if_fail (EGG_IS_RECENT_MODEL (model), FALSE);
-	g_return_val_if_fail (uri != NULL, FALSE);
-
-	file = egg_recent_model_open_file (model, TRUE);
-	g_return_val_if_fail (file != NULL, FALSE);
-
-	if (egg_recent_model_lock_file (file)) {
-		list = egg_recent_model_read (model, file);
-
-		if (list == NULL)
-			goto out;
-
-		length = g_list_length (list);
-
-		list = egg_recent_model_delete_from_list (list, uri);
-		
-		if (length == g_list_length (list)) {
-			/* nothing was deleted */
-			EGG_RECENT_ITEM_LIST_UNREF (list);
-		} else {
-			egg_recent_model_write (model, file, list);
-			EGG_RECENT_ITEM_LIST_UNREF (list);
-			ret = TRUE;
-
-		}
-	} else {
-		g_warning ("Failed to lock:  %s", strerror (errno));
-		return FALSE;
-	}
-
-out:
-		
-	if (!egg_recent_model_unlock_file (file))
-		g_warning ("Failed to unlock: %s", strerror (errno));
-
-	fclose (file);
-
-	g_hash_table_remove (model->priv->monitors, uri);
-
-	if (model->priv->monitor == NULL && ret) {
-		/* since monitoring isn't working, at least give a
-		 * local notification
-		 */
-		egg_recent_model_changed (model);
-	}
-
-	return ret;
-}
-
-
-/**
- * egg_recent_model_get_list:
- * @model:  A EggRecentModel object.
- *
- * This function gets the current contents of the file
- *
- * Returns: a GList
- */
-GList *
-egg_recent_model_get_list (EggRecentModel *model)
-{
-	FILE *file;
-	GList *list = NULL;
-
-	file = egg_recent_model_open_file (model, FALSE);
-	if (file == NULL)
-		return NULL;
-	
-	if (egg_recent_model_lock_file (file))
-		list = egg_recent_model_read (model, file);
-	else {
-		g_warning ("Failed to lock:  %s", strerror (errno));
-		fclose (file);
-		return NULL;
-	}
-
-	if (!egg_recent_model_unlock_file (file))
-		g_warning ("Failed to unlock: %s", strerror (errno));
-
-	if (list != NULL) {
-		list = egg_recent_model_filter (model, list);
-		list = egg_recent_model_sort (model, list);
-
-		egg_recent_model_enforce_limit (list, model->priv->limit);
-	}
-
-	fclose (file);
-
-	return list;
-}
-
-
-
-/**
- * egg_recent_model_set_limit:
- * @model:  A EggRecentModel object.
- * @limit:  The maximum length of the list
- *
- * This function sets the maximum length of the list.  Note:  This only affects
- * the length of the list emitted in the "changed" signal, not the list stored
- * on disk.
- *
- * Returns:  void
- */
-void
-egg_recent_model_set_limit (EggRecentModel *model, int limit)
-{
-	model->priv->use_default_limit = FALSE;
-
-	egg_recent_model_set_limit_internal (model, limit);
-}
-
-/**
- * egg_recent_model_get_limit:
- * @model:  A EggRecentModel object.
- *
- * This function gets the maximum length of the list. 
- *
- * Returns:  int
- */
-int
-egg_recent_model_get_limit (EggRecentModel *model)
-{
-	return model->priv->limit;
-}
-
-
-/**
- * egg_recent_model_clear:
- * @model:  A EggRecentModel object.
- *
- * This function clears the contents of the file
- *
- * Returns: void
- */
-void
-egg_recent_model_clear (EggRecentModel *model)
-{
-	FILE *file;
-	int fd;
-
-	file = egg_recent_model_open_file (model, TRUE);
-	g_return_if_fail (file != NULL);
-
-	fd = fileno (file);
-
-	if (egg_recent_model_lock_file (file)) {
-		ftruncate (fd, 0);
-	} else {
-		g_warning ("Failed to lock:  %s", strerror (errno));
-		return;
-	}
-
-	if (!egg_recent_model_unlock_file (file))
-		g_warning ("Failed to unlock: %s", strerror (errno));
-
-	fclose (file);
-	
-	if (model->priv->monitor == NULL) {
-		/* since monitoring isn't working, at least give a
-		 * local notification
-		 */
-		egg_recent_model_changed (model);
-	}
-}
-
-static void
-egg_recent_model_clear_mime_filter (EggRecentModel *model)
-{
-	g_return_if_fail (model != NULL);
-
-	if (model->priv->mime_filter_values != NULL) {
-		g_slist_foreach (model->priv->mime_filter_values,
-				 (GFunc) g_pattern_spec_free, NULL);
-		g_slist_free (model->priv->mime_filter_values);
-		model->priv->mime_filter_values = NULL;
-	}
-}	
-
-/**
- * egg_recent_model_set_filter_mime_types:
- * @model:  A EggRecentModel object.
- *
- * Sets which mime types are allowed in the list.
- *
- * Returns: void
- */
-void
-egg_recent_model_set_filter_mime_types (EggRecentModel *model,
-			       ...)
-{
-	va_list valist;
-	GSList *list = NULL;
-	gchar *str;
-
-	g_return_if_fail (model != NULL);
-
-	egg_recent_model_clear_mime_filter (model);
-
-	va_start (valist, model);
-
-	str = va_arg (valist, gchar*);
-
-	while (str != NULL) {
-		list = g_slist_prepend (list, g_pattern_spec_new (str));
-
-		str = va_arg (valist, gchar*);
-	}
-
-	va_end (valist);
-
-	model->priv->mime_filter_values = list;
-}
-
-static void
-egg_recent_model_clear_group_filter (EggRecentModel *model)
-{
-	g_return_if_fail (model != NULL);
-
-	if (model->priv->group_filter_values != NULL) {
-		g_slist_foreach (model->priv->group_filter_values, (GFunc)g_free, NULL);
-		g_slist_free (model->priv->group_filter_values);
-		model->priv->group_filter_values = NULL;
-	}
-}
-
-/**
- * egg_recent_model_set_filter_groups:
- * @model:  A EggRecentModel object.
- *
- * Sets which groups are allowed in the list.
- *
- * Returns: void
- */
-void
-egg_recent_model_set_filter_groups (EggRecentModel *model,
-			       ...)
-{
-	va_list valist;
-	GSList *list = NULL;
-	gchar *str;
-
-	g_return_if_fail (model != NULL);
-
-	egg_recent_model_clear_group_filter (model);
-	
-	va_start (valist, model);
-
-	str = va_arg (valist, gchar*);
-
-	while (str != NULL) {
-		list = g_slist_prepend (list, g_strdup (str));
-
-		str = va_arg (valist, gchar*);
-	}
-
-	va_end (valist);
-
-	model->priv->group_filter_values = list;
-}
-
-static void
-egg_recent_model_clear_scheme_filter (EggRecentModel *model)
-{
-	g_return_if_fail (model != NULL);
-
-	if (model->priv->scheme_filter_values != NULL) {
-		g_slist_foreach (model->priv->scheme_filter_values,
-				(GFunc) g_pattern_spec_free, NULL);
-		g_slist_free (model->priv->scheme_filter_values);
-		model->priv->scheme_filter_values = NULL;
-	}
-}
-
-/**
- * egg_recent_model_set_filter_uri_schemes:
- * @model:  A EggRecentModel object.
- *
- * Sets which URI schemes (file, http, ftp, etc) are allowed in the list.
- *
- * Returns: void
- */
-void
-egg_recent_model_set_filter_uri_schemes (EggRecentModel *model, ...)
-{
-	va_list valist;
-	GSList *list = NULL;
-	gchar *str;
-
-	g_return_if_fail (model != NULL);
-
-	egg_recent_model_clear_scheme_filter (model);
-	
-	va_start (valist, model);
-
-	str = va_arg (valist, gchar*);
-
-	while (str != NULL) {
-		list = g_slist_prepend (list, g_pattern_spec_new (str));
-
-		str = va_arg (valist, gchar*);
-	}
-
-	va_end (valist);
-
-	model->priv->scheme_filter_values = list;
-}
-
-/**
- * egg_recent_model_set_sort:
- * @model:  A EggRecentModel object.
- * @sort:  A EggRecentModelSort type
- *
- * Sets the type of sorting to be used.
- *
- * Returns: void
- */
-void
-egg_recent_model_set_sort (EggRecentModel *model,
-			     EggRecentModelSort sort)
-{
-	g_return_if_fail (model != NULL);
-	
-	model->priv->sort_type = sort;
-}
-
-/**
- * egg_recent_model_changed:
- * @model:  A EggRecentModel object.
- *
- * This function causes a "changed" signal to be emitted.
- *
- * Returns: void
- */
-void
-egg_recent_model_changed (EggRecentModel *model)
-{
-	GList *list = NULL;
-
-	if (model->priv->limit > 0) {
-		list = egg_recent_model_get_list (model);
-		/* egg_recent_model_monitor_list (model, list); */
-	
-		g_signal_emit (G_OBJECT (model), model_signals[CHANGED], 0,
-			       list);
-	}
-
-	if (list)
-		EGG_RECENT_ITEM_LIST_UNREF (list);
-}
-
-static void
-egg_recent_model_remove_expired_list (EggRecentModel *model, GList *list)
-{
-	time_t current_time;
-	time_t day_seconds;
-
-	time (&current_time);
-	day_seconds = model->priv->expire_days*24*60*60;
-
-	while (list != NULL) {
-		EggRecentItem *item = list->data;
-		time_t timestamp;
-
-		timestamp = egg_recent_item_get_timestamp (item);
-
-		if ((timestamp+day_seconds) < current_time) {
-			gchar *uri = egg_recent_item_get_uri (item);
-			egg_recent_model_delete (model, uri);
-
-			g_strdup (uri);
-		}
-
-		list = list->next;
-	}
-}
-
-
-/**
- * egg_recent_model_remove_expired:
- * @model:  A EggRecentModel object.
- *
- * Goes through the entire list, and removes any items that are older than
- * the user-specified expiration period.
- *
- * Returns: void
- */
-void
-egg_recent_model_remove_expired (EggRecentModel *model)
-{
-	FILE *file;
-	GList *list=NULL;
-
-	g_return_if_fail (model != NULL);
-
-	file = egg_recent_model_open_file (model, FALSE);
-	if (file == NULL)
-		return;
-	
-	if (egg_recent_model_lock_file (file)) {
-		list = egg_recent_model_read (model, file);
-		
-	} else {
-		g_warning ("Failed to lock:  %s", strerror (errno));
-		return;
-	}
-
-	if (!egg_recent_model_unlock_file (file))
-		g_warning ("Failed to unlock: %s", strerror (errno));
-
-	if (list != NULL) {
-		egg_recent_model_remove_expired_list (model, list);
-		EGG_RECENT_ITEM_LIST_UNREF (list);
-	}
-
-	fclose (file);
-}
-
-/**
- * egg_recent_model_get_type:
- *
- * This returns a GType representing a EggRecentModel object.
- *
- * Returns: a GType
- */
-GType
-egg_recent_model_get_type (void)
-{
-	static GType egg_recent_model_type = 0;
-
-	if(!egg_recent_model_type) {
-		static const GTypeInfo egg_recent_model_info = {
-			sizeof (EggRecentModelClass),
-			NULL, /* base init */
-			NULL, /* base finalize */
-			(GClassInitFunc)egg_recent_model_class_init, /* class init */
-			NULL, /* class finalize */
-			NULL, /* class data */
-			sizeof (EggRecentModel),
-			0,
-			(GInstanceInitFunc) egg_recent_model_init
-		};
-
-		egg_recent_model_type = g_type_register_static (G_TYPE_OBJECT,
-							"EggRecentModel",
-							&egg_recent_model_info, 0);
-	}
-
-	return egg_recent_model_type;
-}
-
diff --git a/libslab/egg-recent-model.h b/libslab/egg-recent-model.h
deleted file mode 100644
index ed4eb72..0000000
--- a/libslab/egg-recent-model.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef __EGG_RECENT_MODEL_H__
-#define __EGG_RECENT_MODEL_H__
-
-#include "egg-recent-item.h"
-
-#ifndef EGG_ENABLE_RECENT_FILES
-#error "EggRecent has been DEPRECATED by the new recent files code inside GTK 2.9.0.  Use EGG_ENABLE_RECENT_FILES to compile this code, but you are using it at your own risk."
-#endif
-
-G_BEGIN_DECLS
-
-#define EGG_TYPE_RECENT_MODEL		(egg_recent_model_get_type ())
-#define EGG_RECENT_MODEL(obj)		G_TYPE_CHECK_INSTANCE_CAST (obj, EGG_TYPE_RECENT_MODEL, EggRecentModel)
-#define EGG_RECENT_MODEL_CLASS(klass) 	G_TYPE_CHECK_CLASS_CAST (klass, EGG_TYPE_RECENT_MODEL, EggRecentModelClass)
-#define EGG_IS_RECENT_MODEL(obj)	G_TYPE_CHECK_INSTANCE_TYPE (obj, egg_recent_model_get_type ())
-
-typedef struct _EggRecentModel        EggRecentModel;
-typedef struct _EggRecentModelPrivate EggRecentModelPrivate;
-typedef struct _EggRecentModelClass   EggRecentModelClass;
-
-struct _EggRecentModel {
-	GObject                parent_instance;
-
-	EggRecentModelPrivate *priv;
-};
-
-struct _EggRecentModelClass {
-	GObjectClass parent_class;
-			
-	void (*changed) (EggRecentModel *model, GList *list);
-};
-
-typedef enum {
-	EGG_RECENT_MODEL_SORT_MRU,
-	EGG_RECENT_MODEL_SORT_LRU,
-	EGG_RECENT_MODEL_SORT_NONE
-} EggRecentModelSort;
-
-
-/* Standard group names */
-#define EGG_RECENT_GROUP_LAUNCHERS "Launchers"
-
-
-GType    egg_recent_model_get_type     (void);
-
-/* constructors */
-EggRecentModel * egg_recent_model_new (EggRecentModelSort sort);
-
-/* public methods */
-void     egg_recent_model_set_filter_mime_types (EggRecentModel *model,
-						   ...);
-
-void     egg_recent_model_set_filter_groups (EggRecentModel *model, ...);
-
-void     egg_recent_model_set_filter_uri_schemes (EggRecentModel *model,
-						   ...);
-
-void     egg_recent_model_set_sort (EggRecentModel *model,
-				      EggRecentModelSort sort);
-
-gboolean egg_recent_model_add_full (EggRecentModel *model,
-				      EggRecentItem *item);
-
-gboolean egg_recent_model_add	     (EggRecentModel *model,
-				      const gchar *uri);
-
-gboolean egg_recent_model_delete   (EggRecentModel *model,
-				      const gchar *uri);
-
-void egg_recent_model_clear        (EggRecentModel *model);
-
-GList * egg_recent_model_get_list  (EggRecentModel *model);
-
-void egg_recent_model_changed      (EggRecentModel *model);
-
-void egg_recent_model_set_limit    (EggRecentModel *model, int limit);
-int  egg_recent_model_get_limit    (EggRecentModel *model);
-
-void egg_recent_model_remove_expired (EggRecentModel *model);
-
-G_END_DECLS
-
-#endif /* __EGG_RECENT_MODEL_H__ */
diff --git a/libslab/libslab-bookmarkfile.c b/libslab/libslab-bookmarkfile.c
deleted file mode 100644
index 966599f..0000000
--- a/libslab/libslab-bookmarkfile.c
+++ /dev/null
@@ -1,3805 +0,0 @@
-/* gbookmarkfile.c: parsing and building desktop bookmarks
- *
- * Copyright (C) 2005-2006 Emmanuele Bassi
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- */
-
-#include "config.h"
-
-#include "libslab-bookmarkfile.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <locale.h>
-#include <time.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <glib.h>
-#include <glib/gi18n.h>
-
-/* XBEL 1.0 standard entities */
-#define XBEL_VERSION		"1.0"
-#define XBEL_DTD_NICK		"xbel"
-#define XBEL_DTD_SYSTEM		"+//IDN python.org//DTD XML Bookmark " \
-				"Exchange Language 1.0//EN//XML"
-
-#define XBEL_DTD_URI		"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd"
-
-#define XBEL_ROOT_ELEMENT	"xbel"
-#define XBEL_FOLDER_ELEMENT	"folder" 	/* unused */
-#define XBEL_BOOKMARK_ELEMENT	"bookmark"
-#define XBEL_ALIAS_ELEMENT	"alias"		/* unused */
-#define XBEL_SEPARATOR_ELEMENT	"separator" 	/* unused */
-#define XBEL_TITLE_ELEMENT	"title"
-#define XBEL_DESC_ELEMENT	"desc"
-#define XBEL_INFO_ELEMENT	"info"
-#define XBEL_METADATA_ELEMENT	"metadata"
-
-#define XBEL_VERSION_ATTRIBUTE	"version"
-#define XBEL_FOLDED_ATTRIBUTE	"folded" 	/* unused */
-#define XBEL_OWNER_ATTRIBUTE	"owner"
-#define XBEL_ADDED_ATTRIBUTE	"added"
-#define XBEL_VISITED_ATTRIBUTE	"visited"
-#define XBEL_MODIFIED_ATTRIBUTE "modified"
-#define XBEL_ID_ATTRIBUTE	"id"
-#define XBEL_HREF_ATTRIBUTE	"href"
-#define XBEL_REF_ATTRIBUTE	"ref" 		/* unused */
-
-#define XBEL_YES_VALUE		"yes"
-#define XBEL_NO_VALUE		"no"
-
-/* Desktop bookmark spec entities */
-#define BOOKMARK_METADATA_OWNER 	"http://freedesktop.org"
-
-#define BOOKMARK_NAMESPACE_NAME 	"bookmark"
-#define BOOKMARK_NAMESPACE_URI		"http://www.freedesktop.org/standards/desktop-bookmarks"
-
-#define BOOKMARK_GROUPS_ELEMENT		"groups"
-#define BOOKMARK_GROUP_ELEMENT		"group"
-#define BOOKMARK_APPLICATIONS_ELEMENT	"applications"
-#define BOOKMARK_APPLICATION_ELEMENT	"application"
-#define BOOKMARK_ICON_ELEMENT 		"icon"
-#define BOOKMARK_PRIVATE_ELEMENT	"private"
-
-#define BOOKMARK_NAME_ATTRIBUTE		"name"
-#define BOOKMARK_EXEC_ATTRIBUTE		"exec"
-#define BOOKMARK_COUNT_ATTRIBUTE 	"count"
-#define BOOKMARK_TIMESTAMP_ATTRIBUTE	"timestamp"
-#define BOOKMARK_HREF_ATTRIBUTE 	"href"
-#define BOOKMARK_TYPE_ATTRIBUTE 	"type"
-
-/* Shared MIME Info entities */
-#define MIME_NAMESPACE_NAME 		"mime"
-#define MIME_NAMESPACE_URI 		"http://www.freedesktop.org/standards/shared-mime-info"
-#define MIME_TYPE_ELEMENT 		"mime-type"
-#define MIME_TYPE_ATTRIBUTE 		"type"
-
-
-typedef struct _BookmarkAppInfo  BookmarkAppInfo;
-typedef struct _BookmarkMetadata BookmarkMetadata;
-typedef struct _BookmarkItem     BookmarkItem;
-typedef struct _ParseData        ParseData;
-
-struct _BookmarkAppInfo
-{
-  gchar *name;
-  gchar *exec;
-  
-  guint count;
-  
-  time_t stamp;
-};
-
-struct _BookmarkMetadata
-{
-  gchar *mime_type;
-  
-  GList *groups;
-  
-  GList *applications;
-  GHashTable *apps_by_name;
-  
-  gchar *icon_href;
-  gchar *icon_mime;
-  
-  guint is_private : 1;
-};
-
-struct _BookmarkItem
-{
-  gchar *uri;
-
-  gchar *title;
-  gchar *description;
-
-  time_t added;
-  time_t modified;
-  time_t visited;
-
-  BookmarkMetadata *metadata;
-};
-
-struct _LibSlabBookmarkFile
-{
-  gchar *title;
-  gchar *description;
-
-  /* we store our items in a list and keep a copy inside
-   * an hash table for faster lookup performances
-   */
-  GList *items;
-  GHashTable *items_by_uri;
-};
-
-/* parser state machine */
-enum
-{
-  STATE_STARTED        = 0,
-  
-  STATE_ROOT,
-  STATE_BOOKMARK,
-  STATE_TITLE,
-  STATE_DESC,
-  STATE_INFO,
-  STATE_METADATA,
-  STATE_APPLICATIONS,
-  STATE_APPLICATION,
-  STATE_GROUPS,
-  STATE_GROUP,
-  STATE_MIME,
-  STATE_ICON,
-  
-  STATE_FINISHED
-};
-
-static void          libslab_bookmark_file_init        (LibSlabBookmarkFile  *bookmark);
-static void          libslab_bookmark_file_clear       (LibSlabBookmarkFile  *bookmark);
-static gboolean      libslab_bookmark_file_parse       (LibSlabBookmarkFile  *bookmark,
-						  const gchar    *buffer,
-						  gsize           length,
-						  GError        **error);
-static gchar *       libslab_bookmark_file_dump        (LibSlabBookmarkFile  *bookmark,
-						  gsize          *length,
-						  GError        **error);
-static BookmarkItem *libslab_bookmark_file_lookup_item (LibSlabBookmarkFile  *bookmark,
-						  const gchar    *uri);
-static void          libslab_bookmark_file_add_item    (LibSlabBookmarkFile  *bookmark,
-						  BookmarkItem   *item,
-						  GError        **error);
-						       
-static time_t  timestamp_from_iso8601 (const gchar *iso_date);
-static gchar * timestamp_to_iso8601   (time_t       timestamp);
-static time_t mktime_utc (struct tm *tm);
-static gboolean libslab_time_val_from_iso8601 (const gchar *iso_date, GTimeVal    *time_);
-static gchar * libslab_time_val_to_iso8601  (GTimeVal *time_);
-
-/********************************
- * BookmarkAppInfo              *
- *                              *
- * Application metadata storage *
- ********************************/
-static BookmarkAppInfo *
-bookmark_app_info_new (const gchar *name)
-{
-  BookmarkAppInfo *retval;
- 
-  g_assert (name != NULL);
-  
-  retval = g_new0 (BookmarkAppInfo, 1);
-  
-  retval->name = g_strdup (name);
-  retval->exec = NULL;
-  retval->count = 0;
-  retval->stamp = time (NULL);
-  
-  return retval;
-}
-
-static void
-bookmark_app_info_free (BookmarkAppInfo *app_info)
-{
-  if (!app_info)
-    return;
-  
-  if (app_info->name)
-    g_free (app_info->name);
-  
-  if (app_info->exec)
-    g_free (app_info->exec);
-  
-  g_free (app_info);
-}
-
-static gchar *
-bookmark_app_info_dump (BookmarkAppInfo *app_info)
-{
-  gchar *retval;
-  gchar *name, *exec;
-
-  g_assert (app_info != NULL);
-
-  if (app_info->count == 0)
-    return NULL;
-
-  name = g_markup_escape_text (app_info->name, -1);
-  exec = g_markup_escape_text (app_info->exec, -1);
- 
-  retval = g_strdup_printf ("          <%s:%s %s=\"%s\" %s=\"%s\" %s=\"%ld\" %s=\"%u\"/>\n",
-                            BOOKMARK_NAMESPACE_NAME,
-                            BOOKMARK_APPLICATION_ELEMENT,
-                            BOOKMARK_NAME_ATTRIBUTE, name,
-                            BOOKMARK_EXEC_ATTRIBUTE, exec,
-                            BOOKMARK_TIMESTAMP_ATTRIBUTE, (time_t) app_info->stamp,
-                            BOOKMARK_COUNT_ATTRIBUTE, app_info->count);
-
-  g_free (name);
-  g_free (exec);
-
-  return retval;
-}
-
-
-/***********************
- * BookmarkMetadata    *
- *                     *
- * Metadata storage    *
- ***********************/
-static BookmarkMetadata *
-bookmark_metadata_new (void)
-{
-  BookmarkMetadata *retval;
-  
-  retval = g_new0 (BookmarkMetadata, 1);
-
-  retval->mime_type = NULL;
-  
-  retval->groups = NULL;
-  
-  retval->applications = NULL;
-  retval->apps_by_name = g_hash_table_new_full (g_str_hash,
-                                                g_str_equal,
-                                                NULL,
-                                                NULL);
-  
-  retval->is_private = FALSE;
-  
-  retval->icon_href = NULL;
-  retval->icon_mime = NULL;
-  
-  return retval;
-}
-
-static void
-bookmark_metadata_free (BookmarkMetadata *metadata)
-{
-  if (!metadata)
-    return;
-  
-  if (metadata->mime_type)
-    g_free (metadata->mime_type);
-    
-  if (metadata->groups)
-    {
-      g_list_foreach (metadata->groups,
-		      (GFunc) g_free,
-		      NULL);
-      g_list_free (metadata->groups);
-    }
-  
-  if (metadata->applications)
-    {
-      g_list_foreach (metadata->applications,
-		      (GFunc) bookmark_app_info_free,
-		      NULL);
-      g_list_free (metadata->applications);
-      
-      g_hash_table_destroy (metadata->apps_by_name);
-    }
-  
-  if (metadata->icon_href)
-    g_free (metadata->icon_href);
-  
-  if (metadata->icon_mime)
-    g_free (metadata->icon_mime);
-  
-  g_free (metadata);
-}
-
-static gchar *
-bookmark_metadata_dump (BookmarkMetadata *metadata)
-{
-  GString *retval;
- 
-  if (!metadata->applications)
-    return NULL;
-  
-  retval = g_string_new (NULL);
-  
-  /* metadata container */
-  g_string_append_printf (retval,
-  			  "      <%s %s=\"%s\">\n",
-  			  XBEL_METADATA_ELEMENT,
-  			  XBEL_OWNER_ATTRIBUTE, BOOKMARK_METADATA_OWNER);
-  
-  /* mime type */
-  if (metadata->mime_type)
-    g_string_append_printf (retval,
-  			    "        <%s:%s %s=\"%s\"/>\n",
-  			    MIME_NAMESPACE_NAME,
-  			    MIME_TYPE_ELEMENT,
-  			    MIME_TYPE_ATTRIBUTE, metadata->mime_type);
-  
-  if (metadata->groups)
-    {
-      GList *l;
-      
-      /* open groups container */
-      g_string_append_printf (retval,
-      			      "        <%s:%s>\n",
-      			      BOOKMARK_NAMESPACE_NAME,
-      			      BOOKMARK_GROUPS_ELEMENT);
-      
-      for (l = g_list_last (metadata->groups); l != NULL; l = l->prev)
-        {
-          gchar *group_name;
-
-	  group_name = g_markup_escape_text ((gchar *) l->data, -1);
-          g_string_append_printf (retval,
-          			  "          <%s:%s>%s</%s:%s>\n",
-          			  BOOKMARK_NAMESPACE_NAME,
-          			  BOOKMARK_GROUP_ELEMENT,
-          			  group_name,
-          			  BOOKMARK_NAMESPACE_NAME,
-          			  BOOKMARK_GROUP_ELEMENT);
-	  g_free (group_name);
-        }
-      
-      /* close groups container */
-      g_string_append_printf (retval,
-      			      "        </%s:%s>\n",
-      			      BOOKMARK_NAMESPACE_NAME,
-      			      BOOKMARK_GROUPS_ELEMENT);
-    }
-  
-  if (metadata->applications)
-    {
-      GList *l;
-      
-      /* open applications container */
-      g_string_append_printf (retval,
-      			      "        <%s:%s>\n",
-      			      BOOKMARK_NAMESPACE_NAME,
-      			      BOOKMARK_APPLICATIONS_ELEMENT);
-      
-      for (l = g_list_last (metadata->applications); l != NULL; l = l->prev)
-        {
-          BookmarkAppInfo *app_info = (BookmarkAppInfo *) l->data;
-          gchar *app_data;
-
-	  g_assert (app_info != NULL);
-          
-          app_data = bookmark_app_info_dump (app_info);
-
-	  if (app_data)
-            {
-              retval = g_string_append (retval, app_data);
-
-	      g_free (app_data);
-	    }
-        }
-      
-      /* close applications container */
-      g_string_append_printf (retval,
-      			      "        </%s:%s>\n",
-      			      BOOKMARK_NAMESPACE_NAME,
-      			      BOOKMARK_APPLICATIONS_ELEMENT);
-    }
-  
-  /* icon */
-  if (metadata->icon_href)
-    {
-      if (!metadata->icon_mime)
-        metadata->icon_mime = g_strdup ("application/octet-stream");
-      
-      g_string_append_printf (retval,
-      			      "       <%s:%s %s=\"%s\" %s=\"%s\"/>\n",
-      			      BOOKMARK_NAMESPACE_NAME,
-      			      BOOKMARK_ICON_ELEMENT,
-      			      BOOKMARK_HREF_ATTRIBUTE, metadata->icon_href,
-      			      BOOKMARK_TYPE_ATTRIBUTE, metadata->icon_mime);
-    }
-  
-  /* private hint */
-  if (metadata->is_private)
-    g_string_append_printf (retval,
-    			    "        <%s:%s/>\n",
-    			    BOOKMARK_NAMESPACE_NAME,
-    			    BOOKMARK_PRIVATE_ELEMENT);
-  
-  /* close metadata container */
-  g_string_append_printf (retval, "      </%s>\n", XBEL_METADATA_ELEMENT);
-  			   
-  return g_string_free (retval, FALSE);
-}
-
-/******************************************************
- * BookmarkItem                                       *
- *                                                    *
- * Storage for a single bookmark item inside the list *
- ******************************************************/
-static BookmarkItem *
-bookmark_item_new (const gchar *uri)
-{
-  BookmarkItem *item;
- 
-  g_assert (uri != NULL);
-  
-  item = g_new0 (BookmarkItem, 1);
-  item->uri = g_strdup (uri);
-  
-  item->title = NULL;
-  item->description = NULL;
-  
-  item->added = (time_t) -1;
-  item->modified = (time_t) -1;
-  item->visited = (time_t) -1;
-  
-  item->metadata = NULL;
-  
-  return item;
-}
-
-static void
-bookmark_item_free (BookmarkItem *item)
-{
-  if (!item)
-    return;
-
-  if (item->uri)
-    g_free (item->uri);
-  
-  if (item->title)
-    g_free (item->title);
-  
-  if (item->description)
-    g_free (item->description);
-  
-  if (item->metadata)
-    bookmark_metadata_free (item->metadata);
-  
-  g_free (item);
-}
-
-static gchar *
-bookmark_item_dump (BookmarkItem *item)
-{
-  GString *retval;
-  gchar *added, *visited, *modified;
-  gchar *escaped_uri;
- 
-  /* at this point, we must have at least a registered application; if we don't
-   * we don't screw up the bookmark file, and just skip this item
-   */
-  if (!item->metadata || !item->metadata->applications)
-    {
-      g_warning ("Item for URI '%s' has no registered applications: skipping.\n", item->uri);
-      return NULL;
-    }
-  
-  retval = g_string_new (NULL);
-  
-  added = timestamp_to_iso8601 (item->added);
-  modified = timestamp_to_iso8601 (item->modified);
-  visited = timestamp_to_iso8601 (item->visited);
-
-  escaped_uri = g_markup_escape_text (item->uri, -1);
-  
-  g_string_append_printf (retval,
-                          "  <%s %s=\"%s\" %s=\"%s\" %s=\"%s\" %s=\"%s\">\n",
-                          XBEL_BOOKMARK_ELEMENT,
-                          XBEL_HREF_ATTRIBUTE, escaped_uri,
-                          XBEL_ADDED_ATTRIBUTE, added,
-                          XBEL_MODIFIED_ATTRIBUTE, modified,
-                          XBEL_VISITED_ATTRIBUTE, visited);
-  g_free (escaped_uri);
-  g_free (visited);
-  g_free (modified);
-  g_free (added);
-  
-  if (item->title)
-    {
-      gchar *escaped_title;
-      
-      escaped_title = g_markup_escape_text (item->title, -1);
-      g_string_append_printf (retval,
-    			      "    <%s>%s</%s>\n",
-    			      XBEL_TITLE_ELEMENT,
-    			      escaped_title,
-    			      XBEL_TITLE_ELEMENT);
-      g_free (escaped_title);
-    }
-  
-  if (item->description)
-    {
-      gchar *escaped_desc;
-      
-      escaped_desc = g_markup_escape_text (item->description, -1);
-      g_string_append_printf (retval,
-    			      "    <%s>%s</%s>\n",
-    			      XBEL_DESC_ELEMENT,
-    			      escaped_desc,
-    			      XBEL_DESC_ELEMENT);
-      g_free (escaped_desc);
-    }
-  
-  if (item->metadata)
-    {
-      gchar *metadata;
-      
-      /* open info container */
-      g_string_append_printf (retval, "    <%s>\n", XBEL_INFO_ELEMENT);
-      
-      metadata = bookmark_metadata_dump (item->metadata);
-      if (metadata)
-        {
-          retval = g_string_append (retval, metadata);
-
-	  g_free (metadata);
-	}
-      
-      /* close info container */
-      g_string_append_printf (retval, "    </%s>\n", XBEL_INFO_ELEMENT);
-    }
-  
-  g_string_append_printf (retval, "  </%s>\n", XBEL_BOOKMARK_ELEMENT);
-  
-  return g_string_free (retval, FALSE);
-}
-
-static BookmarkAppInfo *
-bookmark_item_lookup_app_info (BookmarkItem *item,
-			       const gchar  *app_name)
-{
-  g_assert (item != NULL && app_name != NULL);
-
-  if (!item->metadata)
-    return NULL;
-  
-  return g_hash_table_lookup (item->metadata->apps_by_name, app_name);
-}
-
-/*************************
- *    LibSlabBookmarkFile    *
- *************************/
- 
-static void
-libslab_bookmark_file_init (LibSlabBookmarkFile *bookmark)
-{
-  bookmark->title = NULL;
-  bookmark->description = NULL;
-  
-  bookmark->items = NULL;
-  bookmark->items_by_uri = g_hash_table_new_full (g_str_hash,
-                                                  g_str_equal,
-                                                  NULL,
-                                                  NULL);
-}
-
-static void
-libslab_bookmark_file_clear (LibSlabBookmarkFile *bookmark)
-{
-  g_free (bookmark->title);
-  g_free (bookmark->description);
-
-  if (bookmark->items)
-    {
-      g_list_foreach (bookmark->items,
-		      (GFunc) bookmark_item_free,
-		      NULL);
-      g_list_free (bookmark->items);
-      
-      bookmark->items = NULL;
-    }
-  
-  if (bookmark->items_by_uri)
-    {
-      g_hash_table_destroy (bookmark->items_by_uri);
-      
-      bookmark->items_by_uri = NULL;
-    }
-}
-
-struct _ParseData
-{
-  gint state;
-  
-  GHashTable *namespaces;
-  
-  LibSlabBookmarkFile *bookmark_file;
-  BookmarkItem *current_item;
-};
-
-static ParseData *
-parse_data_new (void)
-{
-  ParseData *retval;
-  
-  retval = g_new (ParseData, 1);
-  
-  retval->state = STATE_STARTED;
-  retval->namespaces = g_hash_table_new_full (g_str_hash, g_str_equal,
-  					      (GDestroyNotify) g_free,
-  					      (GDestroyNotify) g_free);
-  retval->bookmark_file = NULL;
-  retval->current_item = NULL;
-  
-  return retval;
-}
-
-static void
-parse_data_free (ParseData *parse_data)
-{
-  g_hash_table_destroy (parse_data->namespaces);
-  
-  g_free (parse_data);
-}
-
-#define IS_ATTRIBUTE(s,a)	((0 == strcmp ((s), (a))))
-
-static void
-parse_bookmark_element (GMarkupParseContext  *context,
-			ParseData            *parse_data,
-			const gchar         **attribute_names,
-			const gchar         **attribute_values,
-			GError              **error)
-{
-  const gchar *uri, *added, *modified, *visited;
-  const gchar *attr;
-  gint i;
-  BookmarkItem *item;
-  GError *add_error;
- 
-  g_assert ((parse_data != NULL) && (parse_data->state == STATE_BOOKMARK));
-  
-  i = 0;
-  uri = added = modified = visited = NULL;
-  for (attr = attribute_names[i]; attr != NULL; attr = attribute_names[++i])
-    {
-      if (IS_ATTRIBUTE (attr, XBEL_HREF_ATTRIBUTE))
-        uri = attribute_values[i];
-      else if (IS_ATTRIBUTE (attr, XBEL_ADDED_ATTRIBUTE))
-        added = attribute_values[i];
-      else if (IS_ATTRIBUTE (attr, XBEL_MODIFIED_ATTRIBUTE))
-        modified = attribute_values[i];
-      else if (IS_ATTRIBUTE (attr, XBEL_VISITED_ATTRIBUTE))
-        visited = attribute_values[i];
-      else
-        {
-          g_set_error (error, G_MARKUP_ERROR,
-		       G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
-          	       _("Unexpected attribute '%s' for element '%s'"),
-          	       attr,
-          	       XBEL_BOOKMARK_ELEMENT);
-          return;
-        }
-    }
-  
-  if (!uri)
-    {
-      g_set_error (error, G_MARKUP_ERROR,
-      		   G_MARKUP_ERROR_INVALID_CONTENT,
-      		   _("Attribute '%s' of element '%s' not found"),
-      		   XBEL_HREF_ATTRIBUTE,
-      		   XBEL_BOOKMARK_ELEMENT);
-      return;
-    }
-  
-  g_assert (parse_data->current_item == NULL);
-  
-  item = bookmark_item_new (uri);
-  
-  if (added)
-    item->added = timestamp_from_iso8601 (added);
-  
-  if (modified)
-    item->modified = timestamp_from_iso8601 (modified);
-  
-  if (visited)
-    item->visited = timestamp_from_iso8601 (visited);
-
-  add_error = NULL;
-  libslab_bookmark_file_add_item (parse_data->bookmark_file,
-  			      item,
-  			      &add_error);
-  if (add_error)
-    {
-      bookmark_item_free (item);
-      
-      g_propagate_error (error, add_error);
-      
-      return;
-    }  			      
-  
-  parse_data->current_item = item;
-}
-
-static void
-parse_application_element (GMarkupParseContext  *context,
-			   ParseData            *parse_data,
-			   const gchar         **attribute_names,
-			   const gchar         **attribute_values,
-			   GError              **error)
-{
-  const gchar *name, *exec, *count, *stamp;
-  const gchar *attr;
-  gint i;
-  BookmarkItem *item;
-  BookmarkAppInfo *ai;
-  
-  g_assert ((parse_data != NULL) && (parse_data->state == STATE_APPLICATION));
-
-  i = 0;
-  name = exec = count = stamp = NULL;
-  for (attr = attribute_names[i]; attr != NULL; attr = attribute_names[++i])
-    {
-      if (IS_ATTRIBUTE (attr, BOOKMARK_NAME_ATTRIBUTE))
-        name = attribute_values[i];
-      else if (IS_ATTRIBUTE (attr, BOOKMARK_EXEC_ATTRIBUTE))
-        exec = attribute_values[i];
-      else if (IS_ATTRIBUTE (attr, BOOKMARK_COUNT_ATTRIBUTE))
-        count = attribute_values[i];
-      else if (IS_ATTRIBUTE (attr, BOOKMARK_TIMESTAMP_ATTRIBUTE))
-        stamp = attribute_values[i];
-      else
-        {
-          g_set_error (error, G_MARKUP_ERROR,
-		       G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
-          	       _("Unexpected attribute '%s' for element '%s'"),
-          	       attr,
-          	       BOOKMARK_APPLICATION_ELEMENT);
-          return;
-        }        
-    }
-
-  if (!name)
-    {
-      g_set_error (error, G_MARKUP_ERROR,
-      		   G_MARKUP_ERROR_INVALID_CONTENT,
-      		   _("Attribute '%s' of element '%s' not found"),
-      		   BOOKMARK_NAME_ATTRIBUTE,
-      		   BOOKMARK_APPLICATION_ELEMENT);
-      return;
-    }
-  
-  if (!exec)
-    {
-      g_set_error (error, G_MARKUP_ERROR,
-      		   G_MARKUP_ERROR_INVALID_CONTENT,
-      		   _("Attribute '%s' of element '%s' not found"),
-      		   BOOKMARK_EXEC_ATTRIBUTE,
-      		   BOOKMARK_APPLICATION_ELEMENT);
-      return;
-    }
-
-  g_assert (parse_data->current_item != NULL);  
-  item = parse_data->current_item;
-    
-  ai = bookmark_item_lookup_app_info (item, name);
-  if (!ai)
-    {
-      ai = bookmark_app_info_new (name);
-      
-      if (!item->metadata)
-	item->metadata = bookmark_metadata_new ();
-      
-      item->metadata->applications = g_list_prepend (item->metadata->applications, ai);
-      g_hash_table_replace (item->metadata->apps_by_name, ai->name, ai);
-    }
-      
-  ai->exec = g_strdup (exec);
-  
-  if (count)
-    ai->count = atoi (count);
-  else
-    ai->count = 1;
-  
-  if (stamp)
-    ai->stamp = (time_t) atol (stamp);
-  else
-    ai->stamp = time (NULL);
-}
-
-static void
-parse_mime_type_element (GMarkupParseContext  *context,
-			 ParseData            *parse_data,
-			 const gchar         **attribute_names,
-			 const gchar         **attribute_values,
-			 GError              **error)
-{
-  const gchar *type;
-  const gchar *attr;
-  gint i;
-  BookmarkItem *item;
-  
-  g_assert ((parse_data != NULL) && (parse_data->state == STATE_MIME));
-  
-  i = 0;
-  type = NULL;
-  for (attr = attribute_names[i]; attr != NULL; attr = attribute_names[++i])
-    {
-      if (IS_ATTRIBUTE (attr, MIME_TYPE_ATTRIBUTE))
-        type = attribute_values[i];
-      else
-        {
-          g_set_error (error, G_MARKUP_ERROR,
-		       G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
-          	       _("Unexpected attribute '%s' for element '%s'"),
-          	       attr,
-          	       MIME_TYPE_ELEMENT);
-          return;
-        }        
-    }
-
-  if (!type)
-    type = "application/octet-stream";
-
-  g_assert (parse_data->current_item != NULL);  
-  item = parse_data->current_item;
-    
-  if (!item->metadata)
-    item->metadata = bookmark_metadata_new ();
-  
-  item->metadata->mime_type = g_strdup (type);
-}
-
-static void
-parse_icon_element (GMarkupParseContext  *context,
-		    ParseData            *parse_data,
-		    const gchar         **attribute_names,
-		    const gchar         **attribute_values,
-		    GError              **error)
-{
-  const gchar *href;
-  const gchar *type;
-  const gchar *attr;
-  gint i;
-  BookmarkItem *item;
-  
-  g_assert ((parse_data != NULL) && (parse_data->state == STATE_ICON));
-  
-  i = 0;
-  href = NULL;
-  type = NULL;
-  for (attr = attribute_names[i]; attr != NULL; attr = attribute_names[++i])
-    {
-      if (IS_ATTRIBUTE (attr, BOOKMARK_HREF_ATTRIBUTE))
-        href = attribute_values[i];
-      else if (IS_ATTRIBUTE (attr, BOOKMARK_TYPE_ATTRIBUTE))
-        type = attribute_values[i];
-      else
-        {
-          g_set_error (error, G_MARKUP_ERROR,
-		       G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
-          	       _("Unexpected attribute '%s' for element '%s'"),
-          	       attr,
-          	       BOOKMARK_ICON_ELEMENT);
-          return;
-        }        
-    }
-
-  if (!href)
-    {
-      g_set_error (error, G_MARKUP_ERROR,
-      		   G_MARKUP_ERROR_INVALID_CONTENT,
-      		   _("Attribute '%s' of element '%s' not found"),
-      		   BOOKMARK_HREF_ATTRIBUTE,
-      		   BOOKMARK_ICON_ELEMENT);
-      return;
-    }
-
-  if (!type)
-    type = "application/octet-stream";
-
-  g_assert (parse_data->current_item != NULL);  
-  item = parse_data->current_item;
-    
-  if (!item->metadata)
-    item->metadata = bookmark_metadata_new ();
-  
-  item->metadata->icon_href = g_strdup (href);
-  item->metadata->icon_mime = g_strdup (type);
-}
-
-/* scans through the attributes of an element for the "xmlns" pragma, and
- * adds any resulting namespace declaration to a per-parser hashtable, using
- * the namespace name as a key for the namespace URI; if no key was found,
- * the namespace is considered as default, and stored under the "default" key.
- *
- * FIXME: this works on the assumption that the generator of the XBEL file
- * is either this code or is smart enough to place the namespace declarations
- * inside the main root node or inside the metadata node and does not redefine 
- * a namespace inside an inner node; this does *not* conform to the
- * XML-NS standard, although is a close approximation.  In order to make this
- * conformant to the XML-NS specification we should use a per-element
- * namespace table inside GMarkup and ask it to resolve the namespaces for us.
- */
-static void
-map_namespace_to_name (ParseData    *parse_data,
-                       const gchar **attribute_names,
-		       const gchar **attribute_values)
-{
-  const gchar *attr;
-  gint i;
- 
-  g_assert (parse_data != NULL);
-  
-  if (!attribute_names || !attribute_names[0])
-    return;
-  
-  i = 0;
-  for (attr = attribute_names[i]; attr; attr = attribute_names[++i])
-    {
-      if (g_str_has_prefix (attr, "xmlns"))
-        {
-          gchar *namespace_name, *namespace_uri;
-          gchar *p;
-          
-          p = g_utf8_strchr (attr, -1, ':');
-          if (p)
-            p = g_utf8_next_char (p);
-          else
-            p = "default";
-          
-          namespace_name = g_strdup (p);
-          namespace_uri = g_strdup (attribute_values[i]);
-          
-          g_hash_table_replace (parse_data->namespaces,
-                                namespace_name,
-                                namespace_uri);
-        }
-     }
-}
-
-/* checks whether @element_full is equal to @element.
- *
- * if @namespace is set, it tries to resolve the namespace to a known URI,
- * and if found is prepended to the element name, from which is separated
- * using the character specified in the @sep parameter.
- */
-static gboolean
-is_element_full (ParseData   *parse_data,
-                 const gchar *element_full,
-                 const gchar *namespace,
-                 const gchar *element,
-                 const gchar  sep)
-{
-  gchar *ns_uri, *ns_name, *s, *resolved;
-  const gchar *p, *element_name;
-  gboolean retval;
- 
-  g_assert (parse_data != NULL);
-  g_assert (element_full != NULL);
-  
-  if (!element)
-    return FALSE;
-    
-  /* no namespace requested: dumb element compare */
-  if (!namespace)
-    return (0 == strcmp (element_full, element));
-  
-  /* search for namespace separator; if none found, assume we are under the
-   * default namespace, and set ns_name to our "default" marker; if no default
-   * namespace has been set, just do a plain comparison between @full_element
-   * and @element.
-   */
-  p = strchr (element_full, ':');
-  if (p)
-    {
-      ns_name = g_strndup (element_full, p - element_full);
-      element_name = g_utf8_next_char (p);
-    }
-  else
-    {
-      ns_name = g_strdup ("default");
-      element_name = element_full;
-    }
-  
-  ns_uri = g_hash_table_lookup (parse_data->namespaces, ns_name);  
-  if (!ns_uri)
-    {
-      /* no default namespace found */
-      g_free (ns_name);
-      
-      return (0 == strcmp (element_full, element));
-    }
-  
-  resolved = g_strdup_printf ("%s%c%s", ns_uri, sep, element_name);
-  s = g_strdup_printf ("%s%c%s", namespace, sep, element);
-  retval = (0 == strcmp (resolved, s));
-  
-  g_free (ns_name);
-  g_free (resolved);
-  g_free (s);
-  
-  return retval;
-}
-
-#define IS_ELEMENT(p,s,e)	(is_element_full ((p), (s), NULL, (e), '\0'))
-#define IS_ELEMENT_NS(p,s,n,e)	(is_element_full ((p), (s), (n), (e), '|'))
-
-static void
-start_element_raw_cb (GMarkupParseContext *context,
-                      const gchar         *element_name,
-                      const gchar        **attribute_names,
-                      const gchar        **attribute_values,
-                      gpointer             user_data,
-                      GError             **error)
-{
-  ParseData *parse_data = (ParseData *) user_data;
-
-  /* we must check for namespace declarations first
-   * 
-   * XXX - we could speed up things by checking for namespace declarations
-   * only on the root node, where they usually are; this would probably break
-   * on streams not produced by us or by "smart" generators
-   */
-  map_namespace_to_name (parse_data, attribute_names, attribute_values);
-  
-  switch (parse_data->state)
-    {
-    case STATE_STARTED:
-      if (IS_ELEMENT (parse_data, element_name, XBEL_ROOT_ELEMENT))
-        {
-          const gchar *attr;
-          gint i;
-          
-          i = 0;
-          for (attr = attribute_names[i]; attr; attr = attribute_names[++i])
-            {
-              if ((IS_ATTRIBUTE (attr, XBEL_VERSION_ATTRIBUTE)) &&
-                  (0 == strcmp (attribute_values[i], XBEL_VERSION)))
-                parse_data->state = STATE_ROOT;
-            }
-	}
-      else
-        g_set_error (error, G_MARKUP_ERROR,
-		     G_MARKUP_ERROR_INVALID_CONTENT,
-          	     _("Unexpected tag '%s', tag '%s' expected"),
-          	     element_name, XBEL_ROOT_ELEMENT);
-      break;
-    case STATE_ROOT:
-      if (IS_ELEMENT (parse_data, element_name, XBEL_TITLE_ELEMENT))
-        parse_data->state = STATE_TITLE;
-      else if (IS_ELEMENT (parse_data, element_name, XBEL_DESC_ELEMENT))
-        parse_data->state = STATE_DESC;
-      else if (IS_ELEMENT (parse_data, element_name, XBEL_BOOKMARK_ELEMENT))
-        {
-          GError *inner_error = NULL;
-          
-          parse_data->state = STATE_BOOKMARK;
-          
-          parse_bookmark_element (context,
-          			  parse_data,
-          			  attribute_names,
-          			  attribute_values,
-          			  &inner_error);
-          if (inner_error)
-            g_propagate_error (error, inner_error);
-        }
-      else
-        g_set_error (error, G_MARKUP_ERROR,
-        	     G_MARKUP_ERROR_INVALID_CONTENT,
-        	     _("Unexpected tag '%s' inside '%s'"),
-        	     element_name,
-        	     XBEL_ROOT_ELEMENT);
-      break;
-    case STATE_BOOKMARK:
-      if (IS_ELEMENT (parse_data, element_name, XBEL_TITLE_ELEMENT))
-        parse_data->state = STATE_TITLE;
-      else if (IS_ELEMENT (parse_data, element_name, XBEL_DESC_ELEMENT))
-        parse_data->state = STATE_DESC;
-      else if (IS_ELEMENT (parse_data, element_name, XBEL_INFO_ELEMENT))
-        parse_data->state = STATE_INFO;
-      else
-        g_set_error (error, G_MARKUP_ERROR,
-        	     G_MARKUP_ERROR_INVALID_CONTENT,
-          	     _("Unexpected tag '%s' inside '%s'"),
-          	     element_name,
-          	     XBEL_BOOKMARK_ELEMENT);
-      break;
-    case STATE_INFO:
-      if (IS_ELEMENT (parse_data, element_name, XBEL_METADATA_ELEMENT))
-        {
-          const gchar *attr;
-          gint i;
-          
-          i = 0;
-          for (attr = attribute_names[i]; attr; attr = attribute_names[++i])
-            {
-              if ((IS_ATTRIBUTE (attr, XBEL_OWNER_ATTRIBUTE)) &&
-                  (0 == strcmp (attribute_values[i], BOOKMARK_METADATA_OWNER)))
-                {
-                  parse_data->state = STATE_METADATA;
-                  
-                  if (!parse_data->current_item->metadata)
-                    parse_data->current_item->metadata = bookmark_metadata_new ();
-                }
-            }
-        }
-      else
-        g_set_error (error, G_MARKUP_ERROR,
-        	     G_MARKUP_ERROR_INVALID_CONTENT,
-        	     _("Unexpected tag '%s', tag '%s' expected"),
-        	     element_name,
-        	     XBEL_METADATA_ELEMENT);
-      break;
-    case STATE_METADATA:
-      if (IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_APPLICATIONS_ELEMENT))
-        parse_data->state = STATE_APPLICATIONS;
-      else if (IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_GROUPS_ELEMENT))
-        parse_data->state = STATE_GROUPS;
-      else if (IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_PRIVATE_ELEMENT))
-        parse_data->current_item->metadata->is_private = TRUE;
-      else if (IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_ICON_ELEMENT))
-        {
-          GError *inner_error = NULL;
-          
-	  parse_data->state = STATE_ICON;
-          
-          parse_icon_element (context,
-          		      parse_data,
-          		      attribute_names,
-          		      attribute_values,
-          		      &inner_error);
-          if (inner_error)
-            g_propagate_error (error, inner_error);
-        }
-      else if (IS_ELEMENT_NS (parse_data, element_name, MIME_NAMESPACE_URI, MIME_TYPE_ELEMENT))
-        {
-          GError *inner_error = NULL;
-          
-          parse_data->state = STATE_MIME;
-          
-          parse_mime_type_element (context,
-          			   parse_data,
-          			   attribute_names,
-          			   attribute_values,
-          			   &inner_error);
-          if (inner_error)
-            g_propagate_error (error, inner_error);
-        }
-      else
-        g_set_error (error, G_MARKUP_ERROR,
-        	     G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-        	     _("Unexpected tag '%s' inside '%s'"),
-        	     element_name,
-        	     XBEL_METADATA_ELEMENT);
-      break;
-    case STATE_APPLICATIONS:
-      if (IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_APPLICATION_ELEMENT))
-        {
-          GError *inner_error = NULL;
-          
-          parse_data->state = STATE_APPLICATION;
-          
-          parse_application_element (context,
-          			     parse_data,
-          			     attribute_names,
-          			     attribute_values,
-          			     &inner_error);
-          if (inner_error)
-            g_propagate_error (error, inner_error);
-        }
-      else
-        g_set_error (error, G_MARKUP_ERROR,
-        	     G_MARKUP_ERROR_INVALID_CONTENT,
-        	     _("Unexpected tag '%s', tag '%s' expected"),
-        	     element_name,
-        	     BOOKMARK_APPLICATION_ELEMENT);
-      break;
-    case STATE_GROUPS:
-      if (IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_GROUP_ELEMENT))
-        parse_data->state = STATE_GROUP;
-      else
-        g_set_error (error, G_MARKUP_ERROR,
-        	     G_MARKUP_ERROR_INVALID_CONTENT,
-        	     _("Unexpected tag '%s', tag '%s' expected"),
-        	     element_name,
-        	     BOOKMARK_GROUP_ELEMENT);
-      break;
-    case STATE_ICON:
-      if (IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_ICON_ELEMENT))
-        {
-          GError *inner_error = NULL;
-          
-          parse_icon_element (context,
-          		      parse_data,
-          		      attribute_names,
-          		      attribute_values,
-          		      &inner_error);
-          if (inner_error)
-            g_propagate_error (error, inner_error);
-        }
-      else
-        g_set_error (error, G_MARKUP_ERROR,
-        	     G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-        	     _("Unexpected tag '%s' inside '%s'"),
-        	     element_name,
-        	     XBEL_METADATA_ELEMENT);
-      break;
-    default:
-      g_assert_not_reached ();
-      break;
-    }
-}
-
-static void
-end_element_raw_cb (GMarkupParseContext *context,
-                    const gchar         *element_name,
-                    gpointer             user_data,
-                    GError             **error)
-{
-  ParseData *parse_data = (ParseData *) user_data;
-  
-  if (IS_ELEMENT (parse_data, element_name, XBEL_ROOT_ELEMENT))
-    parse_data->state = STATE_FINISHED;
-  else if (IS_ELEMENT (parse_data, element_name, XBEL_BOOKMARK_ELEMENT))
-    {
-      parse_data->current_item = NULL;
-      
-      parse_data->state = STATE_ROOT;
-    }
-  else if ((IS_ELEMENT (parse_data, element_name, XBEL_INFO_ELEMENT)) ||
-           (IS_ELEMENT (parse_data, element_name, XBEL_TITLE_ELEMENT)) ||
-           (IS_ELEMENT (parse_data, element_name, XBEL_DESC_ELEMENT)))
-    {
-      if (parse_data->current_item)
-        parse_data->state = STATE_BOOKMARK;
-      else
-        parse_data->state = STATE_ROOT;
-    }
-  else if (IS_ELEMENT (parse_data, element_name, XBEL_METADATA_ELEMENT))
-    parse_data->state = STATE_INFO;
-  else if (IS_ELEMENT_NS (parse_data, element_name,
-                          BOOKMARK_NAMESPACE_URI,
-                          BOOKMARK_APPLICATION_ELEMENT))
-    parse_data->state = STATE_APPLICATIONS;
-  else if (IS_ELEMENT_NS (parse_data, element_name,
-                          BOOKMARK_NAMESPACE_URI,
-                          BOOKMARK_GROUP_ELEMENT))
-    parse_data->state = STATE_GROUPS;
-  else if ((IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_APPLICATIONS_ELEMENT)) ||
-           (IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_GROUPS_ELEMENT)) ||
-           (IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_PRIVATE_ELEMENT)) ||
-           (IS_ELEMENT_NS (parse_data, element_name, BOOKMARK_NAMESPACE_URI, BOOKMARK_ICON_ELEMENT)) ||
-           (IS_ELEMENT_NS (parse_data, element_name, MIME_NAMESPACE_URI, MIME_TYPE_ELEMENT)))
-    parse_data->state = STATE_METADATA;
-}
-
-static void
-text_raw_cb (GMarkupParseContext *context,
-             const gchar         *text,
-             gsize                length,
-             gpointer             user_data,
-             GError             **error)
-{
-  ParseData *parse_data = (ParseData *) user_data;
-  gchar *payload;
-  
-  payload = g_strndup (text, length);
-  
-  switch (parse_data->state)
-    {
-    case STATE_TITLE:
-      if (parse_data->current_item)
-        {
-          g_free (parse_data->current_item->title);
-          parse_data->current_item->title = g_strdup (payload);
-        }
-      else
-        {
-          g_free (parse_data->bookmark_file->title);
-          parse_data->bookmark_file->title = g_strdup (payload);
-        }
-      break;
-    case STATE_DESC:
-      if (parse_data->current_item)
-        {
-          g_free (parse_data->current_item->description);
-          parse_data->current_item->description = g_strdup (payload);
-        }
-      else
-        {
-          g_free (parse_data->bookmark_file->description);
-          parse_data->bookmark_file->description = g_strdup (payload);
-        }
-      break;
-    case STATE_GROUP:
-      {
-      GList *groups;
-      
-      g_assert (parse_data->current_item != NULL);
-      
-      if (!parse_data->current_item->metadata)
-        parse_data->current_item->metadata = bookmark_metadata_new ();
-      
-      groups = parse_data->current_item->metadata->groups;
-      parse_data->current_item->metadata->groups = g_list_prepend (groups, g_strdup (payload));
-      }
-      break;
-    case STATE_ROOT:
-    case STATE_BOOKMARK:
-    case STATE_INFO:
-    case STATE_METADATA:
-    case STATE_APPLICATIONS:
-    case STATE_APPLICATION:
-    case STATE_GROUPS:
-    case STATE_MIME:
-    case STATE_ICON:
-      break;
-    default:
-      g_assert_not_reached ();
-      break;
-    }
-  
-  g_free (payload);
-}
-
-static const GMarkupParser markup_parser =
-{
-  start_element_raw_cb, /* start_element */
-  end_element_raw_cb,   /* end_element */
-  text_raw_cb,          /* text */
-  NULL,                 /* passthrough */
-  NULL
-};
-
-static gboolean
-libslab_bookmark_file_parse (LibSlabBookmarkFile  *bookmark,
-			 const gchar      *buffer,
-			 gsize             length,
-			 GError          **error)
-{
-  GMarkupParseContext *context;
-  ParseData *parse_data;
-  GError *parse_error, *end_error;
-  gboolean retval;
-  
-  g_assert (bookmark != NULL);
-
-  if (!buffer)
-    return FALSE;
-  
-  if (length == -1)
-    length = strlen (buffer);
-
-  parse_data = parse_data_new ();
-  parse_data->bookmark_file = bookmark;
-  
-  context = g_markup_parse_context_new (&markup_parser,
-  					0,
-  					parse_data,
-  					(GDestroyNotify) parse_data_free);
-  
-  parse_error = NULL;
-  retval = g_markup_parse_context_parse (context,
-  					 buffer,
-  					 length,
-  					 &parse_error);
-  if (!retval)
-    {
-      g_propagate_error (error, parse_error);
-      
-      return FALSE;
-    }
-  
-  end_error = NULL;
-  retval = g_markup_parse_context_end_parse (context, &end_error);
-  if (!retval)
-    {
-      g_propagate_error (error, end_error);
-      
-      return FALSE;
-    }
-  
-  g_markup_parse_context_free (context);
-  
-  return TRUE;
-}
-
-static gchar *
-libslab_bookmark_file_dump (LibSlabBookmarkFile  *bookmark,
-		      gsize          *length,
-		      GError        **error)
-{
-  GString *retval;
-  GList *l;
-  
-  retval = g_string_new (NULL);
-  
-  g_string_append_printf (retval,
-  			  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
-#if 0
-			  /* XXX - do we really need the doctype? */
-  			  "<!DOCTYPE %s\n"
-  			  "  PUBLIC \"%s\"\n"
-  			  "         \"%s\">\n"
-#endif
-  			  "<%s %s=\"%s\"\n"
-  			  "      xmlns:%s=\"%s\"\n"
-  			  "      xmlns:%s=\"%s\"\n>",
-#if 0
-			  /* XXX - do we really need the doctype? */
-  			  XBEL_DTD_NICK,
-  			  XBEL_DTD_SYSTEM, XBEL_DTD_URI,
-#endif
-  			  XBEL_ROOT_ELEMENT,
-  			  XBEL_VERSION_ATTRIBUTE, XBEL_VERSION,
-  			  BOOKMARK_NAMESPACE_NAME, BOOKMARK_NAMESPACE_URI,
-  			  MIME_NAMESPACE_NAME, MIME_NAMESPACE_URI);
-  
-  if (bookmark->title)
-    {
-      gchar *escaped_title;
-      
-      escaped_title = g_markup_escape_text (bookmark->title, -1);
-      
-      g_string_append_printf (retval, "  <%s>%s</%s>\n",
-                              XBEL_TITLE_ELEMENT,
-                              escaped_title,
-                              XBEL_TITLE_ELEMENT);
-      
-      g_free (escaped_title);
-    }
-  
-  if (bookmark->description)
-    {
-      gchar *escaped_desc;
-      
-      escaped_desc = g_markup_escape_text (bookmark->description, -1);
-      
-      g_string_append_printf (retval, "  <%s>%s</%s>\n",
-                              XBEL_DESC_ELEMENT,
-                              escaped_desc,
-                              XBEL_DESC_ELEMENT);
-      
-      g_free (escaped_desc);
-    }
-  
-  if (!bookmark->items)
-    goto out;
-  else
-    retval = g_string_append (retval, "\n");
-  
-  for (l = g_list_last (bookmark->items);
-       l != NULL;
-       l = l->prev)
-    {
-      BookmarkItem *item = (BookmarkItem *) l->data;
-      gchar *item_dump;
-      
-      item_dump = bookmark_item_dump (item);
-      if (!item_dump)
-        continue;
-      
-      retval = g_string_append (retval, item_dump);
-      
-      g_free (item_dump);      
-    }
-
-out:
-  g_string_append_printf (retval, "</%s>", XBEL_ROOT_ELEMENT);
-  
-  if (length)
-    *length = retval->len;
-  
-  return g_string_free (retval, FALSE);
-}
-
-/**************
- *    Misc    *
- **************/
- 
-/* converts a Unix timestamp in a ISO 8601 compliant string; you
- * should free the returned string.
- */
-static gchar *
-timestamp_to_iso8601 (time_t timestamp)
-{
-  GTimeVal stamp;
-
-  if (timestamp == (time_t) -1)
-    g_get_current_time (&stamp);
-  else
-    {
-      stamp.tv_sec = timestamp;
-      stamp.tv_usec = 0;
-    }
-
-  return libslab_time_val_to_iso8601 (&stamp);
-}
-
-static time_t
-timestamp_from_iso8601 (const gchar *iso_date)
-{
-  GTimeVal stamp;
-
-  if (!libslab_time_val_from_iso8601 (iso_date, &stamp))
-    return (time_t) -1;
-
-  return (time_t) stamp.tv_sec;
-}
-
-/* converts a broken down date representation, relative to UTC, to
- * a timestamp; it uses timegm() if it's available.
- */
-static time_t
-mktime_utc (struct tm *tm)
-{
-  time_t retval;
-  
-#ifndef HAVE_TIMEGM
-  static const gint days_before[] =
-  {
-    0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
-  };
-#endif
-
-#ifndef HAVE_TIMEGM
-  if (tm->tm_mon < 0 || tm->tm_mon > 11)
-    return (time_t) -1;
-
-  retval = (tm->tm_year - 70) * 365;
-  retval += (tm->tm_year - 68) / 4;
-  retval += days_before[tm->tm_mon] + tm->tm_mday - 1;
-  
-  if (tm->tm_year % 4 == 0 && tm->tm_mon < 2)
-    retval -= 1;
-  
-  retval = ((((retval * 24) + tm->tm_hour) * 60) + tm->tm_min) * 60 + tm->tm_sec;
-#else
-  retval = timegm (tm);
-#endif /* !HAVE_TIMEGM */
-  
-  return retval;
-}
-
-/**
- * g_time_val_from_iso8601:
- * @iso_date: a ISO 8601 encoded date string
- * @time_: a #GTimeVal
- *
- * Converts a string containing an ISO 8601 encoded date and time
- * to a #GTimeVal and puts it into @time_.
- *
- * Return value: %TRUE if the conversion was successful.
- *
- * Since: 2.12
- */
-static gboolean
-libslab_time_val_from_iso8601 (const gchar *iso_date,
-			 GTimeVal    *time_)
-{
-  struct tm tm;
-  long val;
-
-  g_return_val_if_fail (iso_date != NULL, FALSE);
-  g_return_val_if_fail (time_ != NULL, FALSE);
-
-  val = strtoul (iso_date, (char **)&iso_date, 10);
-  if (*iso_date == '-')
-    {
-      /* YYYY-MM-DD */
-      tm.tm_year = val - 1900;
-      iso_date++;
-      tm.tm_mon = strtoul (iso_date, (char **)&iso_date, 10) - 1;
-      
-      if (*iso_date++ != '-')
-       	return FALSE;
-      
-      tm.tm_mday = strtoul (iso_date, (char **)&iso_date, 10);
-    }
-  else
-    {
-      /* YYYYMMDD */
-      tm.tm_mday = val % 100;
-      tm.tm_mon = (val % 10000) / 100 - 1;
-      tm.tm_year = val / 10000 - 1900;
-    }
-
-  if (*iso_date++ != 'T')
-    return FALSE;
-  
-  val = strtoul (iso_date, (char **)&iso_date, 10);
-  if (*iso_date == ':')
-    {
-      /* hh:mm:ss */
-      tm.tm_hour = val;
-      iso_date++;
-      tm.tm_min = strtoul (iso_date, (char **)&iso_date, 10);
-      
-      if (*iso_date++ != ':')
-        return FALSE;
-      
-      tm.tm_sec = strtoul (iso_date, (char **)&iso_date, 10);
-    }
-  else
-    {
-      /* hhmmss */
-      tm.tm_sec = val % 100;
-      tm.tm_min = (val % 10000) / 100;
-      tm.tm_hour = val / 10000;
-    }
-
-  time_->tv_sec = mktime_utc (&tm);
-  time_->tv_usec = 1;
-  
-  if (*iso_date == '.')
-    time_->tv_usec = strtoul (iso_date + 1, (char **)&iso_date, 10);
-    
-  if (*iso_date == '+' || *iso_date == '-')
-    {
-      gint sign = (*iso_date == '+') ? -1 : 1;
-      
-      val = 60 * strtoul (iso_date + 1, (char **)&iso_date, 10);
-      
-      if (*iso_date == ':')
-	val = 60 * val + strtoul (iso_date + 1, NULL, 10);
-      else
-        val = 60 * (val / 100) + (val % 100);
-
-      time_->tv_sec += (time_t) (val * sign);
-    }
-
-  return TRUE;
-}
-
-/**
- * g_time_val_to_iso8601:
- * @time_: a #GTimeVal
- * 
- * Converts @time_ into a ISO 8601 encoded string, relative to the
- * Coordinated Universal Time (UTC).
- *
- * Return value: a newly allocated string containing a ISO 8601 date
- *
- * Since: 2.12
- */
-static gchar *
-libslab_time_val_to_iso8601 (GTimeVal *time_)
-{
-  gchar *retval;
-
-  g_return_val_if_fail (time_->tv_usec >= 0 && time_->tv_usec < G_USEC_PER_SEC, NULL);
-
-#define ISO_8601_LEN 	21
-#define ISO_8601_FORMAT "%Y-%m-%dT%H:%M:%SZ"
-  retval = g_new0 (gchar, ISO_8601_LEN + 1);
-  
-  strftime (retval, ISO_8601_LEN,
-	    ISO_8601_FORMAT,
-	    gmtime (&(time_->tv_sec)));
-  
-  return retval;
-}
-
-
-
-GQuark
-libslab_bookmark_file_error_quark (void)
-{
-  return g_quark_from_static_string ("egg-bookmark-file-error-quark");
-}
-
-
-
-/********************
- *    Public API    *
- ********************/
-
-/**
- * libslab_bookmark_file_new:
- *
- * Creates a new empty #LibSlabBookmarkFile object.
- *
- * Use libslab_bookmark_file_load_from_file(), libslab_bookmark_file_load_from_data()
- * or libslab_bookmark_file_load_from_data_dirs() to read an existing bookmark
- * file.
- *
- * Return value: an empty #LibSlabBookmarkFile
- *
- * Since: 2.12
- */
-LibSlabBookmarkFile *
-libslab_bookmark_file_new (void)
-{
-  LibSlabBookmarkFile *bookmark;
-  
-  bookmark = g_new (LibSlabBookmarkFile, 1);
-  
-  libslab_bookmark_file_init (bookmark);
-  
-  return bookmark;
-}
-
-/**
- * libslab_bookmark_file_free:
- * @bookmark: a #LibSlabBookmarkFile
- *
- * Frees a #LibSlabBookmarkFile.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_free (LibSlabBookmarkFile *bookmark)
-{
-  if (!bookmark)
-    return;
-  
-  libslab_bookmark_file_clear (bookmark);
-  
-  g_free (bookmark);  
-}
-
-/**
- * libslab_bookmark_file_load_from_data:
- * @bookmark: an empty #LibSlabBookmarkFile struct
- * @data: desktop bookmarks loaded in memory
- * @length: the length of @data in bytes
- * @error: return location for a #GError, or %NULL
- *
- * Loads a bookmark file from memory into an empty #LibSlabBookmarkFile
- * structure.  If the object cannot be created then @error is set to a
- * #LibSlabBookmarkFileError.
- *
- * Return value: %TRUE if a desktop bookmark could be loaded.
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_load_from_data (LibSlabBookmarkFile  *bookmark,
-				const gchar    *data,
-				gsize           length,
-				GError        **error)
-{
-  GError *parse_error;
-  gboolean retval;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (data != NULL, FALSE);
-  g_return_val_if_fail (length != 0, FALSE);
-  
-  if (length == (gsize) -1)
-    length = strlen (data);
-
-  if (bookmark->items)
-    {
-      libslab_bookmark_file_clear (bookmark);
-      libslab_bookmark_file_init (bookmark);
-    }
-  
-  parse_error = NULL;
-  retval = libslab_bookmark_file_parse (bookmark, data, length, &parse_error);
-  if (!retval)
-    {
-      g_propagate_error (error, parse_error);
-      
-      return FALSE;
-    }
-  
-  return TRUE;
-}
-
-/**
- * libslab_bookmark_file_load_from_file:
- * @bookmark: an empty #LibSlabBookmarkFile struct
- * @filename: the path of a filename to load, in the GLib file name encoding
- * @error: return location for a #GError, or %NULL
- *
- * Loads a desktop bookmark file into an empty #LibSlabBookmarkFile structure.
- * If the file could not be loaded then @error is set to either a #GFileError
- * or #LibSlabBookmarkFileError.
- *
- * Return value: %TRUE if a desktop bookmark file could be loaded
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_load_from_file (LibSlabBookmarkFile  *bookmark,
-				const gchar    *filename,
-				GError        **error)
-{
-  gchar *buffer;
-  gsize len;
-  GError *read_error;
-  gboolean retval;
-	
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (filename != NULL, FALSE);
-
-  read_error = NULL;
-  g_file_get_contents (filename, &buffer, &len, &read_error);
-  if (read_error)
-    {
-      g_propagate_error (error, read_error);
-
-      return FALSE;
-    }
-  
-  read_error = NULL;
-  retval = libslab_bookmark_file_load_from_data (bookmark,
-					   buffer,
-					   len,
-					   &read_error);
-  if (read_error)
-    {
-      g_propagate_error (error, read_error);
-
-      g_free (buffer);
-
-      return FALSE;
-    }
-
-  g_free (buffer);
-
-  return retval;
-}
-
-
-/* Iterates through all the directories in *dirs trying to
- * find file.  When it successfully locates file, returns a
- * string its absolute path.  It also leaves the unchecked
- * directories in *dirs.  You should free the returned string
- *
- * Adapted from gkeyfile.c
- */
-static gchar *
-find_file_in_data_dirs (const gchar   *file,
-                        gchar       ***dirs,
-                        GError       **error)
-{
-  gchar **data_dirs, *data_dir, *path;
-
-  path = NULL;
-
-  if (dirs == NULL)
-    return NULL;
-
-  data_dirs = *dirs;
-  path = NULL;
-  while (data_dirs && (data_dir = *data_dirs) && !path)
-    {
-      gchar *candidate_file, *sub_dir;
-
-      candidate_file = (gchar *) file;
-      sub_dir = g_strdup ("");
-      while (candidate_file != NULL && !path)
-        {
-          gchar *p;
-
-          path = g_build_filename (data_dir, sub_dir,
-                                   candidate_file, NULL);
-
-          candidate_file = strchr (candidate_file, '-');
-
-          if (candidate_file == NULL)
-            break;
-
-          candidate_file++;
-
-          g_free (sub_dir);
-          sub_dir = g_strndup (file, candidate_file - file - 1);
-
-          for (p = sub_dir; *p != '\0'; p++)
-            {
-              if (*p == '-')
-                *p = G_DIR_SEPARATOR;
-            }
-        }
-      g_free (sub_dir);
-      data_dirs++;
-    }
-
-  *dirs = data_dirs;
-
-  if (!path)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-                   LIBSLAB_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND,
-                   _("No valid bookmark file found in data dirs"));
-      
-      return NULL;
-    }
-  
-  return path;
-}
-
-
-/**
- * libslab_bookmark_file_load_from_data_dirs:
- * @bookmark: a #LibSlabBookmarkFile
- * @file: a relative path to a filename to open and parse
- * @full_path: return location for a string containing the full path
- *   of the file, or %NULL
- * @error: return location for a #GError, or %NULL
- *
- * This function looks for a desktop bookmark file named @file in the
- * paths returned from g_get_user_data_dir() and g_get_system_data_dirs(), 
- * loads the file into @bookmark and returns the file's full path in 
- * @full_path.  If the file could not be loaded then an %error is
- * set to either a #GFileError or #LibSlabBookmarkFileError.
- *
- * Return value: %TRUE if a key file could be loaded, %FALSE othewise
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_load_from_data_dirs (LibSlabBookmarkFile  *bookmark,
-				     const gchar    *file,
-				     gchar         **full_path,
-				     GError        **error)
-{
-  GError *file_error = NULL;
-  gchar **all_data_dirs, **data_dirs;
-  const gchar *user_data_dir;
-  const gchar * const * system_data_dirs;
-  gsize i, j;
-  gchar *output_path;
-  gboolean found_file;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (!g_path_is_absolute (file), FALSE);
-  
-  user_data_dir = g_get_user_data_dir ();
-  system_data_dirs = g_get_system_data_dirs ();
-  all_data_dirs = g_new0 (gchar *, g_strv_length ((gchar **)system_data_dirs) + 2);
-
-  i = 0;
-  all_data_dirs[i++] = g_strdup (user_data_dir);
-
-  j = 0;
-  while (system_data_dirs[j] != NULL)
-    all_data_dirs[i++] = g_strdup (system_data_dirs[j++]);
-
-  found_file = FALSE;
-  data_dirs = all_data_dirs;
-  output_path = NULL;
-  while (*data_dirs != NULL && !found_file)
-    {
-      g_free (output_path);
-
-      output_path = find_file_in_data_dirs (file, &data_dirs, &file_error);
-      
-      if (file_error)
-        {
-          g_propagate_error (error, file_error);
- 	  break;
-        }
-
-      found_file = libslab_bookmark_file_load_from_file (bookmark,
-      						   output_path,
-      						   &file_error);
-      if (file_error)
-        {
-	  g_propagate_error (error, file_error);
-	  break;
-        }
-    }
-
-  if (found_file && full_path)
-    *full_path = output_path;
-  else 
-    g_free (output_path);
-
-  g_strfreev (all_data_dirs);
-
-  return found_file;
-}
-
-
-/**
- * libslab_bookmark_file_to_data:
- * @bookmark: a #LibSlabBookmarkFile
- * @length: return location for the length of the returned string, or %NULL
- * @error: return location for a #GError, or %NULL
- *
- * This function outputs @bookmark as a string.
- *
- * Return value: a newly allocated string holding
- *   the contents of the #LibSlabBookmarkFile
- *
- * Since: 2.12
- */
-gchar *
-libslab_bookmark_file_to_data (LibSlabBookmarkFile  *bookmark,
-			 gsize          *length,
-			 GError        **error)
-{
-  GError *write_error = NULL;
-  gchar *retval;
-  
-  g_return_val_if_fail (bookmark != NULL, NULL);
-  
-  retval = libslab_bookmark_file_dump (bookmark, length, &write_error);
-  if (write_error)
-    {
-      g_propagate_error (error, write_error);
-      
-      return NULL;
-    }
-      
-  return retval;
-}
-
-/**
- * libslab_bookmark_file_to_file:
- * @bookmark: a #LibSlabBookmarkFile
- * @filename: path of the output file
- * @error: return location for a #GError, or %NULL
- *
- * This function outputs @bookmark into a file.  The write process is
- * guaranteed to be atomic by using g_file_set_contents() internally.
- *
- * Return value: %TRUE if the file was successfully written.
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_to_file (LibSlabBookmarkFile  *bookmark,
-			 const gchar    *filename,
-			 GError        **error)
-{
-  gchar *data;
-  GError *data_error, *write_error;
-  gsize len;
-  gboolean retval;
-
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (filename != NULL, FALSE);
-  
-  data_error = NULL;
-  data = libslab_bookmark_file_to_data (bookmark, &len, &data_error);
-  if (data_error)
-    {
-      g_propagate_error (error, data_error);
-      
-      return FALSE;
-    }
-
-  write_error = NULL;
-  g_file_set_contents (filename, data, len, &write_error);
-  if (write_error)
-    {
-      g_propagate_error (error, write_error);
-      
-      retval = FALSE;
-    }
-  else
-    retval = TRUE;
-
-  g_free (data);
-  
-  return retval;
-}
-
-static BookmarkItem *
-libslab_bookmark_file_lookup_item (LibSlabBookmarkFile *bookmark,
-			     const gchar   *uri)
-{
-  g_assert (bookmark != NULL && uri != NULL);
-  
-  return g_hash_table_lookup (bookmark->items_by_uri, uri);
-}
-
-/* this function adds a new item to the list */
-static void
-libslab_bookmark_file_add_item (LibSlabBookmarkFile  *bookmark,
-			  BookmarkItem   *item,
-			  GError        **error)
-{
-  g_assert (bookmark != NULL);
-  g_assert (item != NULL);
-
-  /* this should never happen; and if it does, then we are
-   * screwing up something big time.
-   */
-  if (G_UNLIKELY (libslab_bookmark_file_has_item (bookmark, item->uri)))
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_INVALID_URI,
-		   _("A bookmark for URI '%s' already exists"),
-		   item->uri);
-      return;
-    }
-  
-  bookmark->items = g_list_prepend (bookmark->items, item);
-  
-  g_hash_table_replace (bookmark->items_by_uri,
-			item->uri,
-			item);
-
-  if (item->added == (time_t) -1)
-    item->added = time (NULL);
-  
-  if (item->modified == (time_t) -1)
-    item->modified = time (NULL);
-}
-
-/**
- * libslab_bookmark_file_remove_item:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @error: return location for a #GError, or %NULL
- *
- * Removes the bookmark for @uri from the bookmark file @bookmark.
- *
- * Return value: %TRUE if the bookmark was removed successfully.
- * 
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_remove_item (LibSlabBookmarkFile  *bookmark,
-			     const gchar    *uri,
-			     GError        **error)
-{
-  BookmarkItem *item;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (uri != NULL, FALSE);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return FALSE;
-    }
-
-  bookmark->items = g_list_remove (bookmark->items, item);
-  g_hash_table_remove (bookmark->items_by_uri, item->uri);  
-  
-  bookmark_item_free (item);
-
-  return TRUE;
-}
-
-/**
- * libslab_bookmark_file_has_item:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- *
- * Looks whether the desktop bookmark has an item with its URI set to @uri.
- *
- * Return value: %TRUE if @uri is inside @bookmark, %FALSE otherwise
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_has_item (LibSlabBookmarkFile *bookmark,
-			  const gchar   *uri)
-{
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (uri != NULL, FALSE);
-  
-  return (NULL != g_hash_table_lookup (bookmark->items_by_uri, uri));
-}
-
-/**
- * libslab_bookmark_file_get_uris:
- * @bookmark: a #LibSlabBookmarkFile
- * @length: return location for the number of returned URIs, or %NULL
- *
- * Returns all URIs of the bookmarks in the bookmark file @bookmark.
- * The array of returned URIs will be %NULL-terminated, so @length may
- * optionally be %NULL.
- *
- * Return value: a newly allocated %NULL-terminated array of strings.
- *   Use g_strfreev() to free it.
- *
- * Since: 2.12
- */
-gchar **
-libslab_bookmark_file_get_uris (LibSlabBookmarkFile *bookmark,
-			  gsize         *length)
-{
-  GList *l;
-  gchar **uris;
-  gsize i, n_items;
-  
-  g_return_val_if_fail (bookmark != NULL, NULL);
-  
-  n_items = g_list_length (bookmark->items); 
-  uris = g_new0 (gchar *, n_items + 1);
-  
-  for (l = g_list_last (bookmark->items), i = 0; l != NULL; l = l->prev)
-    {
-      BookmarkItem *item = (BookmarkItem *) l->data;
-      
-      g_assert (item != NULL);
-      
-      uris[i++] = g_strdup (item->uri);
-    }
-  uris[i] = NULL;
-  
-  if (length)
-    *length = i;
-  
-  return uris;
-}
-
-/**
- * libslab_bookmark_file_set_title:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI or %NULL
- * @title: a UTF-8 encoded string
- *
- * Sets @title as the title of the bookmark for @uri inside the
- * bookmark file @bookmark.
- *
- * If @uri is %NULL, the title of @bookmark is set.
- *
- * If a bookmark for @uri cannot be found then it is created.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_set_title (LibSlabBookmarkFile *bookmark,
-			   const gchar   *uri,
-			   const gchar   *title)
-{
-  g_return_if_fail (bookmark != NULL);
-  
-  if (!uri)
-    {
-      g_free (bookmark->title);
-      bookmark->title = g_strdup (title);
-    }
-  else
-    {
-      BookmarkItem *item;
-      
-      item = libslab_bookmark_file_lookup_item (bookmark, uri);
-      if (!item)
-        {
-          item = bookmark_item_new (uri);
-          libslab_bookmark_file_add_item (bookmark, item, NULL);
-        }
-      
-      g_free (item->title);
-      item->title = g_strdup (title);
-      
-      item->modified = time (NULL);
-    }
-}
-
-/**
- * libslab_bookmark_file_get_title:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI or %NULL
- * @error: return location for a #GError, or %NULL
- *
- * Returns the title of the bookmark for @uri.
- *
- * If @uri is %NULL, the title of @bookmark is returned.
- *
- * In the event the URI cannot be found, %NULL is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * Return value: a newly allocated string or %NULL if the specified
- *   URI cannot be found.
- *
- * Since: 2.12
- */
-gchar *
-libslab_bookmark_file_get_title (LibSlabBookmarkFile  *bookmark,
-			   const gchar    *uri,
-			   GError        **error)
-{
-  BookmarkItem *item;
-  
-  g_return_val_if_fail (bookmark != NULL, NULL);
-  
-  if (!uri)
-    return g_strdup (bookmark->title);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return NULL;
-    }
-  
-  return g_strdup (item->title);
-}
-
-/**
- * libslab_bookmark_file_set_description:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI or %NULL
- * @description: a string
- *
- * Sets @description as the description of the bookmark for @uri.
- *
- * If @uri is %NULL, the description of @bookmark is set.
- *
- * If a bookmark for @uri cannot be found then it is created.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_set_description (LibSlabBookmarkFile *bookmark,
-				 const gchar   *uri,
-				 const gchar   *description)
-{
-  g_return_if_fail (bookmark != NULL);
-
-  if (!uri)
-    {
-      g_free (bookmark->description); 
-      bookmark->description = g_strdup (description);
-    }
-  else
-    {
-      BookmarkItem *item;
-      
-      item = libslab_bookmark_file_lookup_item (bookmark, uri);
-      if (!item)
-        {
-          item = bookmark_item_new (uri);
-          libslab_bookmark_file_add_item (bookmark, item, NULL);
-        }
-      
-      g_free (item->description);
-      item->description = g_strdup (description);
-      
-      item->modified = time (NULL);
-    }
-}
-
-/**
- * libslab_bookmark_file_get_description:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @error: return location for a #GError, or %NULL
- *
- * Retrieves the description of the bookmark for @uri.
- *
- * In the event the URI cannot be found, %NULL is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * Return value: a newly allocated string or %NULL if the specified
- *   URI cannot be found.
- *
- * Since: 2.12
- */
-gchar *
-libslab_bookmark_file_get_description (LibSlabBookmarkFile  *bookmark,
-				 const gchar    *uri,
-				 GError        **error)
-{
-  BookmarkItem *item;
-  
-  g_return_val_if_fail (bookmark != NULL, NULL);
-
-  if (!uri)
-    return g_strdup (bookmark->description);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return NULL;
-    }
-  
-  return g_strdup (item->description);
-}
-
-/**
- * libslab_bookmark_file_set_mime_type:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @mime_type: a MIME type
- *
- * Sets @mime_type as the MIME type of the bookmark for @uri.
- *
- * If a bookmark for @uri cannot be found then it is created.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_set_mime_type (LibSlabBookmarkFile *bookmark,
-			       const gchar   *uri,
-			       const gchar   *mime_type)
-{
-  BookmarkItem *item;
-  
-  g_return_if_fail (bookmark != NULL);
-  g_return_if_fail (uri != NULL);
-  g_return_if_fail (mime_type != NULL);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      item = bookmark_item_new (uri);
-      libslab_bookmark_file_add_item (bookmark, item, NULL);
-    }
-  
-  if (!item->metadata)
-    item->metadata = bookmark_metadata_new ();
-  
-  if (item->metadata->mime_type != NULL)
-    g_free (item->metadata->mime_type);
-  
-  item->metadata->mime_type = g_strdup (mime_type);
-  item->modified = time (NULL);
-}
-
-/**
- * libslab_bookmark_file_get_mime_type:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @error: return location for a #GError, or %NULL
- *
- * Retrieves the MIME type of the resource pointed by @uri.
- *
- * In the event the URI cannot be found, %NULL is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.  In the
- * event that the MIME type cannot be found, %NULL is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_INVALID_VALUE.
- *
- * Return value: a newly allocated string or %NULL if the specified
- *   URI cannot be found.
- *
- * Since: 2.12
- */
-gchar *
-libslab_bookmark_file_get_mime_type (LibSlabBookmarkFile  *bookmark,
-			       const gchar    *uri,
-			       GError        **error)
-{
-  BookmarkItem *item;
-  
-  g_return_val_if_fail (bookmark != NULL, NULL);
-  g_return_val_if_fail (uri != NULL, NULL);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return NULL;
-    }
-  
-  if (!item->metadata)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_INVALID_VALUE,
-		   _("No MIME type defined in the bookmark for URI '%s'"),
-		   uri);
-      return NULL;
-    }
-  
-  return g_strdup (item->metadata->mime_type);
-}
-
-/**
- * libslab_bookmark_file_set_is_private:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @is_private: %TRUE if the bookmark should be marked as private
- *
- * Sets the private flag of the bookmark for @uri.
- *
- * If a bookmark for @uri cannot be found then it is created.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_set_is_private (LibSlabBookmarkFile *bookmark,
-				const gchar   *uri,
-				gboolean       is_private)
-{
-  BookmarkItem *item;
-  
-  g_return_if_fail (bookmark != NULL);
-  g_return_if_fail (uri != NULL);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      item = bookmark_item_new (uri);
-      libslab_bookmark_file_add_item (bookmark, item, NULL);
-    }
-  
-  if (!item->metadata)
-    item->metadata = bookmark_metadata_new ();
-  
-  item->metadata->is_private = (is_private == TRUE);
-  item->modified = time (NULL);
-}
-
-/**
- * libslab_bookmark_file_get_is_private:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @error: return location for a #GError, or %NULL
- *
- * Gets whether the private flag of the bookmark for @uri is set.
- *
- * In the event the URI cannot be found, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.  In the
- * event that the private flag cannot be found, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_INVALID_VALUE.
- *
- * Return value: %TRUE if the private flag is set, %FALSE otherwise.
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_get_is_private (LibSlabBookmarkFile  *bookmark,
-				const gchar    *uri,
-				GError        **error)
-{
-  BookmarkItem *item;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (uri != NULL, FALSE);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return FALSE;
-    }
-  
-  if (!item->metadata)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_INVALID_VALUE,
-		   _("No private flag has been defined in bookmark for URI '%s'"),
-		    uri);
-      return FALSE;
-    }
-  
-  return item->metadata->is_private;
-}
-
-/**
- * libslab_bookmark_file_set_added:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @added: a timestamp or -1 to use the current time
- *
- * Sets the time the bookmark for @uri was added into @bookmark.
- *
- * If no bookmark for @uri is found then it is created.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_set_added (LibSlabBookmarkFile *bookmark,
-			   const gchar   *uri,
-			   time_t         added)
-{
-  BookmarkItem *item;
-  
-  g_return_if_fail (bookmark != NULL);
-  g_return_if_fail (uri != NULL);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      item = bookmark_item_new (uri);
-      libslab_bookmark_file_add_item (bookmark, item, NULL);
-    }
-
-  if (added == (time_t) -1)
-    time (&added);
-  
-  item->added = added;
-  item->modified = added;
-}
-
-/**
- * libslab_bookmark_file_get_added:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @error: return location for a #GError, or %NULL
- *
- * Gets the time the bookmark for @uri was added to @bookmark
- *
- * In the event the URI cannot be found, -1 is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * Return value: a timestamp
- *
- * Since: 2.12
- */
-time_t
-libslab_bookmark_file_get_added (LibSlabBookmarkFile  *bookmark,
-			   const gchar    *uri,
-			   GError        **error)
-{
-  BookmarkItem *item;
-  
-  g_return_val_if_fail (bookmark != NULL, (time_t) -1);
-  g_return_val_if_fail (uri != NULL, (time_t) -1);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return (time_t) -1;
-    }
-  
-  return item->added;
-}
-
-/**
- * libslab_bookmark_file_set_modified:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @modified: a timestamp or -1 to use the current time
- *
- * Sets the last time the bookmark for @uri was last modified.
- *
- * If no bookmark for @uri is found then it is created.
- *
- * The "modified" time should only be set when the bookmark's meta-data
- * was actually changed.  Every function of #LibSlabBookmarkFile that
- * modifies a bookmark also changes the modification time, except for
- * libslab_bookmark_file_set_visited().
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_set_modified (LibSlabBookmarkFile *bookmark,
-			      const gchar   *uri,
-			      time_t         modified)
-{
-  BookmarkItem *item;
-  
-  g_return_if_fail (bookmark != NULL);
-  g_return_if_fail (uri != NULL);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      item = bookmark_item_new (uri);
-      libslab_bookmark_file_add_item (bookmark, item, NULL);
-    }
-  
-  if (modified == (time_t) -1)
-    time (&modified);
-  
-  item->modified = modified;
-}
-
-/**
- * libslab_bookmark_file_get_modified:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @error: return location for a #GError, or %NULL
- *
- * Gets the time when the bookmark for @uri was last modified.
- *
- * In the event the URI cannot be found, -1 is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * Return value: a timestamp
- *
- * Since: 2.12
- */
-time_t
-libslab_bookmark_file_get_modified (LibSlabBookmarkFile  *bookmark,
-			      const gchar    *uri,
-			      GError        **error)
-{
-  BookmarkItem *item;
-  
-  g_return_val_if_fail (bookmark != NULL, (time_t) -1);
-  g_return_val_if_fail (uri != NULL, (time_t) -1);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return (time_t) -1;
-    }
-  
-  return item->modified;
-}
-
-/**
- * libslab_bookmark_file_set_visited:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @visited: a timestamp or -1 to use the current time
- *
- * Sets the time the bookmark for @uri was last visited.
- *
- * If no bookmark for @uri is found then it is created.
- *
- * The "visited" time should only be set if the bookmark was launched, 
- * either using the command line retrieved by libslab_bookmark_file_get_app_info()
- * or by the default application for the bookmark's MIME type, retrieved
- * using libslab_bookmark_file_get_mime_type().  Changing the "visited" time
- * does not affect the "modified" time.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_set_visited (LibSlabBookmarkFile *bookmark,
-			     const gchar   *uri,
-			     time_t         visited)
-{
-  BookmarkItem *item;
-  
-  g_return_if_fail (bookmark != NULL);
-  g_return_if_fail (uri != NULL);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      item = bookmark_item_new (uri);
-      libslab_bookmark_file_add_item (bookmark, item, NULL);
-    }
-
-  if (visited == (time_t) -1)
-    time (&visited);
-  
-  item->visited = visited;
-}
-
-/**
- * libslab_bookmark_file_get_visited:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @error: return location for a #GError, or %NULL
- *
- * Gets the time the bookmark for @uri was last visited.
- *
- * In the event the URI cannot be found, -1 is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * Return value: a timestamp.
- *
- * Since: 2.12
- */
-time_t
-libslab_bookmark_file_get_visited (LibSlabBookmarkFile  *bookmark,
-			     const gchar    *uri,
-			     GError        **error)
-{
-  BookmarkItem *item;
-  
-  g_return_val_if_fail (bookmark != NULL, (time_t) -1);
-  g_return_val_if_fail (uri != NULL, (time_t) -1);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return (time_t) -1;
-    }
-  
-  return item->visited;
-}
-
-/**
- * libslab_bookmark_file_has_group:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @group: the group name to be searched
- * @error: return location for a #GError, or %NULL
- *
- * Checks whether @group appears in the list of groups to which
- * the bookmark for @uri belongs to.
- *
- * In the event the URI cannot be found, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * Return value: %TRUE if @group was found.
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_has_group (LibSlabBookmarkFile  *bookmark,
-			   const gchar    *uri,
-			   const gchar    *group,
-			   GError        **error)
-{
-  BookmarkItem *item;
-  GList *l;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (uri != NULL, FALSE);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return FALSE;
-    }
-  
-  if (!item->metadata)
-    return FALSE;
-   
-  for (l = item->metadata->groups; l != NULL; l = l->next)
-    {
-      if (strcmp (l->data, group) == 0)
-        return TRUE;
-    }
-  
-  return FALSE;
-
-}
-
-/**
- * libslab_bookmark_file_add_group:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @group: the group name to be added
- *
- * Adds @group to the list of groups to which the bookmark for @uri
- * belongs to.
- *
- * If no bookmark for @uri is found then it is created.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_add_group (LibSlabBookmarkFile *bookmark,
-			   const gchar   *uri,
-			   const gchar   *group)
-{
-  BookmarkItem *item;
-  
-  g_return_if_fail (bookmark != NULL);
-  g_return_if_fail (uri != NULL);
-  g_return_if_fail (group != NULL && group[0] != '\0');
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      item = bookmark_item_new (uri);
-      libslab_bookmark_file_add_item (bookmark, item, NULL);
-    }
-  
-  if (!item->metadata)
-    item->metadata = bookmark_metadata_new ();
-  
-  if (!libslab_bookmark_file_has_group (bookmark, uri, group, NULL))
-    {
-      item->metadata->groups = g_list_prepend (item->metadata->groups,
-                                               g_strdup (group));
-      
-      item->modified = time (NULL);
-    }
-}
-
-/**
- * libslab_bookmark_file_remove_group:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @group: the group name to be removed
- * @error: return location for a #GError, or %NULL
- *
- * Removes @group from the list of groups to which the bookmark
- * for @uri belongs to.
- *
- * In the event the URI cannot be found, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- * In the event no group was defined, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_INVALID_VALUE.
- *
- * Return value: %TRUE if @group was successfully removed.
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_remove_group (LibSlabBookmarkFile  *bookmark,
-			      const gchar    *uri,
-			      const gchar    *group,
-			      GError        **error)
-{
-  BookmarkItem *item;
-  GList *l;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (uri != NULL, FALSE);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return FALSE;
-    }
-  
-  if (!item->metadata)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-                   LIBSLAB_BOOKMARK_FILE_ERROR_INVALID_VALUE,
-                   _("No groups set in bookmark for URI '%s'"),
-                   uri);
-      return FALSE;
-    }
-  
-  for (l = item->metadata->groups; l != NULL; l = l->next)
-    {
-      if (strcmp (l->data, group) == 0)
-        {
-          item->metadata->groups = g_list_remove_link (item->metadata->groups, l);
-          g_free (l->data);
-	  g_list_free_1 (l);
-          
-          item->modified = time (NULL);          
-          
-          return TRUE;
-        }
-    }
-  
-  return FALSE;
-}
-
-/**
- * libslab_bookmark_file_set_groups:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: an item's URI
- * @groups: an array of group names, or %NULL to remove all groups
- * @length: number of group name values in @groups
- *
- * Sets a list of group names for the item with URI @uri.  Each previously
- * set group name list is removed.
- *
- * If @uri cannot be found then an item for it is created.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_set_groups (LibSlabBookmarkFile  *bookmark,
-			    const gchar    *uri,
-			    const gchar   **groups,
-			    gsize           length)
-{
-  BookmarkItem *item;
-  gsize i;
-  
-  g_return_if_fail (bookmark != NULL);
-  g_return_if_fail (uri != NULL);
-  g_return_if_fail (groups != NULL);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      item = bookmark_item_new (uri);
-      libslab_bookmark_file_add_item (bookmark, item, NULL);
-    }
-  
-  if (!item->metadata)
-    item->metadata = bookmark_metadata_new ();
-
-  if (item->metadata->groups != NULL)
-    {
-      g_list_foreach (item->metadata->groups,
-		      (GFunc) g_free,
-		      NULL);
-      g_list_free (item->metadata->groups);
-      item->metadata->groups = NULL;
-    }
-  
-  if (groups)
-    {
-      for (i = 0; groups[i] != NULL && i < length; i++)
-        item->metadata->groups = g_list_append (item->metadata->groups,
-					        g_strdup (groups[i]));
-    }
-
-  item->modified = time (NULL);
-}
-
-/**
- * libslab_bookmark_file_get_groups:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @length: return location for the length of the returned string, or %NULL
- * @error: return location for a #GError, or %NULL
- *
- * Retrieves the list of group names of the bookmark for @uri.
- *
- * In the event the URI cannot be found, %NULL is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * The returned array is %NULL terminated, so @length may optionally
- * be %NULL.
- *
- * Return value: a newly allocated %NULL-terminated array of group names.
- *   Use g_strfreev() to free it.
- *
- * Since: 2.12
- */
-gchar **
-libslab_bookmark_file_get_groups (LibSlabBookmarkFile  *bookmark,
-			    const gchar    *uri,
-			    gsize          *length,
-			    GError        **error)
-{
-  BookmarkItem *item;
-  GList *l;
-  gsize len, i;
-  gchar **retval;
-  
-  g_return_val_if_fail (bookmark != NULL, NULL);
-  g_return_val_if_fail (uri != NULL, NULL);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return NULL;
-    }
-  
-  if (!item->metadata)
-    {
-      if (length)
-	*length = 0;
-      
-      return NULL;
-    }
-  
-  len = g_list_length (item->metadata->groups);
-  retval = g_new0 (gchar *, len + 1);
-  for (l = g_list_last (item->metadata->groups), i = 0;
-       l != NULL;
-       l = l->prev)
-    {
-      gchar *group_name = (gchar *) l->data;
-      
-      g_assert (group_name != NULL);
-      
-      retval[i++] = g_strdup (group_name);
-    }
-  retval[i] = NULL;
-  
-  if (length)
-    *length = len;
-  
-  return retval;
-}
-
-/**
- * libslab_bookmark_file_add_application:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @name: the name of the application registering the bookmark
- *   or %NULL
- * @exec: command line to be used to launch the bookmark or %NULL
- *
- * Adds the application with @name and @exec to the list of
- * applications that have registered a bookmark for @uri into
- * @bookmark.
- *
- * Every bookmark inside a #LibSlabBookmarkFile must have at least an
- * application registered.  Each application must provide a name, a
- * command line useful for launching the bookmark, the number of times
- * the bookmark has been registered by the application and the last
- * time the application registered this bookmark.
- *
- * If @name is %NULL, the name of the application will be the
- * same returned by g_get_application(); if @exec is %NULL, the
- * command line will be a composition of the program name as
- * returned by g_get_prgname() and the "%u" modifier, which will be
- * expanded to the bookmark's URI.
- *
- * This function will automatically take care of updating the
- * registrations count and timestamping in case an application
- * with the same @name had already registered a bookmark for
- * @uri inside @bookmark.
- *
- * If no bookmark for @uri is found, one is created.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_add_application (LibSlabBookmarkFile *bookmark,
-				 const gchar   *uri,
-				 const gchar   *name,
-				 const gchar   *exec)
-{
-  BookmarkItem *item;
-  gchar *app_name, *app_exec;
-  
-  g_return_if_fail (bookmark != NULL);
-  g_return_if_fail (uri != NULL);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      item = bookmark_item_new (uri);
-      libslab_bookmark_file_add_item (bookmark, item, NULL);
-    }
-  
-  if (name && name[0] != '\0')
-    app_name = g_strdup (name);
-  else
-    app_name = g_strdup (g_get_application_name ());
-  
-  if (exec && exec[0] != '\0')
-    app_exec = g_strdup (exec);
-  else
-    app_exec = g_strjoin (" ", g_get_prgname(), "%u", NULL);
-
-  libslab_bookmark_file_set_app_info (bookmark, uri,
-                                app_name,
-                                app_exec,
-                                -1,
-                                (time_t) -1,
-                                NULL);
-  
-  g_free (app_exec);
-  g_free (app_name);
-}
-
-/**
- * libslab_bookmark_file_remove_application:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @name: the name of the application
- * @error: return location for a #GError or %NULL
- *
- * Removes application registered with @name from the list of applications
- * that have registered a bookmark for @uri inside @bookmark.
- *
- * In the event the URI cannot be found, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- * In the event that no application with name @app_name has registered
- * a bookmark for @uri,  %FALSE is returned and error is set to
- * #LIBSLAB_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED.
- *
- * Return value: %TRUE if the application was successfully removed.
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_remove_application (LibSlabBookmarkFile  *bookmark,
-				    const gchar    *uri,
-				    const gchar    *name,
-				    GError        **error)
-{
-  GError *set_error;
-  gboolean retval;
-    
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (uri != NULL, FALSE);
-  g_return_val_if_fail (name != NULL, FALSE);
-  
-  set_error = NULL;
-  retval = libslab_bookmark_file_set_app_info (bookmark, uri,
-  					 name,
-  					 "",
-	  				 0,
-  					 (time_t) -1,
-  					 &set_error);
-  if (set_error)
-    {
-      g_propagate_error (error, set_error);
-      
-      return FALSE;
-    }
-  
-  return retval;
-}
-
-/**
- * libslab_bookmark_file_has_application:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @name: the name of the application
- * @error: return location for a #GError or %NULL
- *
- * Checks whether the bookmark for @uri inside @bookmark has been
- * registered by application @name.
- *
- * In the event the URI cannot be found, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * Return value: %TRUE if the application @name was found
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_has_application (LibSlabBookmarkFile  *bookmark,
-				 const gchar    *uri,
-				 const gchar    *name,
-				 GError        **error)
-{
-  BookmarkItem *item;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (uri != NULL, FALSE);
-  g_return_val_if_fail (name != NULL, FALSE);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return FALSE;
-    }
-  
-  return (NULL != bookmark_item_lookup_app_info (item, name));
-}
-
-/**
- * libslab_bookmark_file_set_app_info:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @name: an application's name
- * @exec: an application's command line
- * @count: the number of registrations done for this application
- * @stamp: the time of the last registration for this application
- * @error: return location for a #GError or %NULL
- *
- * Sets the meta-data of application @name inside the list of
- * applications that have registered a bookmark for @uri inside
- * @bookmark.
- *
- * You should rarely use this function; use libslab_bookmark_file_add_application()
- * and libslab_bookmark_file_remove_application() instead.
- *
- * @name can be any UTF-8 encoded string used to identify an
- * application.
- * @exec can have one of these two modifiers: "%f", which will
- * be expanded as the local file name retrieved from the bookmark's
- * URI; "%u", which will be expanded as the bookmark's URI.
- * The expansion is done automatically when retrieving the stored
- * command line using the libslab_bookmark_file_get_app_info() function.
- * @count is the number of times the application has registered the
- * bookmark; if is < 0, the current registration count will be increased
- * by one, if is 0, the application with @name will be removed from
- * the list of registered applications.
- * @stamp is the Unix time of the last registration; if it is -1, the
- * current time will be used.
- *
- * If you try to remove an application by setting its registration count to
- * zero, and no bookmark for @uri is found, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND; similarly,
- * in the event that no application @name has registered a bookmark
- * for @uri,  %FALSE is returned and error is set to
- * #LIBSLAB_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED.  Otherwise, if no bookmark
- * for @uri is found, one is created.
- *
- * Return value: %TRUE if the application's meta-data was successfully
- *   changed.
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_set_app_info (LibSlabBookmarkFile  *bookmark,
-			      const gchar    *uri,
-			      const gchar    *name,
-			      const gchar    *exec,
-			      gint            count,
-			      time_t          stamp,
-			      GError        **error)
-{
-  BookmarkItem *item;
-  BookmarkAppInfo *ai;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (uri != NULL, FALSE);
-  g_return_val_if_fail (name != NULL, FALSE);
-  g_return_val_if_fail (exec != NULL, FALSE);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      if (count == 0)
-        {
-          g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		       LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		       _("No bookmark found for URI '%s'"),
-		       uri);
-	  return FALSE;
-	}
-      else
-        {
-          item = bookmark_item_new (uri);
-	  libslab_bookmark_file_add_item (bookmark, item, NULL);
-	}
-    }
-  
-  ai = bookmark_item_lookup_app_info (item, name);
-  if (!ai)
-    {
-      if (count == 0)
-        {
-          g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		       LIBSLAB_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED,
-		       _("No application with name '%s' registered a bookmark for '%s'"),
-		       name,
-		       uri);
-          return FALSE;
-        }
-      else
-        {
-          ai = bookmark_app_info_new (name);
-          
-          item->metadata->applications = g_list_prepend (item->metadata->applications, ai);
-          g_hash_table_replace (item->metadata->apps_by_name, ai->name, ai);
-        }
-    }
-
-  if (count == 0)
-    {
-      item->metadata->applications = g_list_remove (item->metadata->applications, ai);
-      g_hash_table_remove (item->metadata->apps_by_name, ai->name);
-      bookmark_app_info_free (ai);
-
-      item->modified = time (NULL);
-          
-      return TRUE;
-    }
-  else if (count > 0)
-    ai->count = count;
-  else
-    ai->count += 1;
-      
-  if (stamp != (time_t) -1)
-    ai->stamp = stamp;
-  else
-    ai->stamp = time (NULL);
-  
-  if (exec && exec[0] != '\0')
-    {
-      g_free (ai->exec);
-      ai->exec = g_strdup (exec);
-    }
-  
-  item->modified = time (NULL);
-  
-  return TRUE;
-}
-
-/* expands the application's command line */
-static gchar *
-expand_exec_line (const gchar *exec_fmt,
-		  const gchar *uri)
-{
-  GString *exec;
-  gchar ch;
-  
-  exec = g_string_new (NULL);
-  while ((ch = *exec_fmt++) != '\0')
-   {
-     if (ch != '%')
-       {
-         exec = g_string_append_c (exec, ch);
-         continue;
-       }
-     
-     ch = *exec_fmt++;
-     switch (ch)
-       {
-       case '\0':
-	 goto out;
-       case 'u':
-         g_string_append (exec, uri);
-         break;
-       case 'f':
-         {
-	   gchar *file = g_filename_from_uri (uri, NULL, NULL);
-	   g_string_append (exec, file);
-	   g_free (file);
-         }
-         break;
-       case '%':
-       default:
-         exec = g_string_append_c (exec, ch);
-         break;
-       }
-   }
-   
- out:
-  return g_string_free (exec, FALSE);
-}
-
-/**
- * libslab_bookmark_file_get_app_info:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @name: an application's name
- * @exec: location for the command line of the application, or %NULL
- * @count: return location for the registration count, or %NULL
- * @stamp: return location for the last registration time, or %NULL
- * @error: return location for a #GError, or %NULL
- *
- * Gets the registration informations of @app_name for the bookmark for
- * @uri.  See libslab_bookmark_file_set_app_info() for more informations about
- * the returned data.
- *
- * The string returned in @app_exec must be freed.
- *
- * In the event the URI cannot be found, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.  In the
- * event that no application with name @app_name has registered a bookmark
- * for @uri,  %FALSE is returned and error is set to
- * #LIBSLAB_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED.
- *
- * Return value: %TRUE on success.
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_get_app_info (LibSlabBookmarkFile  *bookmark,
-			      const gchar    *uri,
-			      const gchar    *name,
-			      gchar         **exec,
-			      guint          *count,
-			      time_t         *stamp,
-			      GError        **error)
-{
-  BookmarkItem *item;
-  BookmarkAppInfo *ai;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (uri != NULL, FALSE);
-  g_return_val_if_fail (name != NULL, FALSE);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return FALSE;
-    }
-  
-  ai = bookmark_item_lookup_app_info (item, name);
-  if (!ai)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED,
-		   _("No application with name '%s' registered a bookmark for '%s'"),
-		   name,
-		   uri);
-      return FALSE;
-    }
-  
-  if (exec)
-    *exec = expand_exec_line (ai->exec, uri);
-  
-  if (count)
-    *count = ai->count;
-  
-  if (stamp)
-    *stamp = ai->stamp;
-  
-  return TRUE;
-}
-
-/**
- * libslab_bookmark_file_get_applications:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @length: return location of the length of the returned list, or %NULL
- * @error: return location for a #GError, or %NULL
- *
- * Retrieves the names of the applications that have registered the
- * bookmark for @uri.
- * 
- * In the event the URI cannot be found, %NULL is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * Return value: a newly allocated %NULL-terminated array of strings.
- *   Use g_strfreev() to free it.
- *
- * Since: 2.12
- */
-gchar **
-libslab_bookmark_file_get_applications (LibSlabBookmarkFile  *bookmark,
-				  const gchar    *uri,
-				  gsize          *length,
-				  GError        **error)
-{
-  BookmarkItem *item;
-  GList *l;
-  gchar **apps;
-  gsize i, n_apps;
-  
-  g_return_val_if_fail (bookmark != NULL, NULL);
-  g_return_val_if_fail (uri != NULL, NULL);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return NULL;
-    }
-  
-  if (!item->metadata)
-    {	   
-      if (length)
-	*length = 0;
-      
-      return NULL;
-    }
-  
-  n_apps = g_list_length (item->metadata->applications);
-  apps = g_new0 (gchar *, n_apps + 1);
-  
-  for (l = g_list_last (item->metadata->applications), i = 0;
-       l != NULL;
-       l = l->prev)
-    {
-      BookmarkAppInfo *ai;
-      
-      ai = (BookmarkAppInfo *) l->data;
-      
-      g_assert (ai != NULL);
-      g_assert (ai->name != NULL);
-      
-      apps[i++] = g_strdup (ai->name);
-    }
-  apps[i] = NULL;
-  
-  if (length)
-    *length = i;
-  
-  return apps;
-}
-
-/**
- * libslab_bookmark_file_get_size:
- * @bookmark: a #LibSlabBookmarkFile
- * 
- * Gets the number of bookmarks inside @bookmark.
- * 
- * Return value: the number of bookmarks
- *
- * Since: 2.12
- */
-gint
-libslab_bookmark_file_get_size (LibSlabBookmarkFile *bookmark)
-{
-  g_return_val_if_fail (bookmark != NULL, 0);
-
-  return g_list_length (bookmark->items);
-}
-
-/**
- * libslab_bookmark_file_move_item:
- * @bookmark: a #LibSlabBookmarkFile
- * @old_uri: a valid URI
- * @new_uri: a valid URI, or %NULL
- * @error: return location for a #GError or %NULL
- *
- * Changes the URI of a bookmark item from @old_uri to @new_uri.  Any
- * existing bookmark for @new_uri will be overwritten.  If @new_uri is
- * %NULL, then the bookmark is removed.
- *
- * In the event the URI cannot be found, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * Return value: %TRUE if the URI was successfully changed
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_move_item (LibSlabBookmarkFile  *bookmark,
-			   const gchar    *old_uri,
-			   const gchar    *new_uri,
-			   GError        **error)
-{
-  BookmarkItem *item;
-  GError *remove_error;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (old_uri != NULL, FALSE);
-
-  item = libslab_bookmark_file_lookup_item (bookmark, old_uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   old_uri);
-      return FALSE;
-    }
-
-  if (new_uri && new_uri[0] != '\0')
-    {
-      if (libslab_bookmark_file_has_item (bookmark, new_uri))
-        {
-          remove_error = NULL;
-          libslab_bookmark_file_remove_item (bookmark, new_uri, &remove_error);
-          if (remove_error)
-            {
-              g_propagate_error (error, remove_error);
-              
-              return FALSE;
-            }
-        }
-
-      g_hash_table_steal (bookmark->items_by_uri, item->uri);
-      
-      g_free (item->uri);
-      item->uri = g_strdup (new_uri);
-      item->modified = time (NULL);
-
-      g_hash_table_replace (bookmark->items_by_uri, item->uri, item);
-
-      return TRUE;
-    }
-  else
-    {
-      remove_error = NULL;
-      libslab_bookmark_file_remove_item (bookmark, old_uri, &remove_error);
-      if (remove_error)
-        {
-          g_propagate_error (error, remove_error);
-          
-          return FALSE;
-        }
-
-      return TRUE;
-    }
-}
-
-/**
- * libslab_bookmark_file_set_icon:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @href: the URI of the icon for the bookmark, or %NULL
- * @mime_type: the MIME type of the icon for the bookmark
- *
- * Sets the icon for the bookmark for @uri.  If @href is %NULL, unsets
- * the currently set icon.
- *
- * If no bookmark for @uri is found it is created.
- *
- * Since: 2.12
- */
-void
-libslab_bookmark_file_set_icon (LibSlabBookmarkFile *bookmark,
-			  const gchar   *uri,
-			  const gchar   *href,
-			  const gchar   *mime_type)
-{
-  BookmarkItem *item;
-  
-  g_return_if_fail (bookmark != NULL);
-  g_return_if_fail (uri != NULL);
-
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      item = bookmark_item_new (uri);
-      libslab_bookmark_file_add_item (bookmark, item, NULL);
-    }
-  
-  if (!item->metadata)
-    item->metadata = bookmark_metadata_new ();
-  
-  g_free (item->metadata->icon_href);
-  g_free (item->metadata->icon_mime);
-  
-  item->metadata->icon_href = g_strdup (href);
-  
-  if (mime_type && mime_type[0] != '\0')
-    item->metadata->icon_mime = g_strdup (mime_type);
-  else
-    item->metadata->icon_mime = g_strdup ("application/octet-stream");
-  
-  item->modified = time (NULL);
-}
-
-/**
- * libslab_bookmark_file_get_icon:
- * @bookmark: a #LibSlabBookmarkFile
- * @uri: a valid URI
- * @href: return location for the icon's location or %NULL
- * @mime_type: return location for the icon's MIME type or %NULL
- * @error: return location for a #GError or %NULL
- *
- * Gets the icon of the bookmark for @uri.
- *
- * In the event the URI cannot be found, %FALSE is returned and
- * @error is set to #LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- *
- * Return value: %TRUE if the icon for the bookmark for the URI was found.
- *   You should free the returned strings.
- *
- * Since: 2.12
- */
-gboolean
-libslab_bookmark_file_get_icon (LibSlabBookmarkFile  *bookmark,
-			  const gchar    *uri,
-			  gchar         **href,
-			  gchar         **mime_type,
-			  GError        **error)
-{
-  BookmarkItem *item;
-  
-  g_return_val_if_fail (bookmark != NULL, FALSE);
-  g_return_val_if_fail (uri != NULL, FALSE);
-  
-  item = libslab_bookmark_file_lookup_item (bookmark, uri);
-  if (!item)
-    {
-      g_set_error (error, LIBSLAB_BOOKMARK_FILE_ERROR,
-		   LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-		   _("No bookmark found for URI '%s'"),
-		   uri);
-      return FALSE;
-    }
-  
-  if ((!item->metadata) || (!item->metadata->icon_href))
-    return FALSE;
-  
-  if (href)
-    *href = g_strdup (item->metadata->icon_href);
-  
-  if (mime_type)
-    *mime_type = g_strdup (item->metadata->icon_mime);
-  
-  return TRUE;
-}
diff --git a/libslab/libslab-bookmarkfile.h b/libslab/libslab-bookmarkfile.h
deleted file mode 100644
index 0b4b796..0000000
--- a/libslab/libslab-bookmarkfile.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/* gbookmarkfile.h: parsing and building desktop bookmarks
- *
- * Copyright (C) 2005-2006 Emmanuele Bassi
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- */
-
-#ifndef __LIBSLAB_BOOKMARK_FILE_H__
-#define __LIBSLAB_BOOKMARK_FILE_H__
-
-#include <glib/gerror.h>
-#include <time.h>
-
-G_BEGIN_DECLS
-
-/* GError enumeration
- */
-#define LIBSLAB_BOOKMARK_FILE_ERROR	(libslab_bookmark_file_error_quark ())
-
-typedef enum
-{
-  LIBSLAB_BOOKMARK_FILE_ERROR_INVALID_URI,
-  LIBSLAB_BOOKMARK_FILE_ERROR_INVALID_VALUE,
-  LIBSLAB_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED,
-  LIBSLAB_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
-  LIBSLAB_BOOKMARK_FILE_ERROR_READ,
-  LIBSLAB_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING,
-  LIBSLAB_BOOKMARK_FILE_ERROR_WRITE,
-  LIBSLAB_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND
-} LibSlabBookmarkFileError;
-
-GQuark libslab_bookmark_file_error_quark (void);
-
-/*
- * LibSlabBookmarkFile
- */
-typedef struct _LibSlabBookmarkFile LibSlabBookmarkFile;
-
-LibSlabBookmarkFile *libslab_bookmark_file_new                 (void);
-void           libslab_bookmark_file_free                (LibSlabBookmarkFile  *bookmark);
-
-gboolean       libslab_bookmark_file_load_from_file      (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *filename,
-						    GError        **error);
-gboolean       libslab_bookmark_file_load_from_data      (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *data,
-						    gsize           length,
-						    GError        **error);
-gboolean       libslab_bookmark_file_load_from_data_dirs (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *file,
-						    gchar         **full_path,
-						    GError        **error);
-gchar *        libslab_bookmark_file_to_data             (LibSlabBookmarkFile  *bookmark,
-						    gsize          *length,
-						    GError        **error) G_GNUC_MALLOC;
-gboolean       libslab_bookmark_file_to_file             (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *filename,
-						    GError        **error);
-
-void           libslab_bookmark_file_set_title           (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *title);
-gchar *        libslab_bookmark_file_get_title           (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    GError        **error) G_GNUC_MALLOC;
-void           libslab_bookmark_file_set_description     (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *description);
-gchar *        libslab_bookmark_file_get_description     (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    GError        **error) G_GNUC_MALLOC;
-void           libslab_bookmark_file_set_mime_type       (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *mime_type);
-gchar *        libslab_bookmark_file_get_mime_type       (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    GError        **error) G_GNUC_MALLOC;
-void           libslab_bookmark_file_set_groups          (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar   **groups,
-						    gsize           length);
-void           libslab_bookmark_file_add_group           (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *group);
-gboolean       libslab_bookmark_file_has_group           (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *group,
-						    GError        **error);
-gchar **       libslab_bookmark_file_get_groups          (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    gsize          *length,
-						    GError        **error) G_GNUC_MALLOC;
-void           libslab_bookmark_file_add_application     (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *name,
-						    const gchar    *exec);
-gboolean       libslab_bookmark_file_has_application     (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *name,
-						    GError        **error);
-gchar **       libslab_bookmark_file_get_applications    (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    gsize          *length,
-						    GError        **error) G_GNUC_MALLOC;
-gboolean       libslab_bookmark_file_set_app_info        (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *name,
-						    const gchar    *exec,
-						    gint            count,
-						    time_t          stamp,
-						    GError        **error);
-gboolean       libslab_bookmark_file_get_app_info        (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *name,
-						    gchar         **exec,
-						    guint          *count,
-						    time_t         *stamp,
-						    GError        **error);
-void           libslab_bookmark_file_set_is_private      (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    gboolean        is_private);
-gboolean       libslab_bookmark_file_get_is_private      (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    GError        **error);
-void           libslab_bookmark_file_set_icon            (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *href,
-						    const gchar    *mime_type);
-gboolean       libslab_bookmark_file_get_icon            (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    gchar         **href,
-						    gchar         **mime_type,
-						    GError        **error);
-void           libslab_bookmark_file_set_added           (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    time_t          added);
-time_t         libslab_bookmark_file_get_added           (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    GError        **error);
-void           libslab_bookmark_file_set_modified        (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    time_t          modified);
-time_t         libslab_bookmark_file_get_modified        (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    GError        **error);
-void           libslab_bookmark_file_set_visited         (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    time_t          visited);
-time_t         libslab_bookmark_file_get_visited         (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri, 
-						    GError        **error);
-gboolean       libslab_bookmark_file_has_item            (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri);
-gint           libslab_bookmark_file_get_size            (LibSlabBookmarkFile  *bookmark);
-gchar **       libslab_bookmark_file_get_uris            (LibSlabBookmarkFile  *bookmark,
-						    gsize          *length) G_GNUC_MALLOC;
-gboolean       libslab_bookmark_file_remove_group        (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *group,
-						    GError        **error);
-gboolean       libslab_bookmark_file_remove_application  (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    const gchar    *name,
-						    GError        **error);
-gboolean       libslab_bookmark_file_remove_item         (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *uri,
-						    GError        **error);
-gboolean       libslab_bookmark_file_move_item           (LibSlabBookmarkFile  *bookmark,
-						    const gchar    *old_uri,
-						    const gchar    *new_uri,
-						    GError        **error);
-
-G_END_DECLS
-
-#endif /* __LIBSLAB_BOOKMARK_FILE_H__ */
diff --git a/libslab/recent-files.c b/libslab/recent-files.c
index b104b43..88539e7 100644
--- a/libslab/recent-files.c
+++ b/libslab/recent-files.c
@@ -20,16 +20,8 @@
 
 #include "recent-files.h"
 
-#include <gtk/gtkversion.h>
-#if GTK_CHECK_VERSION (2, 10, 0)
-#	define USE_GTK_RECENT_MANAGER
-
-#	include <gtk/gtkrecentmanager.h>
-#	include <gio/gio.h>
-#else
-#	define EGG_ENABLE_RECENT_FILES
-#	include "egg-recent-model.h"
-#endif
+#include <gtk/gtk.h>
+#include <gio/gio.h>
 
 G_DEFINE_TYPE (MainMenuRecentMonitor, main_menu_recent_monitor, G_TYPE_OBJECT)
 G_DEFINE_TYPE (MainMenuRecentFile,    main_menu_recent_file,    G_TYPE_OBJECT)
@@ -38,24 +30,13 @@ G_DEFINE_TYPE (MainMenuRecentFile,    main_menu_recent_file,    G_TYPE_OBJECT)
 #define MAIN_MENU_RECENT_FILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MAIN_MENU_RECENT_FILE_TYPE, MainMenuRecentFilePrivate))
 
 typedef struct {
-#ifdef USE_GTK_RECENT_MANAGER
 	GFileMonitor *monitor;
-#else
-	EggRecentModel *model;
-#endif
 
 	gulong changed_handler_id;
 } MainMenuRecentMonitorPrivate;
 
 typedef struct {
-#ifdef USE_GTK_RECENT_MANAGER
 	GtkRecentInfo *item_obj;
-#else
-	EggRecentItem *item_obj;
-
-	gchar  *uri;
-	gchar  *mime_type;
-#endif
 } MainMenuRecentFilePrivate;
 
 enum {
@@ -70,15 +51,11 @@ static void main_menu_recent_file_finalize    (GObject *);
 
 static GList *get_files (MainMenuRecentMonitor *, gboolean);
 
-#ifdef USE_GTK_RECENT_MANAGER
 static void
 recent_file_store_monitor_cb (GFileMonitor *, GFile *,
                               GFile *, GFileMonitorEvent, gpointer);
 
 static gint recent_item_mru_comp_func (gconstpointer, gconstpointer);
-#else
-static void recent_file_store_changed_cb (EggRecentModel *, GList *, gpointer);
-#endif
 
 static void
 main_menu_recent_monitor_class_init (MainMenuRecentMonitorClass *this_class)
@@ -109,9 +86,7 @@ main_menu_recent_monitor_init (MainMenuRecentMonitor *this)
 {
 	MainMenuRecentMonitorPrivate *priv = MAIN_MENU_RECENT_MONITOR_GET_PRIVATE (this);
 
-#ifndef USE_GTK_RECENT_MANAGER
 	priv->model = NULL;
-#endif
 
 	priv->changed_handler_id = 0;
 }
@@ -123,10 +98,8 @@ main_menu_recent_file_init (MainMenuRecentFile *this)
 
 	priv->item_obj = NULL;
 
-#ifndef USE_GTK_RECENT_MANAGER
 	priv->uri       = NULL;
 	priv->mime_type = NULL;
-#endif
 }
 
 static void
@@ -134,14 +107,8 @@ main_menu_recent_monitor_finalize (GObject *g_object)
 {
 	MainMenuRecentMonitorPrivate *priv = MAIN_MENU_RECENT_MONITOR_GET_PRIVATE (g_object);
 
-#ifdef USE_GTK_RECENT_MANAGER
 	g_file_monitor_cancel (priv->monitor);
 	g_object_unref (priv->monitor);
-#else
-	g_signal_handler_disconnect (priv->model, priv->changed_handler_id);
-
-	g_object_unref (priv->model);
-#endif
 
 	(* G_OBJECT_CLASS (main_menu_recent_monitor_parent_class)->finalize) (g_object);
 }
@@ -151,16 +118,8 @@ main_menu_recent_file_finalize (GObject *g_object)
 {
 	MainMenuRecentFilePrivate *priv = MAIN_MENU_RECENT_FILE_GET_PRIVATE (g_object);
 
-#ifdef USE_GTK_RECENT_MANAGER
 	if (priv->item_obj)
 		gtk_recent_info_unref (priv->item_obj);
-#else
-	if (priv->item_obj)
-		egg_recent_item_unref (priv->item_obj);
-
-	g_free (priv->uri);
-	g_free (priv->mime_type);
-#endif
 
 	(* G_OBJECT_CLASS (main_menu_recent_file_parent_class)->finalize) (g_object);
 }
@@ -171,7 +130,6 @@ main_menu_recent_monitor_new ()
 	MainMenuRecentMonitor *this = g_object_new (MAIN_MENU_RECENT_MONITOR_TYPE, NULL);
 	MainMenuRecentMonitorPrivate *priv = MAIN_MENU_RECENT_MONITOR_GET_PRIVATE (this);
 
-#ifdef USE_GTK_RECENT_MANAGER
 	GtkRecentManager *manager;
 	gchar *store_path;
 	GFile *store_file;
@@ -192,13 +150,6 @@ main_menu_recent_monitor_new ()
 	g_free (store_path);
 	g_object_unref (store_file);
 
-#else
-	priv->model = egg_recent_model_new (EGG_RECENT_MODEL_SORT_NONE);
-
-	priv->changed_handler_id = g_signal_connect (
-		priv->model, "changed", G_CALLBACK (recent_file_store_changed_cb), this);
-#endif
-
 	return this;
 }
 
@@ -208,15 +159,11 @@ get_files (MainMenuRecentMonitor *this, gboolean apps)
 	GList *list;
 	GList *items;
 
-#ifdef USE_GTK_RECENT_MANAGER
 	GtkRecentManager *manager = gtk_recent_manager_get_default ();
 
 	GtkRecentInfo *info;
 
 	gboolean include;
-#else
-	MainMenuRecentMonitorPrivate *priv = MAIN_MENU_RECENT_MONITOR_GET_PRIVATE (this);
-#endif
 
 	MainMenuRecentFile *item;
 	MainMenuRecentFilePrivate *item_priv;
@@ -224,18 +171,7 @@ get_files (MainMenuRecentMonitor *this, gboolean apps)
 	GList *node;
 
 
-#ifdef USE_GTK_RECENT_MANAGER
 	list = gtk_recent_manager_get_items (manager);
-#else
-	egg_recent_model_set_sort (priv->model, EGG_RECENT_MODEL_SORT_MRU);
-
-	if (apps)
-		egg_recent_model_set_filter_groups (priv->model, "recently-used-apps", NULL);
-	else
-		egg_recent_model_set_filter_groups (priv->model, NULL);
-
-	list = egg_recent_model_get_list (priv->model);
-#endif
 
 	items = NULL;
 
@@ -243,7 +179,6 @@ get_files (MainMenuRecentMonitor *this, gboolean apps)
 		item = g_object_new (MAIN_MENU_RECENT_FILE_TYPE, NULL);
 		item_priv = MAIN_MENU_RECENT_FILE_GET_PRIVATE (item);
 
-#ifdef USE_GTK_RECENT_MANAGER
 		info = (GtkRecentInfo *) node->data;
 
 		include = (apps && gtk_recent_info_has_group (info, "recently-used-apps")) ||
@@ -256,12 +191,6 @@ get_files (MainMenuRecentMonitor *this, gboolean apps)
 		}
 		else
 			g_object_unref (item);
-
-#else
-		item_priv->item_obj = (EggRecentItem *) node->data;
-
-		items = g_list_append (items, item);
-#endif
 	}
 
 	g_list_free (list);
@@ -287,14 +216,7 @@ main_menu_recent_file_get_uri (MainMenuRecentFile *this)
 {
 	MainMenuRecentFilePrivate *priv = MAIN_MENU_RECENT_FILE_GET_PRIVATE (this);
 
-#ifdef USE_GTK_RECENT_MANAGER
 	return gtk_recent_info_get_uri (priv->item_obj);
-#else
-	if (! priv->uri)
-		priv->uri = egg_recent_item_get_uri (priv->item_obj);
-
-	return priv->uri;
-#endif
 }
 
 const gchar *
@@ -302,14 +224,7 @@ main_menu_recent_file_get_mime_type (MainMenuRecentFile *this)
 {
 	MainMenuRecentFilePrivate *priv = MAIN_MENU_RECENT_FILE_GET_PRIVATE (this);
 
-#ifdef USE_GTK_RECENT_MANAGER
 	return gtk_recent_info_get_mime_type (priv->item_obj);
-#else
-	if (! priv->mime_type)
-		priv->mime_type = egg_recent_item_get_mime_type (priv->item_obj);
-
-	return priv->mime_type;
-#endif
 }
 
 time_t
@@ -317,17 +232,12 @@ main_menu_recent_file_get_modified (MainMenuRecentFile *this)
 {
 	MainMenuRecentFilePrivate *priv = MAIN_MENU_RECENT_FILE_GET_PRIVATE (this);
 
-#ifdef USE_GTK_RECENT_MANAGER
 	return gtk_recent_info_get_modified (priv->item_obj);
-#else
-	return egg_recent_item_get_timestamp (priv->item_obj);
-#endif
 }
 
 void
 main_menu_rename_recent_file (MainMenuRecentMonitor *this, const gchar *uri_0, const gchar *uri_1)
 {
-#ifdef USE_GTK_RECENT_MANAGER
 	GtkRecentManager *manager;
 
 	GError *error = NULL;
@@ -342,18 +252,11 @@ main_menu_rename_recent_file (MainMenuRecentMonitor *this, const gchar *uri_0, c
 
 		g_error_free (error);
 	}
-#else
-	MainMenuRecentMonitorPrivate *priv = MAIN_MENU_RECENT_MONITOR_GET_PRIVATE (this);
-
-	egg_recent_model_delete (priv->model, uri_0);
-	egg_recent_model_add    (priv->model, uri_1);
-#endif
 }
 
 void
 main_menu_remove_recent_file (MainMenuRecentMonitor *this, const gchar *uri)
 {
-#ifdef USE_GTK_RECENT_MANAGER
 	GtkRecentManager *manager;
 
 	GError *error = NULL;
@@ -368,14 +271,8 @@ main_menu_remove_recent_file (MainMenuRecentMonitor *this, const gchar *uri)
 
 		g_error_free (error);
 	}
-#else
-	MainMenuRecentMonitorPrivate *priv = MAIN_MENU_RECENT_MONITOR_GET_PRIVATE (this);
-
-	egg_recent_model_delete (priv->model, uri);
-#endif
 }
 
-#ifdef USE_GTK_RECENT_MANAGER
 static void
 recent_file_store_monitor_cb (
 	GFileMonitor *mon, GFile *f1,
@@ -383,17 +280,7 @@ recent_file_store_monitor_cb (
 {
 	g_signal_emit ((MainMenuRecentMonitor *) user_data, monitor_signals [STORE_CHANGED], 0);
 }
-#else
-
-static void
-recent_file_store_changed_cb (EggRecentModel *model, GList *list, gpointer user_data)
-{
-	g_signal_emit ((MainMenuRecentMonitor *) user_data, monitor_signals [STORE_CHANGED], 0);
-}
-
-#endif
 
-#ifdef USE_GTK_RECENT_MANAGER
 static gint
 recent_item_mru_comp_func (gconstpointer a, gconstpointer b)
 {
@@ -405,4 +292,3 @@ recent_item_mru_comp_func (gconstpointer a, gconstpointer b)
 
 	return modified_b - modified_a;
 }
-#endif
