Skip to content
Snippets Groups Projects
Commit abcf8d73 authored by Sergios - Anestis Kefalidis's avatar Sergios - Anestis Kefalidis Committed by Alexander Schwinn
Browse files

Reduce indentation

parent c86f519b
No related branches found
No related tags found
No related merge requests found
......@@ -401,94 +401,91 @@ thunar_util_humanize_file_time (guint64 file_time,
gint diff;
/* check if the file_time is valid */
if (G_LIKELY (file_time != 0))
{
ftime = (time_t) file_time;
if (G_UNLIKELY (file_time != 0))
return g_strdup (_("Unknown"));
/* take a copy of the local file time */
tfile = *localtime (&ftime);
ftime = (time_t) file_time;
/* check which style to use to format the time */
if (date_style == THUNAR_DATE_STYLE_SIMPLE || date_style == THUNAR_DATE_STYLE_SHORT)
{
/* setup the dates for the time values */
g_date_set_time_t (&dfile, (time_t) ftime);
g_date_set_time_t (&dnow, time (NULL));
/* take a copy of the local file time */
tfile = *localtime (&ftime);
/* determine the difference in days */
diff = g_date_get_julian (&dnow) - g_date_get_julian (&dfile);
if (diff == 0)
{
if (date_style == THUNAR_DATE_STYLE_SIMPLE)
{
/* TRANSLATORS: file was modified less than one day ago */
return g_strdup (_("Today"));
}
else /* if (date_style == THUNAR_DATE_STYLE_SHORT) */
{
/* TRANSLATORS: file was modified less than one day ago */
return exo_strdup_strftime (_("Today at %X"), &tfile);
}
}
else if (diff == 1)
/* check which style to use to format the time */
if (date_style == THUNAR_DATE_STYLE_SIMPLE || date_style == THUNAR_DATE_STYLE_SHORT)
{
/* setup the dates for the time values */
g_date_set_time_t (&dfile, (time_t) ftime);
g_date_set_time_t (&dnow, time (NULL));
/* determine the difference in days */
diff = g_date_get_julian (&dnow) - g_date_get_julian (&dfile);
if (diff == 0)
{
if (date_style == THUNAR_DATE_STYLE_SIMPLE)
{
if (date_style == THUNAR_DATE_STYLE_SIMPLE)
{
/* TRANSLATORS: file was modified less than two days ago */
return g_strdup (_("Yesterday"));
}
else /* if (date_style == THUNAR_DATE_STYLE_SHORT) */
{
/* TRANSLATORS: file was modified less than two days ago */
return exo_strdup_strftime (_("Yesterday at %X"), &tfile);
}
/* TRANSLATORS: file was modified less than one day ago */
return g_strdup (_("Today"));
}
else
else /* if (date_style == THUNAR_DATE_STYLE_SHORT) */
{
if (diff > 1 && diff < 7)
{
/* Days from last week */
date_format = (date_style == THUNAR_DATE_STYLE_SIMPLE) ? "%A" : _("%A at %X");
}
else
{
/* Any other date */
date_format = (date_style == THUNAR_DATE_STYLE_SIMPLE) ? "%x" : _("%x at %X");
}
/* format the date string accordingly */
return exo_strdup_strftime (date_format, &tfile);
/* TRANSLATORS: file was modified less than one day ago */
return exo_strdup_strftime (_("Today at %X"), &tfile);
}
}
else if (date_style == THUNAR_DATE_STYLE_LONG)
else if (diff == 1)
{
/* use long, date(1)-like format string */
return exo_strdup_strftime ("%c", &tfile);
}
else if (date_style == THUNAR_DATE_STYLE_YYYYMMDD)
{
return exo_strdup_strftime ("%Y-%m-%d %H:%M:%S", &tfile);
}
else if (date_style == THUNAR_DATE_STYLE_MMDDYYYY)
{
return exo_strdup_strftime ("%m-%d-%Y %H:%M:%S", &tfile);
}
else if (date_style == THUNAR_DATE_STYLE_DDMMYYYY)
{
return exo_strdup_strftime ("%d-%m-%Y %H:%M:%S", &tfile);
if (date_style == THUNAR_DATE_STYLE_SIMPLE)
{
/* TRANSLATORS: file was modified less than two days ago */
return g_strdup (_("Yesterday"));
}
else /* if (date_style == THUNAR_DATE_STYLE_SHORT) */
{
/* TRANSLATORS: file was modified less than two days ago */
return exo_strdup_strftime (_("Yesterday at %X"), &tfile);
}
}
else /* if (date_style == THUNAR_DATE_STYLE_CUSTOM) */
else
{
if (date_custom_style == NULL)
return g_strdup ("");
if (diff > 1 && diff < 7)
{
/* Days from last week */
date_format = (date_style == THUNAR_DATE_STYLE_SIMPLE) ? "%A" : _("%A at %X");
}
else
{
/* Any other date */
date_format = (date_style == THUNAR_DATE_STYLE_SIMPLE) ? "%x" : _("%x at %X");
}
/* use custom date formatting */
return exo_strdup_strftime (date_custom_style, &tfile);
/* format the date string accordingly */
return exo_strdup_strftime (date_format, &tfile);
}
}
else if (date_style == THUNAR_DATE_STYLE_LONG)
{
/* use long, date(1)-like format string */
return exo_strdup_strftime ("%c", &tfile);
}
else if (date_style == THUNAR_DATE_STYLE_YYYYMMDD)
{
return exo_strdup_strftime ("%Y-%m-%d %H:%M:%S", &tfile);
}
else if (date_style == THUNAR_DATE_STYLE_MMDDYYYY)
{
return exo_strdup_strftime ("%m-%d-%Y %H:%M:%S", &tfile);
}
else if (date_style == THUNAR_DATE_STYLE_DDMMYYYY)
{
return exo_strdup_strftime ("%d-%m-%Y %H:%M:%S", &tfile);
}
else /* if (date_style == THUNAR_DATE_STYLE_CUSTOM) */
{
if (date_custom_style == NULL)
return g_strdup ("");
/* the file_time is invalid */
return g_strdup (_("Unknown"));
/* use custom date formatting */
return exo_strdup_strftime (date_custom_style, &tfile);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment