/* Tree column data callback for the file list; fetches the mtime of a file */
static void
list_mtime_data_func (GtkTreeViewColumn *tree_column,
		      GtkCellRenderer   *cell,
		      GtkTreeModel      *tree_model,
		      GtkTreeIter       *iter,
		      gpointer           data)
{
  GtkFileChooserDefault *impl;
  const GtkFileInfo *info;
  time_t time_mtime;   /*RSS: changed from 64-bit Gtime to 32-bit time_t */
  struct tm *tm_local_mtime;        /*RSS added; GDate mtime was removed */
  char buf[256];
  gboolean sensitive = TRUE;

  impl = data;

  info = get_list_file_info (impl, iter);
  if (!info)
    {
      g_object_set (cell,
		    "text", "",
		    "sensitive", TRUE,
		    NULL);
      return;
    }

  /* truncation is harmless until 2038 */
  time_mtime = (time_t) gtk_file_info_get_modification_time (info);

  if (time_mtime == 0)
    {
      strcpy (buf, _("Unknown"));
    }
  else
    {
      tm_local_mtime = localtime (&time_mtime);
      if (tm_local_mtime != NULL )
            strftime (buf, sizeof(buf), " %c ", tm_local_mtime);

    /* buf() is stil empty if either localtime() or strftime() failed */
    if (strlen(buf) < 6) strcpy (buf, _("Unknown"));
    }

  if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
      impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
    sensitive = gtk_file_info_get_is_folder (info);

  g_object_set (cell,
		"text", buf,
		"sensitive", sensitive,
		NULL);
}
