From 239e679fee4d4b904d0000ea46598deac2a615cb Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Mon, 31 Aug 2015 15:33:41 +0100 Subject: [PATCH] [GTKUI] Fix date columns to use int not float --- deluge/ui/gtkui/torrentview.py | 6 +++--- deluge/ui/gtkui/torrentview_data_funcs.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index 82274984d..6febbf32e 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -267,11 +267,11 @@ class TorrentView(ListView, component.Component): status_field=["ratio"], default=False) self.add_func_column(_("Avail"), funcs.cell_data_ratio_avail, [float], status_field=["distributed_copies"], default=False) - self.add_func_column(_("Added"), funcs.cell_data_date_added, [float], + self.add_func_column(_("Added"), funcs.cell_data_date_added, [int], status_field=["time_added"], default=False) - self.add_func_column(_("Completed"), funcs.cell_data_date_completed, [float], + self.add_func_column(_("Completed"), funcs.cell_data_date_completed, [int], status_field=["completed_time"], default=False) - self.add_func_column(_("Complete Seen"), funcs.cell_data_date_or_never, [float], + self.add_func_column(_("Complete Seen"), funcs.cell_data_date_or_never, [int], status_field=["last_seen_complete"], default=False) self.add_texticon_column(_("Tracker"), function=funcs.cell_data_trackericon, status_field=["tracker_host", "tracker_host"], default=False) diff --git a/deluge/ui/gtkui/torrentview_data_funcs.py b/deluge/ui/gtkui/torrentview_data_funcs.py index 54e544932..9a0361c1d 100644 --- a/deluge/ui/gtkui/torrentview_data_funcs.py +++ b/deluge/ui/gtkui/torrentview_data_funcs.py @@ -269,7 +269,7 @@ def cell_data_date(column, cell, model, row, data, key): return func_last_value[key] = date - date_str = common.fdate(date) if date > 0.0 else "" + date_str = common.fdate(date) if date > 0 else "" cell.set_property('text', date_str) cell_data_date_added = partial(cell_data_date, key="cell_data_date_added") @@ -284,5 +284,5 @@ def cell_data_date_or_never(column, cell, model, row, data): return func_last_value["cell_data_date_or_never"] = value - date_str = common.fdate(value) if value > 0.0 else _("Never") + date_str = common.fdate(value) if value > 0 else _("Never") cell.set_property('text', date_str)