#319 Merged at b915356
Magic Lantern 50D
Magic Lantern
  1. Albert Shih

Two improvements to the file_man module:

  • The directory listing now uses Mergesort to sort the files (significantly faster!)
  • File sizes were not getting pretty-printed properly (possible integer overflows in the arithmetic and incorrect rounding)

Comments (12)

  1. One Percent

    Ok, I tried it but when a folder is empty I get 01/01/970 instead of the ../ icon and I can select it.

  2. Albert Shih author

    Odd, I can't replicate your issue. When running this on my 50D, I get the expected "../" when looking in my empty folder "A:/MISC/". (I also tried a mid-December build of TL with this file_man.mo swapped in, and it also worked as expected.) What camera did you try this on?

    1. Albert Shih author

      I just tried an up-to-date build of TL, and still everything works for me as I'd expect. So, my working guesses are some camera-specific issue (50D here), some filesystem-specific issue (FAT32 here), or some super-hidden file that's being picked up (while normal hidden files appear fine).

      1. One Percent

        6D with exfat. Not sure on the 7D didn't try it there yet... maybe someone should try on 5DIII with exfat.

  3. Alex

    Found a bug: in the context menu, "View" should be first. The context menu items should not be sorted.

    If you look at the add_file_entry calls with TYPE_ACTION, the order should be: View, Copy, Move, Delete, Clear selection (optional), Select.

      1. Albert Shih author

        I went ahead and made the edit in the source to prevent the alphabetical sorting of actions. However, I won't be able to actually compile it or test it myself for half a day, so be careful if you want to test it.

        1. Alex

          Works for context menus, but for the things like "paste here" it doesn't work. You want the "paste here" item at the top, so your assumption that TYPE_ACTION should be after files is not quite true. I wanted the sorting algorithm to keep the relative order of these special items and just sort the files.

          Of course, the special items can be only at the beginning and at the end of the file list (never in the middle).

          1. Albert Shih author

            Take three! The latest edit should properly skip actions at the beginning and end of a file list, and sort only directories then files, but again, untested by me. An action that somehow shows up in the middle of a file list will confuse the sort.