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

Fix recognition of missing XDG user directories #4650

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

codesoap
Copy link
Contributor

@codesoap codesoap commented Feb 18, 2024

Description:

In dialog/file_xdg.go there was some code to check, if a user directory does not exist. This code did not work for me, because locURI.String() was, for example, file:///home/richard/ when the "Videos" directory wasn't found. homeUri.Strin() was file:///home/richard.

I am not sure if xdg-user-dir always outputs the trailing slash, so I took a conservative approach and used strings.TrimRight.

I've added a second commit, which prevents the errors from getFavoriteLocation to be overwritten by errors from storage.ListerForURI.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@coveralls
Copy link

coveralls commented Feb 20, 2024

Coverage Status

coverage: 64.751% (+0.02%) from 64.729%
when pulling 63aa9e0 on codesoap:xdg_favorites
into ca0e9e5 on fyne-io:develop.

dialog/file_xdg.go Outdated Show resolved Hide resolved
Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

Thanks

@andydotxyz andydotxyz merged commit 29ee090 into fyne-io:develop Feb 20, 2024
12 checks passed
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.

3 participants