Commit 65ddedd1 authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Federico Mena Quintero
Browse files

Merged from 2.4:

2004-08-18  Federico Mena Quintero  <federico@ximian.com>

	Merged from 2.4:

	Fixes #149251:

	* gtk/gtkfilechooserdefault.c: Renamed SHORTCUTS_COL_PATH to
	SHORTCUTS_COL_DATA.  Add SHORTCUTS_COL_IS_VOLUME, to determine
	easily whether the SHORTCUTS_COL_DATA points to a GtkFilePath or a
	GtkFileSystemVolume.
	(shortcuts_model_create): Create a boolean column for
	SHORTCUTS_COL_IS_VOLUME.
	(shortcuts_reload_icons): Simplify with the use of the
	SHORTCUTS_COL_IS_VOLUME column.  Don't leak the pixbuf.
	(shortcuts_insert_path): Add the SHORTCUTS_COL_IS_VOLUME data.
	(shortcuts_free_row_data): New helper function; frees the data
	columns for an iter.
	(shortcuts_remove_rows): Don't take a callback for freeing the
	data; free everything here instead.  Use
	shortcuts_free_row_data().
	(volume_remove_cb): Removed.
	(remove_bookmark_cb): Removed.
	(remove_row_cb): Make this a single generic function to delete
	rows.
	(shortcuts_add_volumes): Use remove_row_cb().
	(shortcuts_add_bookmarks): Likewise.
	(struct _GtkFileChooserDefault): Removed the
	shortcuts_current_folder_is_volume field.
	(shortcuts_add_current_folder): Oops, don't free the volume.
	(remove_current_folder_cb): Removed.
	(shortcut_find_position): Simplify through the use of the
	SHORTCUTS_COL_IS_VOLUME column.
	(remove_selected_bookmarks): Assert that we don't get a volume.
	(shortcuts_reorder): Likewise; also, plug a leak.
	(gtk_file_chooser_default_remove_shortcut_folder): Simplify
	through the use of shortcuts_remove_rows().
	(gtk_file_chooser_default_list_shortcut_folders): Assert that we
	don't get a volume.
	(shortcuts_activate_iter): Simplify.
	(home_folder_handler): Simplify by using
	shortcuts_activate_iter().
	(shortcuts_free): New function; frees all the data columns.
	(gtk_file_chooser_default_finalize): Unref the
	shortcuts_filter_model and the shortcuts model data first.
