Commit b45b1536 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder
Browse files

Only stat when needed.

2004-03-01  Morten Welinder  <terra@gnome.org>

	* gtk/gtkfilesystemunix.c (filename_get_info): Only stat when
	needed.
parent 8ddff5b0
2004-03-01 Morten Welinder <terra@gnome.org>
* gtk/gtkfilesystemunix.c (filename_get_info): Only stat when
needed.
* gtk/gtkfilesystemmodel.c (file_model_node_is_visible): Simplify
semantics and check for errors.
......
2004-03-01 Morten Welinder <terra@gnome.org>
* gtk/gtkfilesystemunix.c (filename_get_info): Only stat when
needed.
* gtk/gtkfilesystemmodel.c (file_model_node_is_visible): Simplify
semantics and check for errors.
......
2004-03-01 Morten Welinder <terra@gnome.org>
* gtk/gtkfilesystemunix.c (filename_get_info): Only stat when
needed.
* gtk/gtkfilesystemmodel.c (file_model_node_is_visible): Simplify
semantics and check for errors.
......
2004-03-01 Morten Welinder <terra@gnome.org>
* gtk/gtkfilesystemunix.c (filename_get_info): Only stat when
needed.
* gtk/gtkfilesystemmodel.c (file_model_node_is_visible): Simplify
semantics and check for errors.
......
2004-03-01 Morten Welinder <terra@gnome.org>
* gtk/gtkfilesystemunix.c (filename_get_info): Only stat when
needed.
* gtk/gtkfilesystemmodel.c (file_model_node_is_visible): Simplify
semantics and check for errors.
......
......@@ -1358,10 +1358,15 @@ filename_get_info (const gchar *filename,
{
GtkFileInfo *info;
struct stat statbuf;
gboolean do_stat = (types & (GTK_FILE_INFO_IS_FOLDER |
GTK_FILE_INFO_IS_HIDDEN |
GTK_FILE_INFO_MODIFICATION_TIME |
GTK_FILE_INFO_SIZE));
/* If stat fails, try to fall back to lstat to catch broken links
*/
if (stat (filename, &statbuf) != 0 &&
if (do_stat &&
stat (filename, &statbuf) != 0 &&
lstat (filename, &statbuf) != 0)
{
gchar *filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
......
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