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)) {
|
if (!isset($this->contactstorage)) {
|
||||||
$this->contactstorage = $this->storagefolder->getData(null);
|
$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');
|
$this->liststorage = $this->storagefolder->getData('distributionlist');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -837,7 +847,7 @@ class rcube_kolab_contacts extends rcube_addressbook
|
||||||
{
|
{
|
||||||
if (!isset($this->contacts)) {
|
if (!isset($this->contacts)) {
|
||||||
$this->_connect();
|
$this->_connect();
|
||||||
|
|
||||||
// read contacts
|
// read contacts
|
||||||
$this->contacts = $this->id2uid = array();
|
$this->contacts = $this->id2uid = array();
|
||||||
foreach ((array)$this->contactstorage->getObjects() as $record) {
|
foreach ((array)$this->contactstorage->getObjects() as $record) {
|
||||||
|
@ -872,8 +882,8 @@ class rcube_kolab_contacts extends rcube_addressbook
|
||||||
private function _fetch_groups()
|
private function _fetch_groups()
|
||||||
{
|
{
|
||||||
if (!isset($this->distlists)) {
|
if (!isset($this->distlists)) {
|
||||||
$this->_connect();
|
$this->_connect_groups();
|
||||||
|
|
||||||
$this->distlists = $this->groupmembers = array();
|
$this->distlists = $this->groupmembers = array();
|
||||||
foreach ((array)$this->liststorage->getObjects() as $record) {
|
foreach ((array)$this->liststorage->getObjects() as $record) {
|
||||||
// FIXME: folders without any distribution-list objects return contacts instead ?!
|
// FIXME: folders without any distribution-list objects return contacts instead ?!
|
||||||
|
|
Loading…
Add table
Reference in a new issue