Fix bug with the 'show more' contact on an LDAP query, where it repeats the first ten contacts when it is first clicked, and doesn't disappear when all available contacts have been shown.

Demonstrated to Emil on 10/04
cusax-fix
Tom Denham 13 years ago committed by Emil Ivov
parent 619546258c
commit 75fef62f93

@ -77,6 +77,9 @@ public ShowMoreContact( ContactQuery contactQuery,
this.queryResults = queryResults;
this.maxResultCount = maxResultCount;
// The contact list is already showing a number of results.
this.shownResultsCount = maxResultCount;
GuiActivator.getContactList().addContactListListener(this);
}
@ -294,7 +297,9 @@ public void contactClicked(ContactListEvent evt)
shownResultsCount = maxCount;
if (shownResultsCount < resultSize
|| contactQuery.getStatus() != ContactQuery.QUERY_COMPLETED)
|| (contactQuery.getStatus() != ContactQuery.QUERY_COMPLETED
&& contactQuery.getStatus() != ContactQuery.QUERY_ERROR))
{
GuiActivator.getContactList().addContact(
contactQuery,
this,
@ -302,6 +307,11 @@ public void contactClicked(ContactListEvent evt)
contactQuery.getContactSource()).getUIGroup(),
false);
// The ContactListListener was removed when the ShowMoreContact
// was removed from the contact list, so we need to add it
// again.
GuiActivator.getContactList().addContactListListener(this);
}
}
}

@ -207,6 +207,19 @@ private void processLdapResponse(LdapEvent evt)
}
}
if (evt.getCause() == LdapEvent.LdapEventCause.SEARCH_ERROR)
{
// The status must be set to QUERY_ERROR and the thread allowed to
// continue, otherwise the query will still appear to be in
// progress.
setStatus(ContactQuery.QUERY_ERROR);
synchronized(objLock)
{
objLock.notify();
}
}
if(evt.getCause() == LdapEvent.LdapEventCause.NEW_SEARCH_RESULT)
{
LdapPersonFound person = (LdapPersonFound) evt.getContent();

Loading…
Cancel
Save