[Thoggen-cvs] SF.net SVN: thoggen: [323] trunk/thoggen
Status: Beta
Brought to you by:
tp-m
|
From: <tp...@us...> - 2008-06-16 13:45:36
|
Revision: 323
http://thoggen.svn.sourceforge.net/thoggen/?rev=323&view=rev
Author: tp-m
Date: 2008-06-16 06:45:43 -0700 (Mon, 16 Jun 2008)
Log Message:
-----------
Patch by: anonymous hero <ogg.k.ogg.k at googlemail com>
* configure.ac:
Check for sed and ranlib; fix AC_SUBST.
* src/th-job-progress-dialog.c: (job_progress_calc_written),
(job_progress_calc_time_left):
Don't divide by 0.
Modified Paths:
--------------
trunk/thoggen/ChangeLog
trunk/thoggen/configure.ac
trunk/thoggen/src/th-job-progress-dialog.c
Modified: trunk/thoggen/ChangeLog
===================================================================
--- trunk/thoggen/ChangeLog 2008-06-13 10:09:46 UTC (rev 322)
+++ trunk/thoggen/ChangeLog 2008-06-16 13:45:43 UTC (rev 323)
@@ -1,3 +1,14 @@
+2008-06-16 Tim-Philipp Müller <tim at centricular dot net>
+
+ Patch by: anonymous hero <ogg.k.ogg.k at googlemail com>
+
+ * configure.ac:
+ Check for sed and ranlib; fix AC_SUBST.
+
+ * src/th-job-progress-dialog.c: (job_progress_calc_written),
+ (job_progress_calc_time_left):
+ Don't divide by 0.
+
2008-06-13 Tim-Philipp Müller <tim at centricular dot net>
* configure.ac:
Modified: trunk/thoggen/configure.ac
===================================================================
--- trunk/thoggen/configure.ac 2008-06-13 10:09:46 UTC (rev 322)
+++ trunk/thoggen/configure.ac 2008-06-16 13:45:43 UTC (rev 323)
@@ -13,6 +13,8 @@
AC_DEFINE([RELEASENAME],["All Quiet on the Northern Front"],[The Release Name])
AC_PROG_CC
+AC_PROG_SED
+AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_INTLTOOL([0.20])
@@ -405,13 +407,20 @@
LIBS="-pg $LIBS"
fi
-AC_SUBST([GLIB_CFLAGS GLIB_LIBS])
-AC_SUBST([GTK_CFLAGS GTK_LIBS])
-AC_SUBST([GLADE_CFLAGS GLADE_LIBS])
-AC_SUBST([GSTREAMER_CFLAGS GSTREAMER_LIBS])
-AC_SUBST([DBUS_CFLAGS DBUS_LIBS])
-AC_SUBST([DBUS_GLIB_CFLAGS DBUS_GLIB_LIBS])
-AC_SUBST([HAL_CFLAGS HAL_LIBS])
+AC_SUBST([GLIB_CFLAGS])
+AC_SUBST([GLIB_LIBS])
+AC_SUBST([GTK_CFLAGS])
+AC_SUBST([GTK_LIBS])
+AC_SUBST([GLADE_CFLAGS])
+AC_SUBST([GLADE_LIBS])
+AC_SUBST([GSTREAMER_CFLAGS])
+AC_SUBST([GSTREAMER_LIBS])
+AC_SUBST([DBUS_CFLAGS])
+AC_SUBST([DBUS_LIBS])
+AC_SUBST([DBUS_GLIB_CFLAGS])
+AC_SUBST([DBUS_GLIB_LIBS])
+AC_SUBST([HAL_CFLAGS])
+AC_SUBST([HAL_LIBS])
dnl ============================
Modified: trunk/thoggen/src/th-job-progress-dialog.c
===================================================================
--- trunk/thoggen/src/th-job-progress-dialog.c 2008-06-13 10:09:46 UTC (rev 322)
+++ trunk/thoggen/src/th-job-progress-dialog.c 2008-06-16 13:45:43 UTC (rev 323)
@@ -569,7 +569,11 @@
curpos = pos_msecs / 1000.0;
length = title_len_secs * 1.0;
- total_estimate = (bytes_written / curpos) * length;
+
+ if (curpos > 0.0)
+ total_estimate = (bytes_written / curpos) * length;
+ else
+ total_estimate = 0.0;
now_str = th_utils_get_human_size_str ((guint64) bytes_written);
@@ -626,8 +630,13 @@
curpos = pos_msecs / 1000.0;
length = title_len_secs * 1.0;
- secs_left = (elapsed / curpos) * (length - curpos);
+ if (curpos > 0.0) {
+ secs_left = (elapsed / curpos) * (length - curpos);
+ } else {
+ secs_left = 0.0;
+ }
+
/* note: secs_left might be negative, as length is not exact */
cstr = job_get_human_time_interval_str ((gint) secs_left);
eta = time (NULL) + (time_t) MAX (15.0, secs_left);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|