summaryrefslogtreecommitdiff
path: root/gtk/gtkpathbar.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2004-03-15 05:42:51 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2004-03-15 05:42:51 +0000
commit084bb2fe391b4117aed6903b46840f334e53a51a (patch)
tree9ad443b086f3b9c24133a034322ce6b654437255 /gtk/gtkpathbar.c
parent6bc9b7f5b49f3517b114db9a536f15f486a5058e (diff)
downloadgtk+-084bb2fe391b4117aed6903b46840f334e53a51a.tar.gz
Allow the path to be NULL, so that people can ask for information about a
2004-03-14 Federico Mena Quintero <federico@ximian.com> * gtk/gtkfilesystem.c (gtk_file_folder_get_info): Allow the path to be NULL, so that people can ask for information about a parent-less file system root (e.g. get_info (get_folder ("/"), NULL)). * gtk/gtkfilesystemunix.c (gtk_file_folder_unix_get_info): Allow the condition describe above. * gtk/gtkfilechooserdefault.c (get_file_info): Allow getting information of root paths. * gtk/gtkpathbar.c (_gtk_path_bar_set_path): Handle root paths correctly.
Diffstat (limited to 'gtk/gtkpathbar.c')
-rw-r--r--gtk/gtkpathbar.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 770309ea1f..9bf2f7a19e 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -989,13 +989,20 @@ _gtk_path_bar_set_path (GtkPathBar *path_bar,
parent_path ? parent_path : path,
GTK_FILE_INFO_DISPLAY_NAME,
NULL);
- file_info = gtk_file_folder_get_info (file_folder, path, error);
+ if (!file_folder)
+ {
+ result = FALSE;
+ gtk_file_path_free (parent_path);
+ gtk_file_path_free (path);
+ break;
+ }
+
+ file_info = gtk_file_folder_get_info (file_folder, parent_path ? path : NULL, error);
g_object_unref (file_folder);
if (!file_info)
{
result = FALSE;
-
gtk_file_path_free (parent_path);
gtk_file_path_free (path);
break;