diff --git a/deluge/core/core.py b/deluge/core/core.py
index 3d7f1e807..73fb277a9 100644
--- a/deluge/core/core.py
+++ b/deluge/core/core.py
@@ -494,12 +494,12 @@ class Core(
# Emit the torrent_status signal to the clients
return status_dict
- def export_get_filter_tree(self , hide_zero_hits=False, hide_cat=None):
+ def export_get_filter_tree(self , show_zero_hits=True, hide_cat=None):
"""
returns {field: [(value,count)] }
for use in sidebar(s)
"""
- return self.filtermanager.get_filter_tree(hide_zero_hits, hide_cat)
+ return self.filtermanager.get_filter_tree(show_zero_hits, hide_cat)
def export_get_session_state(self):
"""Returns a list of torrent_ids in the session."""
diff --git a/deluge/core/filtermanager.py b/deluge/core/filtermanager.py
index 529492719..80f6d5324 100644
--- a/deluge/core/filtermanager.py
+++ b/deluge/core/filtermanager.py
@@ -117,7 +117,7 @@ class FilterManager(component.Component):
return torrent_ids
- def get_filter_tree(self, hide_zero_hits=False, hide_cat=None):
+ def get_filter_tree(self, show_zero_hits=True, hide_cat=None):
"""
returns {field: [(value,count)] }
for use in sidebar.
@@ -138,7 +138,7 @@ class FilterManager(component.Component):
value = status[field]
items[field][value] = items[field].get(value, 0) + 1
- if "state" in tree_keys and hide_zero_hits:
+ if "state" in tree_keys and not show_zero_hits:
self._hide_state_items(items["state"])
#return a dict of tuples:
@@ -177,7 +177,7 @@ class FilterManager(component.Component):
def filter_state_active(self, torrent_ids):
get_status = self.core.export_get_torrent_status
for torrent_id in list(torrent_ids):
- status = get_status(torrent_id, ["download_payload_rate","upload_payload_rate"])
+ status = get_status(torrent_id, ["download_payload_rate", "upload_payload_rate"])
if status["download_payload_rate"] or status["upload_payload_rate"]:
pass #ok
else:
@@ -185,7 +185,7 @@ class FilterManager(component.Component):
return torrent_ids
def _hide_state_items(self, state_items):
- "for hide_zero hits"
+ "for hide(show)-zero hits"
for (value, count) in state_items.items():
if value != "All" and count == 0:
del state_items[value]
diff --git a/deluge/tests/test_filters.py b/deluge/tests/test_filters.py
index c8007f72b..51f5e64ea 100644
--- a/deluge/tests/test_filters.py
+++ b/deluge/tests/test_filters.py
@@ -49,8 +49,8 @@ for field, items in sclient.get_filter_tree().iteritems():
for value, count in items:
print "-",value,count
-print "#tree: Hide_zero"
-for field, items in sclient.get_filter_tree(True).iteritems():
+print "#tree: Hide_zero (show=False)"
+for field, items in sclient.get_filter_tree(False).iteritems():
print "*",field
for value, count in items:
print "-",value,count
diff --git a/deluge/ui/gtkui/filtertreeview.py b/deluge/ui/gtkui/filtertreeview.py
index 476a9968a..4b2edad88 100644
--- a/deluge/ui/gtkui/filtertreeview.py
+++ b/deluge/ui/gtkui/filtertreeview.py
@@ -251,13 +251,10 @@ class FilterTreeView(component.Component):
def update(self):
try:
- log.debug("--")
- log.debug(self.config["sidebar_show_trackers"])
- log.debug(self.config["sidebar_hide_zero"])
hide_cat = []
if not self.config["sidebar_show_trackers"]:
hide_cat = ["tracker_host"]
- aclient.get_filter_tree(self.cb_update_filter_tree, self.config["sidebar_hide_zero"], hide_cat)
+ aclient.get_filter_tree(self.cb_update_filter_tree, self.config["sidebar_show_zero"], hide_cat)
except Exception, e:
log.debug(e)
diff --git a/deluge/ui/gtkui/glade/main_window.glade b/deluge/ui/gtkui/glade/main_window.glade
index eca685f20..d334d122c 100644
--- a/deluge/ui/gtkui/glade/main_window.glade
+++ b/deluge/ui/gtkui/glade/main_window.glade
@@ -195,9 +195,9 @@
True
True
-