mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
Only stat when needed.
2004-03-01 Morten Welinder <terra@gnome.org> * gtk/gtkfilesystemunix.c (filename_get_info): Only stat when needed.
This commit is contained in:
parent
8ddff5b098
commit
b45b1536a9
@ -1,5 +1,8 @@
|
||||
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.
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
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.
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
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.
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
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.
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user