Do not check whether the path is a folder. It is useful to bookmark files

2005-11-11  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Do not
	check whether the path is a folder.  It is useful to bookmark
	files as well (e.g. todo.txt), and this will also help
	performance.
	(shortcuts_add_bookmark_from_path): Likewise.
	(shortcuts_activate_iter): Change folders or select files, as
	appropriate.
This commit is contained in:
Federico Mena Quintero 2005-11-11 22:29:09 +00:00 committed by Federico Mena Quintero
parent 0fa618282f
commit c100ebd2da
3 changed files with 24 additions and 15 deletions

View File

@ -1,3 +1,13 @@
2005-11-11 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Do not
check whether the path is a folder. It is useful to bookmark
files as well (e.g. todo.txt), and this will also help
performance.
(shortcuts_add_bookmark_from_path): Likewise.
(shortcuts_activate_iter): Change folders or select files, as
appropriate.
2005-11-11 Federico Mena Quintero <federico@ximian.com>
* tests/autotestfilechooser.c (main): Use

View File

@ -1,3 +1,13 @@
2005-11-11 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Do not
check whether the path is a folder. It is useful to bookmark
files as well (e.g. todo.txt), and this will also help
performance.
(shortcuts_add_bookmark_from_path): Likewise.
(shortcuts_activate_iter): Change folders or select files, as
appropriate.
2005-11-11 Federico Mena Quintero <federico@ximian.com>
* tests/autotestfilechooser.c (main): Use

View File

@ -1275,12 +1275,6 @@ shortcuts_insert_path (GtkFileChooserDefault *impl,
}
else
{
if (!check_is_folder (impl->file_system, path, error))
{
profile_end ("end - is not folder", NULL);
return FALSE;
}
if (label)
label_copy = g_strdup (label);
else
@ -2035,14 +2029,6 @@ shortcuts_add_bookmark_from_path (GtkFileChooserDefault *impl,
if (shortcut_find_position (impl, path) != -1)
return FALSE;
/* FIXME: this check really belongs in gtk_file_system_insert_bookmark. */
error = NULL;
if (!check_is_folder (impl->file_system, path, &error))
{
error_adding_bookmark_dialog (impl, path, error);
return FALSE;
}
error = NULL;
if (!gtk_file_system_insert_bookmark (impl->file_system, path, pos, &error))
{
@ -6759,7 +6745,10 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl,
const GtkFilePath *file_path;
file_path = col_data;
change_folder_and_display_error (impl, file_path);
if (check_is_folder (impl->file_system, file_path, NULL))
change_folder_and_display_error (impl, file_path);
else
gtk_file_chooser_default_select_path (GTK_FILE_CHOOSER (impl), file_path, NULL);
}
}