Initialize contactlist data object only when needed, for better performance of addressbook folders (with groups) list
This commit is contained in:
parent
8c6e9286c2
commit
1b5ea4983d
1 changed files with 13 additions and 3 deletions
|
@ -825,6 +825,16 @@ class rcube_kolab_contacts extends rcube_addressbook
|
|||
{
|
||||
if (!isset($this->contactstorage)) {
|
||||
$this->contactstorage = $this->storagefolder->getData(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Establishes a connection to the Kolab_Data object for accessing groups data
|
||||
*/
|
||||
private function _connect_groups()
|
||||
{
|
||||
if (!isset($this->liststorage)) {
|
||||
$this->liststorage = $this->storagefolder->getData('distributionlist');
|
||||
}
|
||||
}
|
||||
|
@ -837,7 +847,7 @@ class rcube_kolab_contacts extends rcube_addressbook
|
|||
{
|
||||
if (!isset($this->contacts)) {
|
||||
$this->_connect();
|
||||
|
||||
|
||||
// read contacts
|
||||
$this->contacts = $this->id2uid = array();
|
||||
foreach ((array)$this->contactstorage->getObjects() as $record) {
|
||||
|
@ -872,8 +882,8 @@ class rcube_kolab_contacts extends rcube_addressbook
|
|||
private function _fetch_groups()
|
||||
{
|
||||
if (!isset($this->distlists)) {
|
||||
$this->_connect();
|
||||
|
||||
$this->_connect_groups();
|
||||
|
||||
$this->distlists = $this->groupmembers = array();
|
||||
foreach ((array)$this->liststorage->getObjects() as $record) {
|
||||
// FIXME: folders without any distribution-list objects return contacts instead ?!
|
||||
|
|
Loading…
Add table
Reference in a new issue