summaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
authorAndreas Henriksson <andreas@fatal.se>2009-06-23 17:40:46 +0200
committerAlexander Larsson <alexl@redhat.com>2009-06-23 17:40:46 +0200
commit454a365b0b53cce2010787f6eb4ee28c321a6375 (patch)
tree59bf9691e46217fce13ace033a0d5a90fe6eab25 /programs
parent2f253cbcd62e07e44c8643ad95d8fabcc1e39b77 (diff)
downloadgvfs-454a365b0b53cce2010787f6eb4ee28c321a6375.tar.gz
Don't show not requested info in gvfs-info (#582175)
For example: vuntz@lyon ~/>gvfs-info -a standard::content-type ~/blah.txt type: unknown size: 0 attributes: standard::content-type: text/plain type and size probably shouldn't be displayed if a specific attribute was requested..
Diffstat (limited to 'programs')
-rw-r--r--programs/gvfs-info.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/programs/gvfs-info.c b/programs/gvfs-info.c
index b3d6e0e1..8c74441c 100644
--- a/programs/gvfs-info.c
+++ b/programs/gvfs-info.c
@@ -153,11 +153,11 @@ show_info (GFileInfo *info)
name = g_file_info_get_display_name (info);
if (name)
g_print ("display name: %s\n", name);
-
+
name = g_file_info_get_edit_name (info);
if (name)
g_print ("edit name: %s\n", name);
-
+
name = g_file_info_get_name (info);
if (name)
{
@@ -165,16 +165,22 @@ show_info (GFileInfo *info)
g_print ("name: %s\n", escaped);
g_free (escaped);
}
-
- type = type_to_string (g_file_info_get_file_type (info));
- g_print ("type: %s\n", type);
-
- size = g_file_info_get_size (info);
- g_print ("size: %"G_GUINT64_FORMAT"\n", (guint64)size);
-
+
+ if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_TYPE))
+ {
+ type = type_to_string (g_file_info_get_file_type (info));
+ g_print ("type: %s\n", type);
+ }
+
+ if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_SIZE))
+ {
+ size = g_file_info_get_size (info);
+ g_print ("size: %"G_GUINT64_FORMAT"\n", (guint64)size);
+ }
+
if (g_file_info_get_is_hidden (info))
g_print ("hidden\n");
-
+
show_attributes (info);
}