path is NULL is an error here (gtk_file_system_get_info() already guards

2006-03-14  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_info): path
	is NULL is an error here (gtk_file_system_get_info() already guards
	path = NULL),
	(gtk_file_system_unix_get_info): move basename creation to just
	before create_file_info().  (Federico Mena Quintero).
This commit is contained in:
Kristian Rietveld
2006-03-14 16:47:02 +00:00
committed by Kristian Rietveld
parent 31d15343ae
commit 064abaf966
3 changed files with 18 additions and 16 deletions

View File

@@ -1,3 +1,11 @@
2006-03-14 Kristian Rietveld <kris@imendio.com>
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_info): path
is NULL is an error here (gtk_file_system_get_info() already guards
path = NULL),
(gtk_file_system_unix_get_info): move basename creation to just
before create_file_info(). (Federico Mena Quintero).
2006-03-14 Kristian Rietveld <kris@imendio.com>
* gtk/gtkfilesystemunix.c (struct _GtkFileFolderUnix): add

View File

@@ -1,3 +1,11 @@
2006-03-14 Kristian Rietveld <kris@imendio.com>
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_info): path
is NULL is an error here (gtk_file_system_get_info() already guards
path = NULL),
(gtk_file_system_unix_get_info): move basename creation to just
before create_file_info(). (Federico Mena Quintero).
2006-03-14 Kristian Rietveld <kris@imendio.com>
* gtk/gtkfilesystemunix.c (struct _GtkFileFolderUnix): add

View File

@@ -736,28 +736,12 @@ gtk_file_system_unix_get_info (GtkFileSystem *file_system,
system_unix = GTK_FILE_SYSTEM_UNIX (file_system);
handle = create_handle (file_system);
/* Get info for "/" */
if (!path)
{
info = file_info_for_root_with_error ("/", &error);
g_object_ref (handle);
queue_get_info_callback (callback, handle, info, error, data);
return handle;
}
/* Get info for normal files */
filename = gtk_file_path_get_string (path);
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (g_path_is_absolute (filename), FALSE);
basename = g_path_get_basename (filename);
if (!stat_with_error (filename, &statbuf, &error))
{
g_free (basename);
g_object_ref (handle);
queue_get_info_callback (callback, handle, NULL, error, data);
return handle;
@@ -768,6 +752,8 @@ gtk_file_system_unix_get_info (GtkFileSystem *file_system,
else
mime_type = NULL;
basename = g_path_get_basename (filename);
info = create_file_info (NULL, filename, basename, types, &statbuf,
mime_type);
g_free (basename);