summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-02-06 19:59:56 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-02-06 19:59:56 +0000
commitcf119827779b5987cc1c770af5a81b76afb2079e (patch)
tree74793d2b89a60ee791b7ccbf31a56e03384a3952
parent3094218489b1e14e4e6462b93180425a1b04f86d (diff)
--enable-debug in configure script and fix possible divide by zero in torrent updates
-rw-r--r--configure.ac19
-rw-r--r--src/trg-torrent-model.c2
2 files changed, 11 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index acc8c8d..0dcf36a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
#AC_PREREQ([2.65])
-AC_INIT(transmission-remote-gtk, 0.1, alan@eth0.org.uk)
-AM_INIT_AUTOMAKE(transmission-remote-gtk, 0.1.0)
+AC_INIT(transmission-remote-gtk, 0.1.1, alan@eth0.org.uk)
+AM_INIT_AUTOMAKE(transmission-remote-gtk, 0.1.1)
AC_OUTPUT(Makefile src/Makefile)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
@@ -10,12 +10,11 @@ AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CC
-
-# Checks for header files.
-
AC_CHECK_HEADERS([stdlib.h string.h])
+AC_TYPE_SIZE_T
+
+AM_GCONF_SOURCE_2
-# Checks for programs.
PKG_CHECK_MODULES([jsonglib], [json-glib-1.0])
PKG_CHECK_MODULES([gthread], [gthread-2.0])
PKG_CHECK_MODULES([gconf], [gconf-2.0])
@@ -37,8 +36,10 @@ if test "x$have_geoip" = "xyes"; then
fi
AM_CONDITIONAL([HAVE_GEOIP], [test "x$have_geoip" = "xyes"])
-AC_TYPE_SIZE_T
-
-AM_GCONF_SOURCE_2
+AC_ARG_ENABLE(debug, [AS_HELP_STRING(--enable-debug,
+ [enable debugging])])
+if test x$enable_debug = xyes; then
+ AC_DEFINE([DEBUG], [], [enable debugging])
+fi
AC_OUTPUT
diff --git a/src/trg-torrent-model.c b/src/trg-torrent-model.c
index 89ce37d..95406fe 100644
--- a/src/trg-torrent-model.c
+++ b/src/trg-torrent-model.c
@@ -206,7 +206,7 @@ update_torrent_iter(gint64 serial, TrgTorrentModel * model,
TORRENT_COLUMN_DOWNLOADED, downloaded,
TORRENT_COLUMN_RATIO,
uploaded >
- 0 ? (double) uploaded / (double) downloaded : 0,
+ 0 && downloaded > 0 ? (double) uploaded / (double) downloaded : 0,
TORRENT_COLUMN_ID, id, TORRENT_COLUMN_JSON, t,
TORRENT_COLUMN_UPDATESERIAL, serial, -1);