Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor FileList and FileCommander (#2746)
* [FileList.py] Enhance and optimize the code - Load and cache all images when the code is loaded. This produces a significant speed increase to the performance of this code. - Complete the merge of the single and multi selection modes into a single base class. - Provide methods to switch the file list between single and multi select modes. - Fix the getSortBy() and setSortBy() methods to be the same syntax. - Optimize the fileListComponent() method as it is heavily used in tight loops. - Remember the last using index and restore to the same location if the current path has been removed. This should highlight the next item in the list. If at the end of the list then the highlight will move up to the last item of the list. - Add new methods to set, clear or toggle all items in the file list. There are options to only change directories, files or both. - Allow refresh to specify current entry * Update plugin.py - Remove the "multileft" and multiright" widgets as they are no longer required with the new and improved FileList.py. - Before processing and directory or file check that it still exists and hasn't been removed by another task/process. - When in MultiSelect mode change the title to show the current number of items selected. - Issues of one or other or both panels becoming active or inactive with entering and exiting MultiSelect mode should now all be resolved. - Code optimization should make this version of FileCommander smaller and faster than all previous versions. - Tidy up the code a bit more. - Bump the version number. - Add directory/file delete confirmations like copy and move operations. - Remove superfluous delete confirmation for single files. - Update available buttons when transitioning to/from MultiSelect. - Correct the protected directory paths. - Implement the protected directories in the Delete, Move and Rename functions. - The Copy, Move and Rename functions now attempt to position the cursor to the target entries and locations. For example, when you rename an entry the cursor will move to the new name of the entry in the source column. Similarly if you Copy or Move an entry the cursor in the target column will move to the newly copies or moved entry. - When a new directory is created jump to the newly created directory entry. - Symbolic links are now created in the target directory and automatically set to be the current item. - Use the improved FileList.pt refresh() method rather than the changeDir() method to better reinforce that we are simply refreshing the column but specifying the entry to be made current. - Optimize directory size calculations: Don't count the size is special system directories, mounted file systems or links as these do not contribute to the space used on the file system being analysed. This also radically improves the performance of this code.
- Loading branch information