parent 9f326d61
2004-08-18 Federico Mena Quintero <federico@ximian.com>
Merged from 2.4:
Fixes #149251:
* gtk/gtkfilechooserdefault.c: Renamed SHORTCUTS_COL_PATH to
SHORTCUTS_COL_DATA. Add SHORTCUTS_COL_IS_VOLUME, to determine
easily whether the SHORTCUTS_COL_DATA points to a GtkFilePath or a
GtkFileSystemVolume.
(shortcuts_model_create): Create a boolean column for
SHORTCUTS_COL_IS_VOLUME.
(shortcuts_reload_icons): Simplify with the use of the
SHORTCUTS_COL_IS_VOLUME column. Don't leak the pixbuf.
(shortcuts_insert_path): Add the SHORTCUTS_COL_IS_VOLUME data.
(shortcuts_free_row_data): New helper function; frees the data
columns for an iter.
(shortcuts_remove_rows): Don't take a callback for freeing the
data; free everything here instead. Use
shortcuts_free_row_data().
(volume_remove_cb): Removed.
(remove_bookmark_cb): Removed.
(remove_row_cb): Make this a single generic function to delete
rows.
(shortcuts_add_volumes): Use remove_row_cb().
(shortcuts_add_bookmarks): Likewise.
(struct _GtkFileChooserDefault): Removed the
shortcuts_current_folder_is_volume field.
(shortcuts_add_current_folder): Oops, don't free the volume.
(remove_current_folder_cb): Removed.
(shortcut_find_position): Simplify through the use of the
SHORTCUTS_COL_IS_VOLUME column.
(remove_selected_bookmarks): Assert that we don't get a volume.
(shortcuts_reorder): Likewise; also, plug a leak.
(gtk_file_chooser_default_remove_shortcut_folder): Simplify
through the use of shortcuts_remove_rows().
(gtk_file_chooser_default_list_shortcut_folders): Assert that we
don't get a volume.
(shortcuts_activate_iter): Simplify.
(home_folder_handler): Simplify by using
shortcuts_activate_iter().
(shortcuts_free): New function; frees all the data columns.
(gtk_file_chooser_default_finalize): Unref the
shortcuts_filter_model and the shortcuts model data first.
Wed Aug 18 08:31:17 2004 Manish Singh <yosh@gimp.org>
* gtk/gtkiconview.c: Applied patch from Olivier Andrieu to fix
......
2004-08-18 Federico Mena Quintero <federico@ximian.com>
Merged from 2.4:
Fixes #149251:
* gtk/gtkfilechooserdefault.c: Renamed SHORTCUTS_COL_PATH to
SHORTCUTS_COL_DATA. Add SHORTCUTS_COL_IS_VOLUME, to determine
easily whether the SHORTCUTS_COL_DATA points to a GtkFilePath or a
GtkFileSystemVolume.
(shortcuts_model_create): Create a boolean column for
SHORTCUTS_COL_IS_VOLUME.
(shortcuts_reload_icons): Simplify with the use of the
SHORTCUTS_COL_IS_VOLUME column. Don't leak the pixbuf.
(shortcuts_insert_path): Add the SHORTCUTS_COL_IS_VOLUME data.
(shortcuts_free_row_data): New helper function; frees the data
columns for an iter.
(shortcuts_remove_rows): Don't take a callback for freeing the
data; free everything here instead. Use
shortcuts_free_row_data().
(volume_remove_cb): Removed.
(remove_bookmark_cb): Removed.
(remove_row_cb): Make this a single generic function to delete
rows.
(shortcuts_add_volumes): Use remove_row_cb().
(shortcuts_add_bookmarks): Likewise.
(struct _GtkFileChooserDefault): Removed the
shortcuts_current_folder_is_volume field.
(shortcuts_add_current_folder): Oops, don't free the volume.
(remove_current_folder_cb): Removed.
(shortcut_find_position): Simplify through the use of the
SHORTCUTS_COL_IS_VOLUME column.
(remove_selected_bookmarks): Assert that we don't get a volume.
(shortcuts_reorder): Likewise; also, plug a leak.
(gtk_file_chooser_default_remove_shortcut_folder): Simplify
through the use of shortcuts_remove_rows().
(gtk_file_chooser_default_list_shortcut_folders): Assert that we
don't get a volume.
(shortcuts_activate_iter): Simplify.
(home_folder_handler): Simplify by using
shortcuts_activate_iter().
(shortcuts_free): New function; frees all the data columns.
(gtk_file_chooser_default_finalize): Unref the
shortcuts_filter_model and the shortcuts model data first.
Wed Aug 18 08:31:17 2004 Manish Singh <yosh@gimp.org>
* gtk/gtkiconview.c: Applied patch from Olivier Andrieu to fix
......
2004-08-18 Federico Mena Quintero <federico@ximian.com>
Merged from 2.4:
Fixes #149251:
* gtk/gtkfilechooserdefault.c: Renamed SHORTCUTS_COL_PATH to
SHORTCUTS_COL_DATA. Add SHORTCUTS_COL_IS_VOLUME, to determine
easily whether the SHORTCUTS_COL_DATA points to a GtkFilePath or a
GtkFileSystemVolume.
(shortcuts_model_create): Create a boolean column for
SHORTCUTS_COL_IS_VOLUME.
(shortcuts_reload_icons): Simplify with the use of the
SHORTCUTS_COL_IS_VOLUME column. Don't leak the pixbuf.
(shortcuts_insert_path): Add the SHORTCUTS_COL_IS_VOLUME data.
(shortcuts_free_row_data): New helper function; frees the data
columns for an iter.
(shortcuts_remove_rows): Don't take a callback for freeing the
data; free everything here instead. Use
shortcuts_free_row_data().
(volume_remove_cb): Removed.
(remove_bookmark_cb): Removed.
(remove_row_cb): Make this a single generic function to delete
rows.
(shortcuts_add_volumes): Use remove_row_cb().
(shortcuts_add_bookmarks): Likewise.
(struct _GtkFileChooserDefault): Removed the
shortcuts_current_folder_is_volume field.
(shortcuts_add_current_folder): Oops, don't free the volume.
(remove_current_folder_cb): Removed.
(shortcut_find_position): Simplify through the use of the
SHORTCUTS_COL_IS_VOLUME column.
(remove_selected_bookmarks): Assert that we don't get a volume.
(shortcuts_reorder): Likewise; also, plug a leak.
(gtk_file_chooser_default_remove_shortcut_folder): Simplify
through the use of shortcuts_remove_rows().
(gtk_file_chooser_default_list_shortcut_folders): Assert that we
don't get a volume.
(shortcuts_activate_iter): Simplify.
(home_folder_handler): Simplify by using
shortcuts_activate_iter().
(shortcuts_free): New function; frees all the data columns.
(gtk_file_chooser_default_finalize): Unref the
shortcuts_filter_model and the shortcuts model data first.
Wed Aug 18 08:31:17 2004 Manish Singh <yosh@gimp.org>
* gtk/gtkiconview.c: Applied patch from Olivier Andrieu to fix
......
2004-08-18 Federico Mena Quintero <federico@ximian.com>
Merged from 2.4:
Fixes #149251:
* gtk/gtkfilechooserdefault.c: Renamed SHORTCUTS_COL_PATH to
SHORTCUTS_COL_DATA. Add SHORTCUTS_COL_IS_VOLUME, to determine
easily whether the SHORTCUTS_COL_DATA points to a GtkFilePath or a
GtkFileSystemVolume.
(shortcuts_model_create): Create a boolean column for
SHORTCUTS_COL_IS_VOLUME.
(shortcuts_reload_icons): Simplify with the use of the
SHORTCUTS_COL_IS_VOLUME column. Don't leak the pixbuf.
(shortcuts_insert_path): Add the SHORTCUTS_COL_IS_VOLUME data.
(shortcuts_free_row_data): New helper function; frees the data
columns for an iter.
(shortcuts_remove_rows): Don't take a callback for freeing the
data; free everything here instead. Use
shortcuts_free_row_data().
(volume_remove_cb): Removed.
(remove_bookmark_cb): Removed.
(remove_row_cb): Make this a single generic function to delete
rows.
(shortcuts_add_volumes): Use remove_row_cb().
(shortcuts_add_bookmarks): Likewise.
(struct _GtkFileChooserDefault): Removed the
shortcuts_current_folder_is_volume field.
(shortcuts_add_current_folder): Oops, don't free the volume.
(remove_current_folder_cb): Removed.
(shortcut_find_position): Simplify through the use of the
SHORTCUTS_COL_IS_VOLUME column.
(remove_selected_bookmarks): Assert that we don't get a volume.
(shortcuts_reorder): Likewise; also, plug a leak.
(gtk_file_chooser_default_remove_shortcut_folder): Simplify
through the use of shortcuts_remove_rows().
(gtk_file_chooser_default_list_shortcut_folders): Assert that we
don't get a volume.
(shortcuts_activate_iter): Simplify.
(home_folder_handler): Simplify by using
shortcuts_activate_iter().
(shortcuts_free): New function; frees all the data columns.
(gtk_file_chooser_default_finalize): Unref the
shortcuts_filter_model and the shortcuts model data first.
Wed Aug 18 08:31:17 2004 Manish Singh <yosh@gimp.org>
* gtk/gtkiconview.c: Applied patch from Olivier Andrieu to fix
......
......@@ -176,7 +176,6 @@ struct _GtkFileChooserDefault
guint list_sort_ascending : 1;
guint changing_folder : 1;
guint shortcuts_current_folder_active : 1;
guint shortcuts_current_folder_is_volume : 1;
#if 0
guint shortcuts_drag_outside : 1;
......@@ -198,7 +197,8 @@ static guint signals[LAST_SIGNAL] = { 0 };
enum {
SHORTCUTS_COL_PIXBUF,
SHORTCUTS_COL_NAME,
SHORTCUTS_COL_PATH,
SHORTCUTS_COL_DATA,
SHORTCUTS_COL_IS_VOLUME,
SHORTCUTS_COL_REMOVABLE,
SHORTCUTS_COL_PIXBUF_VISIBLE,
SHORTCUTS_COL_NUM_COLUMNS
......@@ -621,12 +621,68 @@ gtk_file_chooser_default_init (GtkFileChooserDefault *impl)
gtk_box_set_spacing (GTK_BOX (impl), 12);
}
/* Frees the data columns for the specified iter in the shortcuts model*/
static void
shortcuts_free_row_data (GtkFileChooserDefault *impl,
GtkTreeIter *iter)
{
gpointer col_data;
gboolean is_volume;
gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), iter,
SHORTCUTS_COL_DATA, &col_data,
SHORTCUTS_COL_IS_VOLUME, &is_volume,
-1);
if (!col_data)
return;
if (is_volume)
{
GtkFileSystemVolume *volume;
volume = col_data;
gtk_file_system_volume_free (impl->file_system, volume);
}
else
{
GtkFilePath *path;
path = col_data;
gtk_file_path_free (path);
}
}
/* Frees all the data columns in the shortcuts model */
static void
shortcuts_free (GtkFileChooserDefault *impl)
{
GtkTreeIter iter;
if (!impl->shortcuts_model)
return;
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (impl->shortcuts_model), &iter))
do
{
shortcuts_free_row_data (impl, &iter);
}
while (gtk_tree_model_iter_next (GTK_TREE_MODEL (impl->shortcuts_model), &iter));
g_object_unref (impl->shortcuts_model);
impl->shortcuts_model = NULL;
}
static void
gtk_file_chooser_default_finalize (GObject *object)
{
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (object);
GSList *l;
if (impl->shortcuts_filter_model)
g_object_unref (impl->shortcuts_filter_model);
shortcuts_free (impl);
g_signal_handler_disconnect (impl->file_system, impl->volumes_changed_id);
impl->volumes_changed_id = 0;
g_signal_handler_disconnect (impl->file_system, impl->bookmarks_changed_id);
......@@ -658,12 +714,6 @@ gtk_file_chooser_default_finalize (GObject *object)
if (impl->browse_files_model)
g_object_unref (impl->browse_files_model);
if (impl->shortcuts_model)
g_object_unref (impl->shortcuts_model);
if (impl->shortcuts_filter_model)
g_object_unref (impl->shortcuts_filter_model);
if (impl->sort_model)
g_object_unref (impl->sort_model);
......@@ -880,57 +930,47 @@ static void
shortcuts_reload_icons (GtkFileChooserDefault *impl)
{
GtkTreeIter iter;
int i;
int bookmarks_separator_idx;
int current_folder_separator_idx;
int volumes_idx;
if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (impl->shortcuts_model), &iter))
return;
bookmarks_separator_idx = shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS_SEPARATOR);
current_folder_separator_idx = shortcuts_get_index (impl, SHORTCUTS_CURRENT_FOLDER_SEPARATOR);
volumes_idx = shortcuts_get_index (impl, SHORTCUTS_VOLUMES);
i = 0;
do {
gpointer data;
gboolean is_volume;
gboolean pixbuf_visible;
GdkPixbuf *pixbuf;
gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter,
SHORTCUTS_COL_PATH, &data,
SHORTCUTS_COL_DATA, &data,
SHORTCUTS_COL_IS_VOLUME &is_volume,
SHORTCUTS_COL_PIXBUF_VISIBLE, &pixbuf_visible,
-1);
if (!pixbuf_visible || !data)
goto next_iter;
if (i >= volumes_idx && i < volumes_idx + impl->num_volumes)
if (pixbuf_visible && data)
{
GtkFileSystemVolume *volume;
if (is_volume)
{
GtkFileSystemVolume *volume;
volume = data;
pixbuf = gtk_file_system_volume_render_icon (impl->file_system, volume, GTK_WIDGET (impl),
impl->icon_size, NULL);
}
else
{
const GtkFilePath *path;
volume = data;
pixbuf = gtk_file_system_volume_render_icon (impl->file_system, volume, GTK_WIDGET (impl),
impl->icon_size, NULL);
}
else
{
const GtkFilePath *path;
path = data;
pixbuf = gtk_file_system_render_icon (impl->file_system, path, GTK_WIDGET (impl),
impl->icon_size, NULL);
}
path = data;
pixbuf = gtk_file_system_render_icon (impl->file_system, path, GTK_WIDGET (impl),
impl->icon_size, NULL);
}
gtk_list_store_set (impl->shortcuts_model, &iter,
SHORTCUTS_COL_PIXBUF, pixbuf,
-1);
g_object_unref (pixbuf);
next_iter:
i++;
gtk_list_store_set (impl->shortcuts_model, &iter,
SHORTCUTS_COL_PIXBUF, pixbuf,
-1);
if (pixbuf)
g_object_unref (pixbuf);
}
} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (impl->shortcuts_model),&iter));
}
......@@ -1058,7 +1098,8 @@ shortcuts_insert_path (GtkFileChooserDefault *impl,
SHORTCUTS_COL_PIXBUF, pixbuf,
SHORTCUTS_COL_PIXBUF_VISIBLE, TRUE,
SHORTCUTS_COL_NAME, label_copy,
SHORTCUTS_COL_PATH, data,
SHORTCUTS_COL_DATA, data,
SHORTCUTS_COL_IS_VOLUME, is_volume,
SHORTCUTS_COL_REMOVABLE, removable,
-1);
......@@ -1204,14 +1245,11 @@ shortcuts_get_index (GtkFileChooserDefault *impl,
return n;
}
typedef void (* RemoveFunc) (GtkFileChooserDefault *impl, gpointer data);
/* Removes the specified number of rows from the shortcuts list */
static void
shortcuts_remove_rows (GtkFileChooserDefault *impl,
int start_row,
int n_rows,
RemoveFunc remove_fn)
int start_row,
int n_rows)
{
GtkTreePath *path;
......@@ -1220,33 +1258,17 @@ shortcuts_remove_rows (GtkFileChooserDefault *impl,
for (; n_rows; n_rows--)
{
GtkTreeIter iter;
gpointer data;
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (impl->shortcuts_model), &iter, path))
g_assert_not_reached ();
if (remove_fn)
{
gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter, SHORTCUTS_COL_PATH, &data, -1);
(* remove_fn) (impl, data);
}
shortcuts_free_row_data (impl, &iter);
gtk_list_store_remove (impl->shortcuts_model, &iter);
}
gtk_tree_path_free (path);
}
/* Used from shortcuts_remove_rows() in shortcuts_add_volumes() */
static void
volume_remove_cb (GtkFileChooserDefault *impl, gpointer data)
{
GtkFileSystemVolume *volume;
volume = data;
gtk_file_system_volume_free (impl->file_system, volume);
}
/* Adds all the file system volumes to the shortcuts model */
static void
shortcuts_add_volumes (GtkFileChooserDefault *impl)
......@@ -1260,7 +1282,7 @@ shortcuts_add_volumes (GtkFileChooserDefault *impl)
impl->changing_folder = TRUE;
start_row = shortcuts_get_index (impl, SHORTCUTS_VOLUMES);
shortcuts_remove_rows (impl, start_row, impl->num_volumes, volume_remove_cb);
shortcuts_remove_rows (impl, start_row, impl->num_volumes);
impl->num_volumes = 0;
list = gtk_file_system_list_volumes (impl->file_system);
......@@ -1301,16 +1323,6 @@ shortcuts_add_volumes (GtkFileChooserDefault *impl)
impl->changing_folder = old_changing_folders;
}
/* Used from shortcuts_remove_rows() */
static void
remove_bookmark_cb (GtkFileChooserDefault *impl, gpointer data)
{
GtkFilePath *path;
path = data;
gtk_file_path_free (path);
}
/* Inserts a separator node in the shortcuts list */
static void
shortcuts_insert_separator (GtkFileChooserDefault *impl,
......@@ -1326,7 +1338,7 @@ shortcuts_insert_separator (GtkFileChooserDefault *impl,
SHORTCUTS_COL_PIXBUF, NULL,
SHORTCUTS_COL_PIXBUF_VISIBLE, FALSE,
SHORTCUTS_COL_NAME, NULL,
SHORTCUTS_COL_PATH, NULL,
SHORTCUTS_COL_DATA, NULL,
-1);
}
......@@ -1341,13 +1353,9 @@ shortcuts_add_bookmarks (GtkFileChooserDefault *impl)
impl->changing_folder = TRUE;
if (impl->num_bookmarks > 0)
{
shortcuts_remove_rows (impl,
shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS_SEPARATOR),
impl->num_bookmarks + 1,
remove_bookmark_cb);
}
shortcuts_remove_rows (impl,
shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS_SEPARATOR),
impl->num_bookmarks + 1);
bookmarks = gtk_file_system_list_bookmarks (impl->file_system);
impl->num_bookmarks = shortcuts_append_paths (impl, bookmarks);
......@@ -1398,20 +1406,17 @@ shortcuts_add_current_folder (GtkFileChooserDefault *impl)
strcmp (gtk_file_path_get_string (base_path), gtk_file_path_get_string (impl->current_folder)) == 0)
{
success = shortcuts_insert_path (impl, pos, TRUE, volume, NULL, NULL, FALSE, NULL);
impl->shortcuts_current_folder_is_volume = TRUE;
if (!success)
gtk_file_system_volume_free (impl->file_system, volume);
}
else
{
success = shortcuts_insert_path (impl, pos, FALSE, NULL, impl->current_folder, NULL, FALSE, NULL);
impl->shortcuts_current_folder_is_volume = FALSE;
}
success = shortcuts_insert_path (impl, pos, FALSE, NULL, impl->current_folder, NULL, FALSE, NULL);
if (volume)
gtk_file_system_volume_free (impl->file_system, volume);
gtk_file_path_free (base_path);
if (base_path)
gtk_file_path_free (base_path);
if (!success)
shortcuts_remove_rows (impl, pos - 1, 1, NULL); /* remove the separator */
shortcuts_remove_rows (impl, pos - 1, 1); /* remove the separator */
impl->shortcuts_current_folder_active = success;
}
......@@ -1420,17 +1425,6 @@ shortcuts_add_current_folder (GtkFileChooserDefault *impl)
gtk_combo_box_set_active (GTK_COMBO_BOX (impl->save_folder_combo), pos);
}
/* Used from shortcuts_remove_rows() in shortcuts_update_current_folder() */
static void
remove_current_folder_cb (GtkFileChooserDefault *impl,
gpointer data)
{
if (impl->shortcuts_current_folder_is_volume)
gtk_file_system_volume_free (impl->file_system, data);
else
gtk_file_path_free (data);
}
/* Updates the current folder row in the shortcuts model */
static void
shortcuts_update_current_folder (GtkFileChooserDefault *impl)
......@@ -1441,7 +1435,7 @@ shortcuts_update_current_folder (GtkFileChooserDefault *impl)
if (impl->shortcuts_current_folder_active)
{
shortcuts_remove_rows (impl, pos, 2, remove_current_folder_cb);
shortcuts_remove_rows (impl, pos, 2);
impl->shortcuts_current_folder_active = FALSE;
}
......@@ -1479,6 +1473,7 @@ shortcuts_model_create (GtkFileChooserDefault *impl)
GDK_TYPE_PIXBUF, /* pixbuf */
G_TYPE_STRING, /* name */
G_TYPE_POINTER, /* path or volume */
G_TYPE_BOOLEAN, /* is the previous column a volume? */
G_TYPE_BOOLEAN, /* removable */
G_TYPE_BOOLEAN); /* pixbuf cell visibility */
......@@ -1664,55 +1659,52 @@ shortcut_find_position (GtkFileChooserDefault *impl,
{
GtkTreeIter iter;
int i;
int bookmarks_separator_idx;
int current_folder_separator_idx;
int volumes_idx;
if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (impl->shortcuts_model), &iter))
return -1;
bookmarks_separator_idx = shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS_SEPARATOR);
current_folder_separator_idx = shortcuts_get_index (impl, SHORTCUTS_CURRENT_FOLDER_SEPARATOR);
volumes_idx = shortcuts_get_index (impl, SHORTCUTS_VOLUMES);
i = 0;
for (i = 0; i < current_folder_separator_idx; i++)
{
gpointer data;
if (i == bookmarks_separator_idx)
goto next_iter;
gpointer col_data;
gboolean is_volume;
gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter, SHORTCUTS_COL_PATH, &data, -1);
gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter,
SHORTCUTS_COL_DATA, &col_data,
SHORTCUTS_COL_IS_VOLUME, &is_volume,
-1);
if (i >= volumes_idx && i < volumes_idx + impl->num_volumes)
if (col_data)
{
GtkFileSystemVolume *volume;
GtkFilePath *base_path;
gboolean exists;
if (is_volume)
{
GtkFileSystemVolume *volume;
GtkFilePath *base_path;
gboolean exists;
volume = data;
base_path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
volume = col_data;
base_path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
exists = strcmp (gtk_file_path_get_string (path),
gtk_file_path_get_string (base_path)) == 0;
g_free (base_path);
exists = strcmp (gtk_file_path_get_string (path),
gtk_file_path_get_string (base_path)) == 0;
g_free (base_path);
if (exists)
return i;
}
else
{
GtkFilePath *model_path;
if (exists)
return i;
}
else