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
COMMON: Adding default iconspath functionality #4024
base: master
Are you sure you want to change the base?
Conversation
It's for macOS only right now.
Good thing. Except I have couple notes regarding the API naming and some functionality
This PR sets default locations for macOS, Windows, and other POSIX platforms (i.e. Linux). Are there others that I should include? |
I think backends with unusually paths can be skipped to allow backend porter decide to add it or precise what path here |
I agree to @aquadran. We should focus on "sane defaults" for the most common platforms since the other platforms are most likely so different that it should be up to the porters to decide. |
I just tested in on Win32, works as advertised. |
This works with my proposed suggestion. Else, it didn't prepend the HOME prefix.
This now match what is done in getDefaultLogFileName
return Common::String(); | ||
} | ||
|
||
return iconsPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return iconsPath; | |
return Common::String::format("%s/%s", prefix, iconsPath.c_str()); |
return Common::String(); | ||
} | ||
|
||
const Common::String appSupportFolder = Common::String(prefix) + "/Library/Application Support/ScummVM"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to add a new function in macosx_wrapper.mm
Common::String getAppSupportPathMacOSX() {
// See comments in getDesktopPathMacOSX() as we use the same methods
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
if ([paths count] == 0)
return Common::String();
NSString *path = [paths objectAtIndex:0];
if (path == nil)
return Common::String();
return Common::String([path fileSystemRepresentation]) + "/ScummVM";
}
Beside using the correct API to get the path, this will also be useful if we finally decide to migrate the savegames there.
Implements Feature Request #13538.
This PR adds a default value for the
iconspath
setting, allowing users to download icons without specifying one. It is generally in the "application support" folder or equivalent, as specified by the operating system guidelines.As this is my first big change to the ScummVM codebase, feedback is welcome on how to polish this PR!