From cee72682e68ddc8ba25f6cb2aec30809257f066d Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Tue, 13 Feb 2007 12:25:11 +0000 Subject: [PATCH] fix contact list refresh after Show/Hide Offline button is clicked --- .../gui/main/contactlist/ContactList.java | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java index 04c452cd4..07eb905fb 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactList.java @@ -1120,10 +1120,27 @@ public void setShowOffline(boolean isShowOffline) int newListSize = listModel.getSize(); - if(listSize > 0 && newListSize > 0) + //hide offline users + if(!isShowOffline && listSize > 0) { - listModel.contentChanged(0, newListSize - 1); - listModel.contentRemoved(newListSize - 1, listSize - 1); + if(newListSize > 0) + { + listModel.contentChanged(0, newListSize - 1); + listModel.contentRemoved(newListSize - 1, listSize - 1); + } + else + listModel.contentRemoved(0, listSize - 1); + } + //show offline users + else if(isShowOffline && newListSize > 0) + { + if(listSize > 0) + { + listModel.contentChanged(0, listSize - 1); + listModel.contentAdded(listSize - 1, newListSize - 1); + } + else + listModel.contentAdded(0, newListSize - 1); } }