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

Opening archive breaks breadcrumbs #332

Closed
joshas opened this issue Jun 28, 2019 · 5 comments · Fixed by #414
Closed

Opening archive breaks breadcrumbs #332

joshas opened this issue Jun 28, 2019 · 5 comments · Fixed by #414

Comments

@joshas
Copy link
Contributor

joshas commented Jun 28, 2019

After opening zip archive, navigating inside and going up to parent directory, leaves breadcrumbs in broken state: first item contains path to directory:
archive-breadcrumbs

To fix it you have to go into child directory.

@MeanEYE
Copy link
Owner

MeanEYE commented Jun 30, 2019

Thanks. Breadcrumbs are in dire need of some attention. I'll fix this up.

@joshas
Copy link
Contributor Author

joshas commented May 19, 2020

Continuing conversation from #406 about fixing breadcrumbs path inside archive.

Problem is probably here, as this function returns full path to archive as root path:

def get_root_path(self, path):
"""Get root for specified path"""
return os.path.dirname(self._path)

Naive fix would be to change get_root_path result to os.path.sep that always returns root. But what other cases there might be, that this function should be aware of? Archive opened from FTP? From trash list? From another archive?

@MeanEYE
Copy link
Owner

MeanEYE commented May 19, 2020

Aaah, okay. That makes sense now. Basically what's happening is that "get_root_path" is hardcoded in breadcrumbs as /. That's why it looks like that. There are many different cases where root path will be different from usual /. From GVFS to user space mounts, medias, custom providers like WebDAV, etc.

@joshas
Copy link
Contributor Author

joshas commented May 19, 2020

So what would be the best way to get root path here? Could we use pathlib, as none of os.path functions seem to fit without additional string manipulation.

@MeanEYE
Copy link
Owner

MeanEYE commented May 19, 2020

Breadcrumbs should show full root path instead of hard coded /. But once root of current provider is reached we should display path as different provider would see it. That is current behavior as can be seen by icon for the path menu, except when reaching the root of current provider breadcrumbs are not updated to reflect that. Not sure why this is the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants