[gnome-commander/gcmd-1-3] Fixed problem #609342 (do not show mtime for '..')



commit 26d683c8de76b125fa0d1ebb72ca0b30eb0762fa
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Wed Feb 10 18:54:47 2010 +0100

    Fixed problem #609342 (do not show mtime for '..')

 src/gnome-cmd-file-list.cc |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index 95e73c1..052730e 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -209,11 +209,16 @@ struct FileFormatData
     gchar *fname;
     gchar *fext;
 
+    static gchar empty_string[];
+
     FileFormatData(GnomeCmdFile *f, gboolean tree_size);
     ~FileFormatData();
 };
 
 
+gchar FileFormatData::empty_string[] = "";
+
+
 inline FileFormatData::FileFormatData(GnomeCmdFile *f, gboolean tree_size)
 {
     // If the user wants a character instead of icon for filetype set it now
@@ -250,10 +255,21 @@ inline FileFormatData::FileFormatData(GnomeCmdFile *f, gboolean tree_size)
     text[GnomeCmdFileList::COLUMN_DIR]   = dpath;
     text[GnomeCmdFileList::COLUMN_SIZE]  = tree_size ? (gchar *) gnome_cmd_file_get_tree_size_as_str (f) :
                                                        (gchar *) gnome_cmd_file_get_size (f);
-    text[GnomeCmdFileList::COLUMN_DATE]  = (gchar *) gnome_cmd_file_get_mdate (f, FALSE);
-    text[GnomeCmdFileList::COLUMN_PERM]  = (gchar *) gnome_cmd_file_get_perm (f);
-    text[GnomeCmdFileList::COLUMN_OWNER] = (gchar *) gnome_cmd_file_get_owner (f);
-    text[GnomeCmdFileList::COLUMN_GROUP] = (gchar *) gnome_cmd_file_get_group (f);
+
+    if (f->info->type != GNOME_VFS_FILE_TYPE_DIRECTORY || !f->is_dotdot)
+    {
+        text[GnomeCmdFileList::COLUMN_DATE]  = (gchar *) gnome_cmd_file_get_mdate (f, FALSE);
+        text[GnomeCmdFileList::COLUMN_PERM]  = (gchar *) gnome_cmd_file_get_perm (f);
+        text[GnomeCmdFileList::COLUMN_OWNER] = (gchar *) gnome_cmd_file_get_owner (f);
+        text[GnomeCmdFileList::COLUMN_GROUP] = (gchar *) gnome_cmd_file_get_group (f);
+    }
+    else
+    {
+        text[GnomeCmdFileList::COLUMN_DATE]  = empty_string;
+        text[GnomeCmdFileList::COLUMN_PERM]  = empty_string;
+        text[GnomeCmdFileList::COLUMN_OWNER] = empty_string;
+        text[GnomeCmdFileList::COLUMN_GROUP] = empty_string;
+    }
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]