Changeset 5309 in subversion


Ignore:
Timestamp:
Oct 5, 2011 7:35:19 AM (20 months ago)
Author:
alec
Message:
  • Improved performance by skipping folders list sorting when it's not needed in folder manager
Location:
trunk/roundcubemail/program
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_imap.php

    r5302 r5309  
    29152915     * Public method for listing subscribed folders 
    29162916     * 
    2917      * @param   string  $root   Optional root folder 
    2918      * @param   string  $name   Optional name pattern 
    2919      * @param   string  $filter Optional filter 
    2920      * @param   string  $rights Optional ACL requirements 
     2917     * @param   string  $root      Optional root folder 
     2918     * @param   string  $name      Optional name pattern 
     2919     * @param   string  $filter    Optional filter 
     2920     * @param   string  $rights    Optional ACL requirements 
     2921     * @param   bool    $skip_sort Enable to return unsorted list (for better performance) 
    29212922     * 
    29222923     * @return  array   List of mailboxes/folders 
    29232924     * @access  public 
    29242925     */ 
    2925     function list_mailboxes($root='', $name='*', $filter=null, $rights=null) 
     2926    function list_mailboxes($root='', $name='*', $filter=null, $rights=null, $skip_sort=false) 
    29262927    { 
    29272928        $a_mboxes = $this->_list_mailboxes($root, $name, $filter, $rights); 
     
    29332934 
    29342935        // sort mailboxes 
    2935         $a_mboxes = $this->_sort_mailbox_list($a_mboxes); 
     2936        if (!$skip_sort) { 
     2937            $a_mboxes = $this->_sort_mailbox_list($a_mboxes); 
     2938        } 
    29362939 
    29372940        return $a_mboxes; 
     
    30403043     * Get a list of all folders available on the IMAP server 
    30413044     * 
    3042      * @param string $root   IMAP root dir 
    3043      * @param string  $name   Optional name pattern 
    3044      * @param mixed   $filter Optional filter 
    3045      * @param string  $rights Optional ACL requirements 
     3045     * @param string  $root      IMAP root dir 
     3046     * @param string  $name      Optional name pattern 
     3047     * @param mixed   $filter    Optional filter 
     3048     * @param string  $rights    Optional ACL requirements 
     3049     * @param bool    $skip_sort Enable to return unsorted list (for better performance) 
    30463050     * 
    30473051     * @return array Indexed array with folder names 
    30483052     */ 
    3049     function list_unsubscribed($root='', $name='*', $filter=null, $rights=null) 
     3053    function list_unsubscribed($root='', $name='*', $filter=null, $rights=null, $skip_sort=false) 
    30503054    { 
    30513055        // @TODO: caching 
     
    30773081 
    30783082        // filter folders and sort them 
    3079         $a_mboxes = $this->_sort_mailbox_list($a_mboxes); 
     3083        if (!$skip_sort) { 
     3084            $a_mboxes = $this->_sort_mailbox_list($a_mboxes); 
     3085        } 
    30803086 
    30813087        return $a_mboxes; 
  • trunk/roundcubemail/program/steps/settings/folders.inc

    r5087 r5309  
    204204 
    205205    $a_unsubscribed = $IMAP->list_unsubscribed(); 
    206     $a_subscribed   = $IMAP->list_mailboxes(); 
     206    $a_subscribed   = $IMAP->list_mailboxes('', '*', null, null, true); // unsorted 
    207207    $delimiter      = $IMAP->get_hierarchy_delimiter(); 
    208208    $namespace      = $IMAP->get_namespace(); 
Note: See TracChangeset for help on using the changeset viewer.