-
Notifications
You must be signed in to change notification settings - Fork 181
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
Configuration path should have single source of truth #2196
Comments
I've been moving stuff around and cleaning things up in the ECS branch around this, I think that makes it better? |
not quite, a quick search for master branch:
ECS branch:
The way I interpret this (in the ECS branch) is that each |
Resources providers have nothing to do with preferences, the whole point of those is that there can be multiple sources of resources. |
Well, I'll just go through them
This one definitely must be the same one as the one in config.cpp, as else the options are saved somewhere where they are not going to be loaded from.
This seems to not be a resource provider but rather a way to store script state, there is only one place it is stored, it would be confusing if it would still use
Yes, these are resource providers and they don't do any harm when they look there and there's nothing there, but maybe same point, it is a bit confusing and configurability via options would be nice? |
Maybe something along these lines: PreferencesManager::set("resource_path", configuration_path + "/resources/:" + configuration_path + "/scripts/");
std:string resource_path = PreferencesManager::get("resource_path");
size_t left = 0;
size_t right = 0;
while (left < resource_path.size()) {
right = resource_path.find(':', left);
std::string resource_directory = resource_path.substr(left, right-left);
new DirectoryResourceProvider(resource_directory);
left = right + 1;
} (I know the loop is not nice at all, I'm not that good with string handling in C++) So basically just a setting (with the current stuff as defaults) where one can set a |
Back when I made #2047 I only changed one of apparently four (I realized it because of #1437) places where the configuration path is being decided. It would make sense to just have one single place where the selection logic is run.
My suggestions would be to either:
If I get told which way is prefered, I will implement it and make a pull request. (Also if wished I could directly incorporate #1437 in it.)
The text was updated successfully, but these errors were encountered: