round up to full hours for time periods over two hours.

2007-01-15  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-close.c (gimp_time_since): round up
	to full hours for time periods over two hours.


svn path=/trunk/; revision=21714
This commit is contained in:
Sven Neumann
2007-01-15 13:34:36 +00:00
committed by Sven Neumann
parent a5a99d055c
commit 87bbb162f9
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2007-01-15 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-close.c (gimp_time_since): round up
to full hours for time periods over two hours.
2007-01-15 Sven Neumann <sven@gimp.org>
* plug-ins/common/curve_bend.c: cleaned up sanity checks and

View File

@ -309,11 +309,19 @@ gimp_time_since (guint then,
else if (diff > 20)
diff = ((diff + 3) / 5) * 5;
if (diff >= 120)
/* determine full hours */
if (diff >= 60)
{
*hours = diff / 60;
diff = (diff % 60);
}
/* round up to full hours for 2 and more */
if (*hours > 1 && diff > 0)
{
*hours += 1;
diff = 0;
}
*minutes = diff;
}