[maemo-commits] [maemo-commits] r12974 - in projects/haf/trunk/hildon-fm: . debian hildon-fm

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Jul 31 20:55:17 EEST 2007
Author: marivoll
Date: 2007-07-31 20:55:15 +0300 (Tue, 31 Jul 2007)
New Revision: 12974

Modified:
   projects/haf/trunk/hildon-fm/ChangeLog
   projects/haf/trunk/hildon-fm/debian/changelog
   projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-details-dialog.c
   projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-selection.c
Log:
	* hildon-fm/hildon-file-details-dialog.c
	(hildon_file_details_dialog_set_file_iter): Set date and time to
	"-" when file time is exactly zero.
	* hildon-fm/hildon-file-selection.c (get_date_string): Return "-"
	when time is exactly zero. (N52599)


Modified: projects/haf/trunk/hildon-fm/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-fm/ChangeLog	2007-07-31 17:38:36 UTC (rev 12973)
+++ projects/haf/trunk/hildon-fm/ChangeLog	2007-07-31 17:55:15 UTC (rev 12974)
@@ -1,5 +1,11 @@
 2007-07-31  Marius Vollmer  <marius.vollmer at nokia.com>
 
+	* hildon-fm/hildon-file-details-dialog.c
+	(hildon_file_details_dialog_set_file_iter): Set date and time to
+	"-" when file time is exactly zero.
+	* hildon-fm/hildon-file-selection.c (get_date_string): Return "-"
+	when time is exactly zero. (N52599)
+
 	* hildon-fm/hildon-file-system-model.c
 	(hildon_file_system_model_add_node): Set file_info of model_node
 	even if the model_node was already present since the file_info

Modified: projects/haf/trunk/hildon-fm/debian/changelog
===================================================================
--- projects/haf/trunk/hildon-fm/debian/changelog	2007-07-31 17:38:36 UTC (rev 12973)
+++ projects/haf/trunk/hildon-fm/debian/changelog	2007-07-31 17:55:15 UTC (rev 12974)
@@ -1,6 +1,6 @@
 libhildonfm (1:1.9.37~unreleased) unstable; urgency=low
 
-  * Fixes: NB#62101.
+  * Fixes: NB#62101, NB#52599.
 
  -- Marius Vollmer <marius.vollmer at nokia.com>  Mon, 30 Jul 2007 20:09:58 +0300
 

Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-details-dialog.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-details-dialog.c	2007-07-31 17:38:36 UTC (rev 12973)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-details-dialog.c	2007-07-31 17:55:15 UTC (rev 12974)
@@ -764,23 +764,31 @@
 
   g_object_set(self->priv->file_size, "label", buffer, NULL);
 
-  /* Too bad. We cannot use GDate function, because it doesn't handle
-      time, just dates */
-  time_val = (time_t) time_stamp;
-  time_struct = localtime(&time_val);
+  if (time_stamp != 0)
+    {
+      /* Too bad. We cannot use GDate function, because it doesn't handle
+	 time, just dates */
+      time_val = (time_t) time_stamp;
+      time_struct = localtime(&time_val);
+      
+      /* There are no more logical names for these. We are allowed
+	 to hardcode */
+      strftime(buffer, sizeof(buffer), "%X", time_struct);
+      g_object_set(self->priv->file_time, "label", buffer, NULL);
+      
+      /* If format is passed directly to strftime, gcc complains about
+	 that some locales use only 2 digit year numbers. Using
+	 a temporary disable this warning (from strftime man page) */
+      fmt = "%x";
+      strftime(buffer, sizeof(buffer), fmt, time_struct);
+      g_object_set(self->priv->file_date, "label", buffer, NULL);
+    }
+  else
+    {
+      g_object_set(self->priv->file_time, "label", "-", NULL);
+      g_object_set(self->priv->file_date, "label", "-", NULL);
+    }
 
-  /* There are no more logical names for these. We are allowed
-      to hardcode */
-  strftime(buffer, sizeof(buffer), "%X", time_struct);
-  g_object_set(self->priv->file_time, "label", buffer, NULL);
-
-  /* If format is passed directly to strftime, gcc complains about
-      that some locales use only 2 digit year numbers. Using
-      a temporary disable this warning (from strftime man page) */
-  fmt = "%x";
-  strftime(buffer, sizeof(buffer), fmt, time_struct);
-  g_object_set(self->priv->file_date, "label", buffer, NULL);
-
   {
     GdkPixbuf *icon;
 

Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-selection.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-selection.c	2007-07-31 17:38:36 UTC (rev 12973)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-selection.c	2007-07-31 17:55:15 UTC (rev 12974)
@@ -1834,6 +1834,9 @@
     struct tm *time_struct;
     time_t time_val;
 
+    if (file_time == 0)
+      return "-";
+
     /* Bad, but this was also used in GtkFileChooserDefault */
     g_date_set_time(&ftime, (GTime) file_time);
     g_date_set_time(&now, (GTime) time(NULL));
@@ -1908,10 +1911,10 @@
     }
     else
     {
-        line2 = get_date_string(file_time,
-                                _("sfil_li_modified_today"),
-                                _("sfil_li_modified_thisyear"),
-                                _("sfil_li_modified_earlier"));
+      line2 = get_date_string(file_time,
+			      _("sfil_li_modified_today"),
+			      _("sfil_li_modified_thisyear"),
+			      _("sfil_li_modified_earlier"));
     }
 
     if(thumb_title && thumb_title[0] )


More information about the maemo-commits mailing list