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

Custom image file path corrected #3119

Merged

Conversation

Vafthrudnir
Copy link
Contributor

Related Ticket(s)

Short roundup of the initial problem

When you clicked on the "Open custom image folder" menu item the My Documents folder opened instead of the real custom image folder.

Explanation of the change

  • The problem was caused by having a double /character in the customPicsPath variable: the default picsPath endend with /, to which the /CUSTOM/ string was concatenated. Unfortunately, when a custom path is set for the pics folder, the new path will not end with this trailing /, thus adding only CUSTOM/ to it won't work properly. I solved this by checking whether the path ends with a slash or not and adding the appropriate string based on that. This way the fix won't cause a problem to either those who set up a custom path, nor to those who left it on default.
  • On portable builds, /data/ string was added to the data path, while on normal builds the QStandardPaths::writableLocation call returns a path without the trailing /. This caused an error message on portable versions (see Baccanno's screenshots in the related issue). This has also been solved.
  • I tested it on Windows 10 OS, where the fix works for both the portable and the normal versions. Theoretically it shouldn't cause problems on Mac or Linux either, but it still needs to be checked.

Copy link
Member

@Daenyth Daenyth left a comment

Choose a reason for hiding this comment

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

We probably didn't notice this before because it's going to be windows specific. // in a path is equal to / on linux/bsd/osx

@ZeldaZach ZeldaZach merged commit 941a06e into Cockatrice:master Feb 26, 2018
@Vafthrudnir Vafthrudnir deleted the hotfix/2069_custom_image_folder_error branch February 26, 2018 07:49
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.

Open custom image folder broken!
3 participants