diff --git a/ChangeLog b/ChangeLog index 7b2f3c11a2..2b223341b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-05-01 Matthias Clasen + + Merge from trunk: + + * gtk/gtkfilesystemmodel.c (_gtk_file_system_model_path_do): + Don't ignore the fact that gtk_file_system_get_parent() + may return NULL. (#424042, Jan Martinek) + 2007-05-01 Dan Winship Merge from trunk: @@ -9,28 +17,28 @@ Merge from trunk: - * gtk/gtkfilechooserdefault.c (struct UpdateCurrentFolderData), - (update_current_folder_get_info_cb): add a new struct field to clear - the file entry after the current folder has been updated. + * gtk/gtkfilechooserdefault.c (struct UpdateCurrentFolderData), + (update_current_folder_get_info_cb): add a new struct field to clear + the file entry after the current folder has been updated. - (gtk_file_chooser_default_update_current_folder), - (change_folder_and_display_error): Add a new function parameter to - trigger file entry clearing. + (gtk_file_chooser_default_update_current_folder), + (change_folder_and_display_error): Add a new function parameter to + trigger file entry clearing. - (edited_idle_create_folder_cb), - (file_list_drag_data_received_get_info_cb), - (gtk_file_chooser_default_map), - (gtk_file_chooser_default_set_current_folder), - (switch_to_selected_folder), (save_entry_get_info_cb), - (shortcuts_activate_volume_mount_cb), (shortcuts_activate_volume), - (shortcuts_activate_get_info_cb), (list_row_activated), - (path_bar_clicked): use new function parameter appropriately. + (edited_idle_create_folder_cb), + (file_list_drag_data_received_get_info_cb), + (gtk_file_chooser_default_map), + (gtk_file_chooser_default_set_current_folder), + (switch_to_selected_folder), (save_entry_get_info_cb), + (shortcuts_activate_volume_mount_cb), (shortcuts_activate_volume), + (shortcuts_activate_get_info_cb), (list_row_activated), + (path_bar_clicked): use new function parameter appropriately. - (gtk_file_chooser_default_should_respond): trigger file entry clearing - after the directory is updated instead of clearing it before, this way - we avoid reloading the completion model with the soon to be old folder, - causing a warning and a glitch in the folder where completion happens. - (#379414, Carlos Garnacho) + (gtk_file_chooser_default_should_respond): trigger file entry clearing + after the directory is updated instead of clearing it before, this way + we avoid reloading the completion model with the soon to be old folder, + causing a warning and a glitch in the folder where completion happens. + (#379414, Carlos Garnacho) 2007-05-01 Matthias Clasen diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index 4398883712..f6be38fc11 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -1134,7 +1134,7 @@ out: * @user_data: data to pass to @func * * Locates @path within @model, referencing - * (gtk_tree_model_ref_node ()) all parent nodes, + * (gtk_tree_model_ref_node()) all parent nodes, * calls @func passing in the path and iter for @path, * then unrefs all the parent nodes. * @@ -1146,10 +1146,7 @@ out: * * This function is particularly useful for expanding * a #GtkTreeView to a particular point in the file system. - * - * Return value: %TRUE if the path was successfully - * found in @model and @func was called. - **/ + */ void _gtk_file_system_model_path_do (GtkFileSystemModel *model, const GtkFilePath *path, @@ -1161,15 +1158,17 @@ _gtk_file_system_model_path_do (GtkFileSystemModel *model, FileModelNode *node; struct RefPathData *info; - if (gtk_file_path_compare (path, model->root_path) == 0 - || !gtk_file_system_get_parent (model->file_system, path, &parent_path, NULL)) + if (gtk_file_path_compare (path, model->root_path) == 0 || + !gtk_file_system_get_parent (model->file_system, path, &parent_path, NULL) || + parent_path == NULL) return; paths = g_slist_prepend (paths, gtk_file_path_copy (path)); while (gtk_file_path_compare (parent_path, model->root_path) != 0) { paths = g_slist_prepend (paths, parent_path); - if (!gtk_file_system_get_parent (model->file_system, parent_path, &parent_path, NULL)) + if (!gtk_file_system_get_parent (model->file_system, parent_path, &parent_path, NULL) || + parent_path == NULL) { gtk_file_paths_free (paths); return;