Commit 865d3dd2 authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

revert earlier change to insert_path so that we test that the directory

Thu Mar 11 16:18:51 2004  Jonathan Blandford  <jrb@redhat.com>

        * gtk/gtkfilechooserdefault.c (shortcuts_insert_path): revert
        earlier change to insert_path so that we test that the directory
        exists.

        * gtk/gtkfilechooserdialog.c
        (gtk_file_chooser_dialog_constructor): move focus.
parent c2028081
Thu Mar 11 16:18:51 2004 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): revert
earlier change to insert_path so that we test that the directory
exists.
* gtk/gtkfilechooserdialog.c
(gtk_file_chooser_dialog_constructor): move focus.
Thu Mar 11 22:12:14 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use the same
......
Thu Mar 11 16:18:51 2004 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): revert
earlier change to insert_path so that we test that the directory
exists.
* gtk/gtkfilechooserdialog.c
(gtk_file_chooser_dialog_constructor): move focus.
Thu Mar 11 22:12:14 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use the same
......
Thu Mar 11 16:18:51 2004 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): revert
earlier change to insert_path so that we test that the directory
exists.
* gtk/gtkfilechooserdialog.c
(gtk_file_chooser_dialog_constructor): move focus.
Thu Mar 11 22:12:14 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use the same
......
Thu Mar 11 16:18:51 2004 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): revert
earlier change to insert_path so that we test that the directory
exists.
* gtk/gtkfilechooserdialog.c
(gtk_file_chooser_dialog_constructor): move focus.
Thu Mar 11 22:12:14 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use the same
......
Thu Mar 11 16:18:51 2004 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): revert
earlier change to insert_path so that we test that the directory
exists.
* gtk/gtkfilechooserdialog.c
(gtk_file_chooser_dialog_constructor): move focus.
Thu Mar 11 22:12:14 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkspinbutton.c (gtk_spin_button_size_request): Use the same
......
......@@ -878,6 +878,8 @@ get_file_info (GtkFileSystem *file_system, const GtkFilePath *path, gboolean nam
GtkFileFolder *parent_folder;
GtkFileInfo *info;
info = NULL;
if (!gtk_file_system_get_parent (file_system, path, &parent_path, error))
return NULL;
......@@ -890,17 +892,11 @@ get_file_info (GtkFileSystem *file_system, const GtkFilePath *path, gboolean nam
error);
gtk_file_path_free (parent_path);
if (parent_folder)
{
info = gtk_file_folder_get_info (parent_folder, path, error);
g_object_unref (parent_folder);
}
else
{
info = NULL;
/* Name-only should not fail. */
g_return_val_if_fail (!name_only, NULL);
}
if (!parent_folder)
return NULL;
info = gtk_file_folder_get_info (parent_folder, path, error);
g_object_unref (parent_folder);
return info;
}
......@@ -923,10 +919,6 @@ shortcuts_insert_path (GtkFileChooserDefault *impl,
gpointer data;
GtkTreeIter iter;
/* Note: currently this function cannot fail. If you ever change
* it so it can, go check callers and their callers.
*/
if (is_volume)
{
data = volume;
......@@ -936,14 +928,18 @@ shortcuts_insert_path (GtkFileChooserDefault *impl,
}
else
{
/* Always check to make sure that the directory exists. */
GtkFileInfo *info = get_file_info (impl->file_system, path, FALSE, error);
if (info == NULL)
return FALSE;
if (label)
label_copy = g_strdup (label);
else
{
GtkFileInfo *info = get_file_info (impl->file_system, path, TRUE, error);
label_copy = g_strdup (gtk_file_info_get_display_name (info));
gtk_file_info_free (info);
}
label_copy = g_strdup (gtk_file_info_get_display_name (info));
gtk_file_info_free (info);
data = gtk_file_path_copy (path);
pixbuf = gtk_file_system_render_icon (impl->file_system, path, GTK_WIDGET (impl),
......@@ -3940,15 +3936,8 @@ gtk_file_chooser_default_add_shortcut_folder (GtkFileChooser *chooser,
{
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
gboolean result;
GtkFileInfo *info;
int pos;
/* Test validity of path here. */
info = get_file_info (impl->file_system, path, FALSE, error);
if (!info)
return FALSE;
gtk_file_info_free (info);
pos = shortcuts_get_pos_for_shortcut_folder (impl, impl->num_shortcuts);
result = shortcuts_insert_path (impl, pos, FALSE, NULL, path, NULL, FALSE, error);
......
......@@ -331,19 +331,20 @@ gtk_file_chooser_dialog_constructor (GType type,
else
priv->widget = g_object_new (GTK_TYPE_FILE_CHOOSER_WIDGET, NULL);
_gtk_file_chooser_embed_initial_focus (GTK_FILE_CHOOSER_EMBED (priv->widget));
g_signal_connect (priv->widget, "file-activated",
G_CALLBACK (file_chooser_widget_file_activated), object);
g_signal_connect (priv->widget, "default-size-changed",
G_CALLBACK (file_chooser_widget_default_size_changed), object);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox), priv->widget, TRUE, TRUE, 0);
gtk_widget_show (priv->widget);
_gtk_file_chooser_set_delegate (GTK_FILE_CHOOSER (object),
GTK_FILE_CHOOSER (priv->widget));
_gtk_file_chooser_embed_initial_focus (GTK_FILE_CHOOSER_EMBED (priv->widget));
gtk_widget_pop_composite_child ();
return object;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment