Changeset 7310


Ignore:
Timestamp:
Mar 20, 2017, 9:17:26 AM (5 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #2064: Directories displayed in the file manager doesn't follow the selected option in view/preset

It was a combination of using incorrect method to set the options and an incorrect list of options.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/util/FileUtil.java

    r6880 r7310  
    5757import java.util.ArrayList;
    5858import java.util.Arrays;
     59import java.util.Collection;
    5960import java.util.Collections;
    6061import java.util.HashMap;
     
    355356    return tree;
    356357  }
    357  
    358358  /**
    359359    Load a minimal directory tree that includes at least all the specified directories
     
    371371    throws InvalidDataException, BaseException
    372372  {
     373    return loadMinimalDirectoryTree(dc, Include.ALL, directories);
     374  }
     375
     376  /**
     377    Load a minimal directory tree that includes at least all the specified directories
     378    and their parent directories all the way up to the root or as far as the logged in user
     379    has read permission.
     380    @param dc A DbControl for accessing the database
     381    @param include Include settings for loading sub directories
     382    @param directories An array of directories
     383    @return A <code>Map</code> which maps a directory to a
     384      list of it's sub-directories. The map is guaranteed to contain an entry for each of
     385      the given directories, but the list may be empty if there are no subdirectories
     386    @throws BaseException If there is an error
     387    @since 3.11
     388  */
     389  public static Map<Directory, List<Directory>> loadMinimalDirectoryTree(DbControl dc, Collection<Include> include, Directory... directories)
     390    throws InvalidDataException, BaseException
     391  {
    373392    Map<Directory, List<Directory>> tree = new HashMap<Directory, List<Directory>>();
    374393
     
    414433    );
    415434    query.order(Orders.asc(Hql.property("name")));
    416     query.include(Include.MINE, Include.SHARED, Include.OTHERS, Include.NOT_REMOVED, Include.REMOVED);
     435    if (include != null && include.size() > 0)
     436    {
     437      query.setIncludes(include);
     438    }
    417439    query.setParameter("parents", all, Type.INT);
    418440   
  • trunk/www/filemanager/files/list_files.jsp

    r7269 r7310  
    115115  // Create directory query
    116116  final ItemQuery<Directory> directoryQuery = Directory.getQuery();
    117   directoryQuery.include(cc.getInclude());
     117  directoryQuery.setIncludes(cc.getInclude());
    118118  if (!isSearch)
    119119  {
Note: See TracChangeset for help on using the changeset viewer.