summaryrefslogtreecommitdiff
path: root/src/windows.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-08-01 01:06:57 +0200
committermathieui <mathieui@mathieui.net>2012-08-01 01:06:57 +0200
commit71f813af289ff4df6e4721f56c907d78aa609e69 (patch)
tree77034550713e6da64516c3bf691ef0626e9abbea /src/windows.py
parent1625a4f41fa6727e41b0546687d72a3101b2b2bf (diff)
downloadpoezio-71f813af289ff4df6e4721f56c907d78aa609e69.tar.gz
poezio-71f813af289ff4df6e4721f56c907d78aa609e69.tar.bz2
poezio-71f813af289ff4df6e4721f56c907d78aa609e69.tar.xz
poezio-71f813af289ff4df6e4721f56c907d78aa609e69.zip
Add a roster_group_sort option, which works like roster_sort
- defaults to "name" (sort by group name) - document it - also, micro-optimize get_nb_connected_contacts()
Diffstat (limited to 'src/windows.py')
-rw-r--r--src/windows.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/windows.py b/src/windows.py
index da80c989..4da0cff6 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -1610,7 +1610,8 @@ class RosterWin(Win):
y = 1
show_offline = config.get('roster_show_offline', 'false') == 'true'
sort = config.get('roster_sort', 'jid_show') or 'jid_show'
- for group in roster.get_groups()[:]:
+ group_sort = config.get('roster_group_sort', 'name') or 'name'
+ for group in roster.get_groups(group_sort):
contacts_filtered = group.get_contacts(roster.contact_filter)
if (not show_offline and group.get_nb_connected_contacts() == 0) or not contacts_filtered:
continue # Ignore empty groups