From dead0864ad50abf3ac286ac96b47f4cfb968a200 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Fri, 26 Oct 2007 20:10:29 +0000 Subject: [PATCH] better way to show number of connections --- src/deluge_core.cpp | 4 ++-- src/interface.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index 3c9d1b174..7727a5996 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -646,7 +646,6 @@ static PyObject *torrent_set_max_connections_global(PyObject *self, PyObject *ar // printf("Setting max connections: %d\r\n", max_conn); M_ses->set_max_connections(max_conn); - Py_INCREF(Py_None); return Py_None; } @@ -1217,11 +1216,12 @@ static PyObject *torrent_get_session_info(PyObject *self, PyObject *args) { session_status s = M_ses->status(); - return Py_BuildValue("{s:l,s:f,s:f,s:l,s:f,s:f}", + return Py_BuildValue("{s:l,s:f,s:f,s:ls:l,s:f,s:f}", "has_incoming_connections", long(s.has_incoming_connections), "upload_rate", float(s.payload_upload_rate), "download_rate", float(s.payload_download_rate), "num_peers", long(s.num_peers), + "num_connections", long(M_ses->num_connections()), "total_downloaded", float(s.total_payload_download), "total_uploaded", float(s.total_payload_upload)); } diff --git a/src/interface.py b/src/interface.py index 6e304cc43..71fb7cf29 100644 --- a/src/interface.py +++ b/src/interface.py @@ -1091,7 +1091,7 @@ window, please enter your password")) def update_statusbar_and_tray(self): plugin_messages = self.plugins.get_plugin_tray_messages() core_state = self.manager.get_state() - connections = core_state['num_peers'] + connections = core_state['num_connections'] if self.config.get("max_connections_global") < 0 : max_connections = _("Unlimited") else: