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



commit 19d0c99e647e94becaa98746034c0da529c88027
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 7c352e3..439e866 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,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 d53eb65..3163729 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -6028,6 +6028,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 d1fb641..b042a21 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -199,11 +199,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
@@ -240,10 +245,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]