-
Notifications
You must be signed in to change notification settings - Fork 31
Fixed a long comment bug and redesigned document validating #84
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
Conversation
|
Just for curiosity, do you know a quick way to modify the box layout characters if I need to increase the columns width ? The reasons I used |
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 am uncertain about your proposition. I do not think that parsing the file with an XML parser is the best way to solve your problem. It is true that
your proposition is solving the issue but there are two things that I do not like:
- It is now duplicating the "loading" code and also duplicating the way a Configuration File is loaded. Both
Configuration::IsValidConfigFile()andConfiguration::LoadFile()will have to be modified if a correction is required. - Each file are now parsed twice before loading. A single xml file is first parsed in
Configuration::IsValidConfigFile()when validated here and then it is deleted/discarded and then a second time when it is actually loaded here.
When I have written Configuration::IsValidConfigFile() function, the purpose was to quickly discard files that were not Configuration Files. This was for performance reason. It we parse each file twice, I think it defies the performance purpose of first validating the file. I think it would be better to just load the file and see if the load is successful.
I think it would be a better idea to completely delete the function Configuration::IsValidConfigFile() and rethink how ConfigManager::Refresh() is implemented. For example, we could simply remove line 104 and let the line Configuration * config = Configuration::LoadFile(file_path, error); deal with actual file loading. If we try to load an invalid file, a NULL Configuration will be returned.
What do you think ?
|
Maybe we could to leave extension check, for example I store not only xml files but also logs and icons in ShellAnything sub-forlders. |
|
Yes. I like what you proposed. From what I understand, we should rewrite Please proceed with the corrections. Push your changes again to the same branch. I think GitHub will pick up the changes and update the pull request. Add a message in this PR once done (so that I will be notified by email) |
|
In IsValidConfigFile method I left extension check only. |
end2endzone
left a comment
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.
Good!
Resolves #78 , resolves #80