Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileManager: safe initial path #11774

Merged
merged 2 commits into from May 16, 2024
Merged

FileManager: safe initial path #11774

merged 2 commits into from May 16, 2024

Conversation

hius07
Copy link
Member

@hius07 hius07 commented May 8, 2024

We do not like trailing slash in the path (except root).
Closes #11772.


This change is Reviewable

@@ -731,7 +731,7 @@ function FileManager:reinit(path, focused_file)
UIManager:flushSettings()
self.dimen = Screen:getSize()
-- backup the root path and path items
self.root_path = path or self.file_chooser.path
self.root_path = BaseUtil.realpath(path or self.file_chooser.path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary in some other places where it does something like self.(root_)path = path then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also do it in

function FileChooser:changeToPath(path, focused_path)
path = ffiUtil.realpath(path)
self.path = path

as FileChooser:changeToPath can be called from elsewhere.

@Frenzie Frenzie added this to the 2024.05 milestone May 16, 2024
@Frenzie Frenzie merged commit db63db1 into koreader:master May 16, 2024
3 checks passed
@hius07 hius07 deleted the fm-safe-path branch May 16, 2024 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Move to archive" action triggers directory metadata and cover refresh
3 participants