#8344 closed Patch (fixed)
Focus the last directory when navigating to it's parent
Reported by: | dudu | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | FileZilla Client |
Keywords: | Cc: | ||
Component version: | Operating system type: | ||
Operating system version: |
Description
Now when filezilla goes up to a parent directory it selects the ".." entry instead of the directory we are coming from.
It should select and focus the directory its coming from and make sure it's visible.
This ticker is related to #1878
I've coded up a solution that implements this behavior. Patch attached against latest svn trunk (r4847)
Attachments (1)
Change History (7)
comment:1 by , 12 years ago
Status: | new → moreinfo |
---|
comment:2 by , 12 years ago
Thanks for the review, I've updated the patch. This version should address all three issues and the memory usage remark too.
comment:3 by , 12 years ago
Summary: | Select and Focus the last directory when navigating to it's parent → Focus the last directory when navigating to it's parent |
---|
Removed mention to focus from the summary since the patch does not concerned with focusing items.
comment:4 by , 12 years ago
1) state.cpp:311: Condition seems wrong. Going from /foo/bar to /foo/baz would focus bar.
2) Parents are recursive. Both /foo/ and /foo/bar/ are a parent of /foo/bar/baz, yet when going from /foo/bar/baz to /foo, bar should be focused, not baz.
by , 12 years ago
Attachment: | reselect_item_we_are_coming_from_in_parent_directory.patch added |
---|
Patch implementing the ticket, version 3
comment:5 by , 12 years ago
Please see the (once again) updated patch, I've replaced the conditions to only set refocus information if the the user navigates to up to the direct parent of a current directory.
If the navigation skip levels of subdirectory then no focus will be remembered. I'm not sure what the correct behaviour should be, total-commander seem to be only remember one level changes (at least when using the alt+down history list to jump more than one level) as this patch does.
comment:6 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | moreinfo → closed |
Thanks, it's in with some small cleanup. I've renamed the variables and functions in CState, as that class shouldn't refer to GUI-specific concepts if it can be avoided.
Three issues:
1) The distinction between selected and focused is important. With your patch, extra directories are being selected when a listing is being refreshed.
To reproduce:
Before: Second-last item focused but not selected
After: Second-last item selected as well.
2) Catching exception once as copy, once as non-const reference. Somewhat inconsistent. Perhaps use const ref for both?
3) Coding style. Please follow the conventions of the surrounding code, e.g. position of opening brackets.
Other remarks:
I wonder how this affects memory usage in very long running sessions. Compared to some other caches, this one probably is negligible though.