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



commit 17870726692e1082ef85bdedb93c3adf2cf54289
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Wed Feb 10 18:44:46 2010 +0100

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

 NEWS                       |    1 +
 doc/C/gnome-commander.xml  |    3 +++
 src/gnome-cmd-file-list.cc |   24 ++++++++++++++++++++----
 3 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index f6c6107..c2b2d4b 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ gnome-commander 1.2.8.5
 Bug fixes:
  * Fixed problem #604558 (cursor lost/placed in wrong position)
  * Fixed problem #604904 (build error on OpenSolaris)
+ * Fixed problem #609342 (do not show mtime for '..')
  * Fixed problem with editing connections to Windows network
  * Fixed problem with nonexistent user actions
 
diff --git a/doc/C/gnome-commander.xml b/doc/C/gnome-commander.xml
index 0d68c98..d4b09ed 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -6053,6 +6053,9 @@
                             <para>Fixed problem #604904 (build error on OpenSolaris)</para>
                         </listitem>
                         <listitem>
+                            <para>Fixed problem #609342 (do not show mtime for '..')</para>
+                        </listitem>
+                        <listitem>
                             <para>Fixed problem with editing connections to Windows network</para>
                         </listitem>
                         <listitem>
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]