After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691558 - glocalfile: Only check for .hidden files if standard::is-hidden is requested
glocalfile: Only check for .hidden files if standard::is-hidden is requested
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-01-11 16:13 UTC by Colin Walters
Modified: 2013-01-11 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glocalfile: Only check for .hidden files if standard::is-hidden is requested (1.53 KB, patch)
2013-01-11 16:13 UTC, Colin Walters
accepted-commit_now Details | Review

Description Colin Walters 2013-01-11 16:13:54 UTC
Created attachment 233243 [details] [review]
glocalfile: Only check for .hidden files if standard::is-hidden is requested

For OSTree, I use Gio and also really care about performance.  It's
disturbing to see open('.hidden') all over my straces and such.  At
the moment I have an explicit set of things to query, as opposed to
"standard::*", since even before this that also implies an lstat() of
the parent directory.

This matches up with what we do for all the other attributes.

See https://bugzilla.gnome.org/show_bug.cgi?id=587806
---
 gio/glocalfileinfo.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
Comment 1 Cosimo Cecchi 2013-01-11 16:17:23 UTC
Makes sense to me
Comment 2 Allison Karlitskaya (desrt) 2013-01-11 17:05:34 UTC
Review of attachment 233243 [details] [review]:

Patch looks good, assuming you've tested it.

Sorry for the careless regression here.
Comment 3 Colin Walters 2013-01-11 17:41:10 UTC
(In reply to comment #2)
> Review of attachment 233243 [details] [review]:
> 
> Patch looks good, assuming you've tested it.

My test case was:

strace -eopen gjs -c 'imports.gi.Gio.File.new_for_path("/etc/passwd").query_info("standard::name,standard::is-hidden", 0, null);'

Before, I saw stat(".hidden") - after, no stat.

It looks to me like gtk3 has standard::is-hidden in gtk/gtkfilechooserdefault.c:MODEL_ATTRIBUTES, so we should be good.
Comment 4 Colin Walters 2013-01-11 17:42:31 UTC
Er...I meant the reverse of that (without ::is-hidden, no stat, with it, a stat).  Anyways it works =)